mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
9918dc2591
Co-authored-by: shadowbeat070 <70843316+shadowbeat070@users.noreply.github.com>
43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
#ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_
|
|
#define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_SHADERCOMPILER_H_
|
|
|
|
#include "graphics/shader/shader.h"
|
|
|
|
#include <span>
|
|
#include <vector>
|
|
|
|
namespace Libs::Graphics {
|
|
|
|
namespace HW {
|
|
class Context;
|
|
class UserConfig;
|
|
} // namespace HW
|
|
|
|
struct ShaderParams {
|
|
std::span<const uint32_t> code;
|
|
std::vector<uint32_t> user_data;
|
|
uint64_t hash = 0;
|
|
std::span<const uint32_t> back_code;
|
|
|
|
[[nodiscard]] uint64_t Base() const {
|
|
return reinterpret_cast<uint64_t>(code.data());
|
|
}
|
|
};
|
|
|
|
void BuildStageStaticKey(const ShaderVertexInputInfo& input_info, std::vector<uint32_t>& key);
|
|
void BuildStageStaticKey(const ShaderPixelInputInfo& input_info, std::vector<uint32_t>& key);
|
|
void BuildStageStaticKey(const ShaderComputeInputInfo& input_info, std::vector<uint32_t>& key);
|
|
|
|
ShaderParams PrepareProgram(const HW::VertexShaderInfo& regs, const HW::Context& context,
|
|
const HW::UserConfig& user_config, ShaderVertexInputInfo& input_info);
|
|
ShaderParams PrepareProgram(
|
|
const HW::PixelShaderInfo& regs, const HW::ShaderRegisters& sh,
|
|
std::span<const Prospero::ColorComponentMapping, 8> 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_ */
|