mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
337f432016
Co-authored-by: Ali Almohaya <AliAlmohaya@gmail.com> Co-authored-by: Mac <me@itsmemac.com> Co-authored-by: Senaxx <michelbeld@gmail.com> Co-authored-by: Jean-Philippe <github@meunier.jp>
50 lines
1.8 KiB
C++
50 lines
1.8 KiB
C++
#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_SHADERRECOMPILER_H_
|
|
#define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_SHADERRECOMPILER_H_
|
|
|
|
#include "common/common.h"
|
|
#include "common/stringUtils.h"
|
|
#include "graphics/shader/recompiler/ir/passes/ResourceMaterialization.h"
|
|
#include "graphics/shader/shader.h"
|
|
|
|
#include <span>
|
|
#include <vector>
|
|
|
|
namespace Libs::Graphics::ShaderRecompiler {
|
|
|
|
struct CompileOptions {
|
|
ShaderType stage = ShaderType::Compute;
|
|
uint32_t wave_size = 64;
|
|
uint32_t user_data_base = 0;
|
|
uint64_t shader_hash = 0;
|
|
bool dump_ir = true;
|
|
bool early_dump = false;
|
|
const char* dump_label = nullptr;
|
|
std::span<const uint32_t> user_data;
|
|
std::span<const uint32_t> back_code;
|
|
ShaderStageInputInfo input_info;
|
|
};
|
|
|
|
struct TranslateResult {
|
|
IR::Program program;
|
|
std::string decoded_dump;
|
|
std::string cfg_dump;
|
|
};
|
|
|
|
struct CompileResult {
|
|
std::vector<uint32_t> spirv;
|
|
std::string decoded_dump;
|
|
std::string ir_dump;
|
|
IR::Program program;
|
|
};
|
|
|
|
[[nodiscard]] TranslateResult TranslateProgram(std::span<const uint32_t> code,
|
|
const CompileOptions& options);
|
|
[[nodiscard]] CompileResult CompileProgram(TranslateResult translated,
|
|
const CompileOptions& options,
|
|
const IR::ResourceSpecialization& specialization,
|
|
uint32_t push_data_start_dword = 0);
|
|
|
|
} // namespace Libs::Graphics::ShaderRecompiler
|
|
|
|
#endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_SHADERRECOMPILER_H_ */
|