#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ #define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ #include "graphics/host_gpu/vulkanCommon.h" #include "graphics/shader/shader.h" #include #include #include namespace Libs::Graphics { struct ShaderParams { std::span code; std::span user_data; uint64_t hash = 0; [[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::ShaderRegisters& sh, ShaderVertexInputInfo& input_info); ShaderParams PrepareProgram( const HW::PixelShaderInfo& regs, const HW::ShaderRegisters& sh, const ShaderVertexInputInfo& vertex_info, std::span target_export_mapping, ShaderPixelInputInfo& input_info); ShaderParams PrepareProgram(const HW::ComputeShaderInfo& regs, const HW::ShaderRegisters& sh, ShaderComputeInputInfo& input_info); bool MaterializeProgram(const std::shared_ptr& program, const ShaderParams& params, ShaderVertexInputInfo& input_info); bool MaterializeProgram(const std::shared_ptr& program, const ShaderParams& params, ShaderPixelInputInfo& input_info); bool MaterializeProgram(const std::shared_ptr& program, const ShaderParams& params, ShaderComputeInputInfo& input_info); vk::ShaderModule CompileProgram(vk::Device device, const ShaderParams& params, ShaderVertexInputInfo& input_info); vk::ShaderModule CompileProgram(vk::Device device, const ShaderParams& params, ShaderPixelInputInfo& input_info); vk::ShaderModule CompileProgram(vk::Device device, const ShaderParams& params, ShaderComputeInputInfo& input_info); } // namespace Libs::Graphics #endif /* EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_ */