From 464bd5fad79c59455504d10b7aa084d683817de4 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sun, 15 Mar 2020 20:49:35 -0300 Subject: [PATCH] shader/shader_ir: Change declare output attribute to a switch --- src/video_core/shader/shader_ir.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 425927777..bc75d400e 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp @@ -106,7 +106,8 @@ Node ShaderIR::GetPhysicalInputAttribute(Tegra::Shader::Register physical_addres } Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buffer) { - if (index == Attribute::Index::LayerViewportPointSize) { + switch (index) { + case Attribute::Index::LayerViewportPointSize: switch (element) { case 0: UNIMPLEMENTED(); @@ -121,8 +122,8 @@ Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buff uses_point_size = true; break; } - } - if (index == Attribute::Index::TessCoordInstanceIDVertexID) { + break; + case Attribute::Index::TessCoordInstanceIDVertexID: switch (element) { case 2: uses_instance_id = true; @@ -130,18 +131,17 @@ Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buff case 3: uses_vertex_id = true; break; - default: - break; } - } - if (index == Attribute::Index::ClipDistances0123 || - index == Attribute::Index::ClipDistances4567) { + break; + case Attribute::Index::ClipDistances0123: + case Attribute::Index::ClipDistances4567: { const auto clip_index = static_cast((index == Attribute::Index::ClipDistances4567 ? 1 : 0) + element); used_clip_distances.at(clip_index) = true; + break; + } } used_output_attributes.insert(index); - return MakeNode(index, static_cast(element), std::move(buffer)); }