Make sure attributes used on subsequent shader stages are initialized (#2538)
This commit is contained in:
parent
10d649e6d3
commit
ed754af8d5
15 changed files with 347 additions and 262 deletions
|
@ -41,6 +41,10 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
private readonly TranslationCounts _counts;
|
||||
|
||||
public int UsedInputAttributes { get; private set; }
|
||||
public int UsedOutputAttributes { get; private set; }
|
||||
public int PassthroughAttributes { get; private set; }
|
||||
|
||||
private int _usedConstantBuffers;
|
||||
private int _usedStorageBuffers;
|
||||
private int _usedStorageBuffersWrite;
|
||||
|
@ -170,6 +174,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
TextureHandlesForCache.UnionWith(other.TextureHandlesForCache);
|
||||
|
||||
UsedInputAttributes |= other.UsedInputAttributes;
|
||||
UsedOutputAttributes |= other.UsedOutputAttributes;
|
||||
_usedConstantBuffers |= other._usedConstantBuffers;
|
||||
_usedStorageBuffers |= other._usedStorageBuffers;
|
||||
_usedStorageBuffersWrite |= other._usedStorageBuffersWrite;
|
||||
|
@ -191,6 +197,28 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
}
|
||||
}
|
||||
|
||||
public void SetInputUserAttribute(int index)
|
||||
{
|
||||
UsedInputAttributes |= 1 << index;
|
||||
}
|
||||
|
||||
public void SetOutputUserAttribute(int index)
|
||||
{
|
||||
UsedOutputAttributes |= 1 << index;
|
||||
}
|
||||
|
||||
public void MergeOutputUserAttributes(int mask)
|
||||
{
|
||||
if (GpPassthrough)
|
||||
{
|
||||
PassthroughAttributes = mask & ~UsedOutputAttributes;
|
||||
}
|
||||
else
|
||||
{
|
||||
UsedOutputAttributes |= mask;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetClipDistanceWritten(int index)
|
||||
{
|
||||
ClipDistancesWritten |= (byte)(1 << index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue