diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-08-11 16:33:43 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 21:33:43 +0200 |
| commit | 0f6ec446ea3be41b1c22aa5c3870bd7a6c595d1f (patch) | |
| tree | e441560dbdd560e9a020bb4b7606d3cd0698da02 /Ryujinx.Graphics.Shader/SupportBuffer.cs | |
| parent | b5b7e23fc41e7045f9e803d6926e98ec7d049f0c (diff) | |
Replace BGRA and scale uniforms with a uniform block (#2496)
* Replace BGRA and scale uniforms with a uniform block
* Setting the data again on program change is no longer needed
* Optimize and resolve some warnings
* Avoid redundant support buffer updates
* Some optimizations to BindBuffers (now inlined)
* Unify render scale arrays
Diffstat (limited to 'Ryujinx.Graphics.Shader/SupportBuffer.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/SupportBuffer.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/SupportBuffer.cs b/Ryujinx.Graphics.Shader/SupportBuffer.cs new file mode 100644 index 00000000..78f24401 --- /dev/null +++ b/Ryujinx.Graphics.Shader/SupportBuffer.cs @@ -0,0 +1,18 @@ +namespace Ryujinx.Graphics.Shader +{ + public static class SupportBuffer + { + public const int FieldSize = 16; // Each field takes 16 bytes on default layout, even bool. + + public const int FragmentAlphaTestOffset = 0; + public const int FragmentIsBgraOffset = FieldSize; + public const int FragmentIsBgraCount = 8; + public const int FragmentRenderScaleOffset = FragmentIsBgraOffset + FragmentIsBgraCount * FieldSize; + public const int ComputeRenderScaleOffset = FragmentRenderScaleOffset + FieldSize; // Skip first scale that is used for the render target + + // One for the render target, 32 for the textures, and 8 for the images. + private const int RenderScaleMaxCount = 1 + 32 + 8; + + public const int RequiredSize = FragmentRenderScaleOffset + RenderScaleMaxCount * FieldSize; + } +}
\ No newline at end of file |
