Bindless elimination for constant sampler handle (#3424)

* Bindless elimination for constant sampler handle

* Shader cache version bump

* Update TextureHandle.ReadPackedId for new bindless elimination
This commit is contained in:
gdkchan 2022-07-02 15:03:35 -03:00 committed by GitHub
parent 0c66d71fe8
commit 5afd521c5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 25 deletions

View file

@ -7,7 +7,8 @@ namespace Ryujinx.Graphics.Shader
{
CombinedSampler = 0, // Must be 0.
SeparateSamplerHandle = 1,
SeparateSamplerId = 2
SeparateSamplerId = 2,
SeparateConstantSamplerHandle = 3
}
public static class TextureHandle
@ -97,9 +98,19 @@ namespace Ryujinx.Graphics.Shader
// turn that into a regular texture access and produce those special handles with values on the higher 16 bits.
if (handleType != TextureHandleType.CombinedSampler)
{
int samplerHandle = cachedSamplerBuffer[samplerWordOffset];
int samplerHandle;
if (handleType == TextureHandleType.SeparateSamplerId)
if (handleType != TextureHandleType.SeparateConstantSamplerHandle)
{
samplerHandle = cachedSamplerBuffer[samplerWordOffset];
}
else
{
samplerHandle = samplerWordOffset;
}
if (handleType == TextureHandleType.SeparateSamplerId ||
handleType == TextureHandleType.SeparateConstantSamplerHandle)
{
samplerHandle <<= 20;
}