From 73e68edd09cc322579ec832576f766c836851fdf Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 24 Nov 2019 19:49:19 -0300 Subject: Revert "Simplify shader uniform buffer access codegen" This reverts commit 2fe9ebaf118d690be8d0cb302529dd359d7c402b. --- .../CodeGen/Glsl/Instructions/InstGenMemory.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs index 2d070e08..c535d8fc 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs @@ -116,12 +116,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions offsetExpr = Enclose(offsetExpr, src2, Instruction.ShiftRightS32, isLhs: true); - // TODO: For now this is assumed to be constant - // (we only use constant slots right now), but we should also - // support non-constant values, necessary for full LDC implementation. - int slot = ((AstOperand)src1).Value; - - return OperandManager.GetUniformBufferAccessor(slot, offsetExpr, context.Config.Stage); + return OperandManager.GetConstantBufferName(src1, offsetExpr, context.Config.Stage); } public static string LoadGlobal(CodeGenContext context, AstOperation operation) @@ -508,7 +503,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions // restrictions. int ubOffset = GlobalToStorage.GetStorageCbOffset(stage, slot); - string ubName = OperandManager.GetUniformBufferAccessor(0, ubOffset, stage); + string ubName = OperandManager.GetConstantBufferName(0, ubOffset, stage); offsetExpr = $"{offsetExpr} - int((floatBitsToUint({ubName}) & {mask}) >> 2)"; -- cgit v1.2.3