spv_shader_gen: Refactor EmitterIDs to ModuleIds

This commit is contained in:
Wunkolo 2024-03-03 14:03:40 -08:00
parent 1b370520d8
commit 591bc091da
2 changed files with 4 additions and 4 deletions

View File

@ -192,7 +192,7 @@ Id VertexModule::WriteFuncSanitizeVertex() {
return func; return func;
} }
void VertexModule::Generate(Common::UniqueFunction<void, Sirit::Module&, const EmitterIDs&> proc) { void VertexModule::Generate(Common::UniqueFunction<void, Sirit::Module&, const ModuleIds&> proc) {
AddLabel(OpLabel()); AddLabel(OpLabel());
ids.ptr_enable_clip1 = OpAccessChain(TypePointer(spv::StorageClass::Uniform, ids.u32), ids.ptr_enable_clip1 = OpAccessChain(TypePointer(spv::StorageClass::Uniform, ids.u32),
@ -209,7 +209,7 @@ void VertexModule::Generate(Common::UniqueFunction<void, Sirit::Module&, const E
std::vector<u32> GenerateTrivialVertexShader(bool use_clip_planes) { std::vector<u32> GenerateTrivialVertexShader(bool use_clip_planes) {
VertexModule module; VertexModule module;
module.Generate([use_clip_planes](Sirit::Module& spv, module.Generate([use_clip_planes](Sirit::Module& spv,
const VertexModule::EmitterIDs& ids) -> void { const VertexModule::ModuleIds& ids) -> void {
const Id pos_sanitized = spv.OpFunctionCall( const Id pos_sanitized = spv.OpFunctionCall(
ids.vec.Get(4), ids.sanitize_vertex, spv.OpLoad(ids.vec.Get(4), ids.vert_in_position)); ids.vec.Get(4), ids.sanitize_vertex, spv.OpLoad(ids.vec.Get(4), ids.vert_in_position));

View File

@ -73,7 +73,7 @@ private:
[[nodiscard]] Id WriteFuncSanitizeVertex(); [[nodiscard]] Id WriteFuncSanitizeVertex();
public: public:
struct EmitterIDs { struct ModuleIds {
/// Types /// Types
Id void_{}; Id void_{};
Id bool_{}; Id bool_{};
@ -121,7 +121,7 @@ public:
} ids; } ids;
/// Generate code using the provided SPIRV emitter context /// Generate code using the provided SPIRV emitter context
void Generate(Common::UniqueFunction<void, Sirit::Module&, const EmitterIDs&> proc); void Generate(Common::UniqueFunction<void, Sirit::Module&, const ModuleIds&> proc);
}; };
/** /**