Support constant attributes (with a value of zero) (#1066)
* Support constant attributes (with a value of zero) * Remove extra line
This commit is contained in:
parent
8f21db810d
commit
9948a7be53
4 changed files with 26 additions and 4 deletions
|
@ -58,8 +58,17 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
FormatInfo fmtInfo = FormatTable.GetFormatInfo(attrib.Format);
|
||||
|
||||
GL.EnableVertexAttribArray(attribIndex);
|
||||
|
||||
if (attrib.IsZero)
|
||||
{
|
||||
// Disabling the attribute causes the shader to read a constant value.
|
||||
// The value is configurable, but by default is a vector of (0, 0, 0, 1).
|
||||
GL.DisableVertexAttribArray(attribIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL.EnableVertexAttribArray(attribIndex);
|
||||
}
|
||||
|
||||
int offset = attrib.Offset;
|
||||
int size = fmtInfo.Components;
|
||||
|
||||
|
@ -117,7 +126,7 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
continue;
|
||||
}
|
||||
|
||||
if (_needsAttribsUpdate)
|
||||
if (_needsAttribsUpdate && !attrib.IsZero)
|
||||
{
|
||||
GL.EnableVertexAttribArray(attribIndex);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue