diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 849839fe3..2c38f57fd 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -393,10 +393,6 @@ std::string FlowStackTopName(MetaStackClass stack) { | |||
| 393 | return fmt::format("{}_flow_stack_top", GetFlowStackPrefix(stack)); | 393 | return fmt::format("{}_flow_stack_top", GetFlowStackPrefix(stack)); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | [[deprecated]] constexpr bool IsVertexShader(ShaderType stage) { | ||
| 397 | return stage == ShaderType::Vertex; | ||
| 398 | } | ||
| 399 | |||
| 400 | struct GenericVaryingDescription { | 396 | struct GenericVaryingDescription { |
| 401 | std::string name; | 397 | std::string name; |
| 402 | u8 first_element = 0; | 398 | u8 first_element = 0; |
| @@ -529,8 +525,9 @@ private: | |||
| 529 | } | 525 | } |
| 530 | 526 | ||
| 531 | void DeclareVertex() { | 527 | void DeclareVertex() { |
| 532 | if (!IsVertexShader(stage)) | 528 | if (stage != ShaderType::Vertex) { |
| 533 | return; | 529 | return; |
| 530 | } | ||
| 534 | 531 | ||
| 535 | DeclareVertexRedeclarations(); | 532 | DeclareVertexRedeclarations(); |
| 536 | } | 533 | } |
| @@ -602,14 +599,14 @@ private: | |||
| 602 | break; | 599 | break; |
| 603 | } | 600 | } |
| 604 | } | 601 | } |
| 605 | if (!IsVertexShader(stage) || device.HasVertexViewportLayer()) { | 602 | if (stage != ShaderType::Vertex || device.HasVertexViewportLayer()) { |
| 606 | if (ir.UsesLayer()) { | 603 | if (ir.UsesLayer()) { |
| 607 | code.AddLine("int gl_Layer;"); | 604 | code.AddLine("int gl_Layer;"); |
| 608 | } | 605 | } |
| 609 | if (ir.UsesViewportIndex()) { | 606 | if (ir.UsesViewportIndex()) { |
| 610 | code.AddLine("int gl_ViewportIndex;"); | 607 | code.AddLine("int gl_ViewportIndex;"); |
| 611 | } | 608 | } |
| 612 | } else if ((ir.UsesLayer() || ir.UsesViewportIndex()) && IsVertexShader(stage) && | 609 | } else if ((ir.UsesLayer() || ir.UsesViewportIndex()) && stage == ShaderType::Vertex && |
| 613 | !device.HasVertexViewportLayer()) { | 610 | !device.HasVertexViewportLayer()) { |
| 614 | LOG_ERROR( | 611 | LOG_ERROR( |
| 615 | Render_OpenGL, | 612 | Render_OpenGL, |
| @@ -1147,7 +1144,7 @@ private: | |||
| 1147 | // TODO(Subv): Find out what the values are for the first two elements when inside a | 1144 | // TODO(Subv): Find out what the values are for the first two elements when inside a |
| 1148 | // vertex shader, and what's the value of the fourth element when inside a Tess Eval | 1145 | // vertex shader, and what's the value of the fourth element when inside a Tess Eval |
| 1149 | // shader. | 1146 | // shader. |
| 1150 | ASSERT(IsVertexShader(stage)); | 1147 | ASSERT(stage == ShaderType::Vertex); |
| 1151 | switch (element) { | 1148 | switch (element) { |
| 1152 | case 2: | 1149 | case 2: |
| 1153 | // Config pack's first value is instance_id. | 1150 | // Config pack's first value is instance_id. |
| @@ -1218,12 +1215,12 @@ private: | |||
| 1218 | UNIMPLEMENTED(); | 1215 | UNIMPLEMENTED(); |
| 1219 | return {}; | 1216 | return {}; |
| 1220 | case 1: | 1217 | case 1: |
| 1221 | if (IsVertexShader(stage) && !device.HasVertexViewportLayer()) { | 1218 | if (stage == ShaderType::Vertex && !device.HasVertexViewportLayer()) { |
| 1222 | return {}; | 1219 | return {}; |
| 1223 | } | 1220 | } |
| 1224 | return {{"gl_Layer", Type::Int}}; | 1221 | return {{"gl_Layer", Type::Int}}; |
| 1225 | case 2: | 1222 | case 2: |
| 1226 | if (IsVertexShader(stage) && !device.HasVertexViewportLayer()) { | 1223 | if (stage == ShaderType::Vertex && !device.HasVertexViewportLayer()) { |
| 1227 | return {}; | 1224 | return {}; |
| 1228 | } | 1225 | } |
| 1229 | return {{"gl_ViewportIndex", Type::Int}}; | 1226 | return {{"gl_ViewportIndex", Type::Int}}; |
| @@ -2532,7 +2529,7 @@ private: | |||
| 2532 | } | 2529 | } |
| 2533 | 2530 | ||
| 2534 | u32 GetNumPhysicalInputAttributes() const { | 2531 | u32 GetNumPhysicalInputAttributes() const { |
| 2535 | return IsVertexShader(stage) ? GetNumPhysicalAttributes() : GetNumPhysicalVaryings(); | 2532 | return stage == ShaderType::Vertex ? GetNumPhysicalAttributes() : GetNumPhysicalVaryings(); |
| 2536 | } | 2533 | } |
| 2537 | 2534 | ||
| 2538 | u32 GetNumPhysicalAttributes() const { | 2535 | u32 GetNumPhysicalAttributes() const { |