Ryujinx/Ryujinx.Graphics/Gal/Shader/ShaderBinding.cs
ReinUsesLisp cc298c676a SPIR-V Intermediate Shading Language support
* Enable from Ryujinx.conf

* Adapt to use OpenTK.NetStandard

* Implement usage of UBOs for GLSL and SPIR-V

* Fix a NVidia related issue

* Use constant from UniformBinding
2018-06-23 14:48:53 -03:00

28 lines
No EOL
803 B
C#

using System;
namespace Ryujinx.Graphics.Gal.Shader
{
static class UniformBinding
{
public const int BuffersPerStage = 12; //ARB_uniform_buffer
public static int Get(GalShaderType Stage, int Cbuf)
{
return GetStageIndex(Stage) * BuffersPerStage + Cbuf;
}
private static int GetStageIndex(GalShaderType Stage)
{
switch (Stage)
{
case GalShaderType.Vertex: return 0;
case GalShaderType.Fragment: return 1;
case GalShaderType.Geometry: return 2;
case GalShaderType.TessControl: return 3;
case GalShaderType.TessEvaluation: return 4;
}
throw new ArgumentException();
}
}
}