diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs index ed292ef1..0ef89b39 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs @@ -23,9 +23,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv public int InputVertices { get; } - public Dictionary<int, Instruction> UniformBuffers { get; } = new Dictionary<int, Instruction>(); - public Instruction SupportBuffer { get; set; } - public Instruction UniformBuffersArray { get; set; } + public Dictionary<int, Instruction> ConstantBuffers { get; } = new Dictionary<int, Instruction>(); public Instruction StorageBuffersArray { get; set; } public Instruction LocalMemory { get; set; } public Instruction SharedMemory { get; set; } @@ -217,7 +215,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv { IrOperandType.Argument => GetArgument(type, operand), IrOperandType.Constant => GetConstant(type, operand), - IrOperandType.ConstantBuffer => GetConstantBuffer(type, operand), IrOperandType.LocalVariable => GetLocal(type, operand), IrOperandType.Undefined => GetUndefined(type), _ => throw new ArgumentException($"Invalid operand type \"{operand.Type}\".") @@ -274,31 +271,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv }; } - public Instruction GetConstantBuffer(AggregateType type, AstOperand operand) - { - var i1 = Constant(TypeS32(), 0); - var i2 = Constant(TypeS32(), operand.CbufOffset >> 2); - var i3 = Constant(TypeU32(), operand.CbufOffset & 3); - - Instruction elemPointer; - - if (UniformBuffersArray != null) - { - var ubVariable = UniformBuffersArray; - var i0 = Constant(TypeS32(), operand.CbufSlot); - - elemPointer = AccessChain(TypePointer(StorageClass.Uniform, TypeFP32()), ubVariable, i0, i1, i2, i3); - } - else - { - var ubVariable = UniformBuffers[operand.CbufSlot]; - - elemPointer = AccessChain(TypePointer(StorageClass.Uniform, TypeFP32()), ubVariable, i1, i2, i3); - } - - return BitcastIfNeeded(type, AggregateType.FP32, Load(TypeFP32(), elemPointer)); - } - public Instruction GetLocalPointer(AstOperand local) { return _locals[local]; |