diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-05-27 11:07:10 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-27 16:07:10 +0200 |
| commit | 5795bb15282498b3824a5d15fe1ff78b85a18c23 (patch) | |
| tree | 6d4ee54c218e81fc6efaad279a5b1ade3ca8ec59 /Ryujinx.Graphics.Shader/IntermediateRepresentation | |
| parent | 0b6d206daad7202d4e271118b631feb7dd363bbc (diff) | |
Support separate textures and samplers (#1216)
* Support separate textures and samplers
* Add missing bindless flag, fix SNORM format on buffer textures
* Add missing separation
* Add comments about the new handles
Diffstat (limited to 'Ryujinx.Graphics.Shader/IntermediateRepresentation')
| -rw-r--r-- | Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs | 14 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs | 12 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs index 6b7fb82f..2c4a88cd 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs @@ -1,3 +1,5 @@ +using System; + namespace Ryujinx.Graphics.Shader.IntermediateRepresentation { class Operation : INode @@ -78,6 +80,18 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation _sources[index] = source; } + protected void RemoveSource(int index) + { + SetSource(index, null); + + Operand[] newSources = new Operand[_sources.Length - 1]; + + Array.Copy(_sources, 0, newSources, 0, index); + Array.Copy(_sources, index + 1, newSources, index, _sources.Length - (index + 1)); + + _sources = newSources; + } + public void TurnIntoCopy(Operand source) { TurnInto(Instruction.Copy, source); diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs index 06541f90..9c5cd25c 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs @@ -26,8 +26,18 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation public void TurnIntoIndexed(int handle) { Type |= SamplerType.Indexed; - Flags &= ~TextureFlags.Bindless; + Handle = handle; + } + + public void SetHandle(int handle) + { + if ((Flags & TextureFlags.Bindless) != 0) + { + Flags &= ~TextureFlags.Bindless; + + RemoveSource(0); + } Handle = handle; } |
