shader_recompiler: Define fragment output type based on number format. (#1097)

* shader_recompiler: Define fragment output type based on number format.

* shader_recompiler: Fix GetAttribute SPIR-V output type.

* shader_recompiler: Don't bitcast on SetAttribute unless integer target.
This commit is contained in:
squidbus 2024-10-01 13:42:37 -07:00 committed by GitHub
parent 75adf7c8d1
commit e68774d449
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 97 additions and 38 deletions

View file

@ -166,6 +166,7 @@ public:
Id input_s32{};
Id output_u32{};
Id output_f32{};
Id output_s32{};
boost::container::small_vector<Id, 16> interfaces;
@ -177,8 +178,6 @@ public:
Id frag_coord{};
Id front_facing{};
Id frag_depth{};
std::array<Id, 8> frag_color{};
std::array<u32, 8> frag_num_comp{};
Id clip_distances{};
Id cull_distances{};
@ -237,11 +236,13 @@ public:
Id pointer_type;
Id component_type;
u32 num_components;
bool is_integer{};
bool is_default{};
s32 buffer_handle{-1};
};
std::array<SpirvAttribute, 32> input_params{};
std::array<SpirvAttribute, 32> output_params{};
std::array<SpirvAttribute, 8> frag_outputs{};
private:
void DefineArithmeticTypes();
@ -254,7 +255,7 @@ private:
void DefineImagesAndSamplers();
void DefineSharedMemory();
SpirvAttribute GetAttributeInfo(AmdGpu::NumberFormat fmt, Id id);
SpirvAttribute GetAttributeInfo(AmdGpu::NumberFormat fmt, Id id, bool output);
};
} // namespace Shader::Backend::SPIRV