mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-22 18:30:05 +00:00
spv_shader_gen: Refactor EmitterIDs
to ModuleIds
This commit is contained in:
parent
1b370520d8
commit
591bc091da
@ -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));
|
||||||
|
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user