aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-05-24 04:38:38 -0300
committerGitHub <noreply@github.com>2021-05-24 17:38:38 +1000
commit3fd6b55f04df0a5751985be1440809bc591e02d1 (patch)
tree27863cd93c7a490070c9dad59aa2f93f65e20924
parent79092310fa5510f3b8e9f1e0183de6dea9dad98a (diff)
Fix value of constant vertex attributes (#2307)
-rw-r--r--Ryujinx.Graphics.OpenGL/VertexArray.cs3
-rw-r--r--Ryujinx.Graphics.Shader/Translation/Translator.cs19
2 files changed, 12 insertions, 10 deletions
diff --git a/Ryujinx.Graphics.OpenGL/VertexArray.cs b/Ryujinx.Graphics.OpenGL/VertexArray.cs
index 17703cd1..b31bf723 100644
--- a/Ryujinx.Graphics.OpenGL/VertexArray.cs
+++ b/Ryujinx.Graphics.OpenGL/VertexArray.cs
@@ -80,7 +80,7 @@ namespace Ryujinx.Graphics.OpenGL
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).
+ // We currently set the constant to (0, 0, 0, 0).
DisableVertexAttrib(index);
}
else
@@ -176,6 +176,7 @@ namespace Ryujinx.Graphics.OpenGL
{
_vertexAttribsInUse &= ~mask;
GL.DisableVertexAttribArray(index);
+ GL.VertexAttrib4(index, 0f, 0f, 0f, 0f);
}
}
diff --git a/Ryujinx.Graphics.Shader/Translation/Translator.cs b/Ryujinx.Graphics.Shader/Translation/Translator.cs
index 74c6a653..b250d3de 100644
--- a/Ryujinx.Graphics.Shader/Translation/Translator.cs
+++ b/Ryujinx.Graphics.Shader/Translation/Translator.cs
@@ -129,19 +129,20 @@ namespace Ryujinx.Graphics.Shader.Translation
{
config.SetUsedFeature(FeatureFlags.Bindless);
}
- else // Not bindless, fill up texture handles
+
+ for (int funcIndex = 0; funcIndex < cfg.Length; funcIndex++)
{
- for (int funcIndex = 0; funcIndex < cfg.Length; funcIndex++)
+ for (int blkIndex = 0; blkIndex < cfg[funcIndex].Length; blkIndex++)
{
- for (int blkIndex = 0; blkIndex < cfg[funcIndex].Length; blkIndex++)
- {
- Block block = cfg[funcIndex][blkIndex];
+ Block block = cfg[funcIndex][blkIndex];
- if (maxEndAddress < block.EndAddress)
- {
- maxEndAddress = block.EndAddress;
- }
+ if (maxEndAddress < block.EndAddress)
+ {
+ maxEndAddress = block.EndAddress;
+ }
+ if (!hasBindless)
+ {
for (int index = 0; index < block.OpCodes.Count; index++)
{
if (block.OpCodes[index] is OpCodeTextureBase texture)