From 25ec4eddfa441e802bd957dfaabc83b23c6bae38 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sun, 29 Mar 2020 16:15:48 +0100 Subject: [PATCH] Remove indexed path. We determined that it had negligible impact. --- .../CodeGen/Glsl/OperandManager.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs index f734580b4e..2de55b2ddd 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs @@ -116,20 +116,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl private static string GetVec4Indexed(string vectorName, string indexExpr) { - bool canIndexVec4 = false; - if (canIndexVec4) + string result = $"{vectorName}.x"; + for (int i = 1; i < 4; i++) { - return $"{vectorName}[{indexExpr}]"; - } - else - { - string result = $"{vectorName}.x"; - for (int i = 1; i < 4; i++) - { - result = $"(({indexExpr}) == {i}) ? ({vectorName}.{GetSwizzleMask(i)}) : ({result})"; - } - return $"({result})"; + result = $"(({indexExpr}) == {i}) ? ({vectorName}.{GetSwizzleMask(i)}) : ({result})"; } + return $"({result})"; } public static string GetConstantBufferName(IAstNode slot, string offsetExpr, ShaderStage stage)