0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics.Shader/SupportBuffer.cs
gdkchan 0f6ec446ea
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
2021-08-11 21:33:43 +02:00

18 lines
No EOL
850 B
C#

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;
}
}