#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ #define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ #include "graphics/shader/shader.h" #include #include #include namespace Libs::Graphics { namespace HW { class Context; class UserConfig; } // namespace HW struct ShaderParams { std::span code; std::array user_data {}; // 32 user SGPRs plus the merged-stage s0:s7 prefix. uint32_t user_data_count = 0; uint64_t hash = 0; std::span back_code; [[nodiscard]] uint64_t Base() const { return reinterpret_cast(code.data()); } }; void BuildStageStaticKey(const ShaderVertexInputInfo& input_info, std::vector& key); void BuildStageStaticKey(const ShaderPixelInputInfo& input_info, std::vector& key); void BuildStageStaticKey(const ShaderComputeInputInfo& input_info, std::vector& key); ShaderParams PrepareProgram(const HW::VertexShaderInfo& regs, const HW::Context& context, const HW::UserConfig& user_config, ShaderVertexInputInfo& input_info); std::array PrepareTessellationPrograms(const HW::VertexShaderInfo& regs, const HW::Context& context, std::array& input_info); ShaderParams PrepareProgram( const HW::PixelShaderInfo& regs, const HW::ShaderRegisters& sh, std::span target_export_mapping, ShaderPixelInputInfo& input_info); ShaderParams PrepareProgram(const HW::ComputeShaderInfo& regs, const HW::ShaderRegisters& sh, ShaderComputeInputInfo& input_info); } // namespace Libs::Graphics #endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ */