From 0f6c8f9cd9a3bd96d3fb0d82491ac4cb0029dedb Mon Sep 17 00:00:00 2001 From: riperiperi Date: Mon, 13 Jun 2022 01:57:44 +0100 Subject: [PATCH] Minor changes, remove debug log --- Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs | 3 ++- Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 2 +- Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs | 9 ++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs b/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs index f0de882b0..d62d4c26c 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs @@ -237,7 +237,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute _channel.TextureManager.SetComputeMaxBindings(maxTextureBinding, maxImageBinding); - _channel.TextureManager.CommitComputeBindings(cs.SpecializationState); // Should be up to date, since the shader was fetched above. + // Should never return false for mismatching spec state, since the shader was fetched above. + _channel.TextureManager.CommitComputeBindings(cs.SpecializationState); _channel.BufferManager.CommitComputeBindings(); diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index 9f5258e24..1f69f9bee 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -277,7 +277,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed if (!_channel.TextureManager.CommitGraphicsBindings(_shaderSpecState)) { - Logger.Error?.Print(LogClass.Gpu, "Oh my"); + // Shader must be reloaded. UpdateShaderState(); } diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs index 2adb6d44d..9e847ac90 100644 --- a/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs +++ b/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs @@ -469,7 +469,6 @@ namespace Ryujinx.Graphics.Gpu.Shader /// /// GPU channel /// Indicates whenever the check is requested by the 3D or compute engine - /// Stage index of the constant buffer /// The currently cached texture buffer index /// The currently cached sampler buffer index /// The currently cached texture buffer data @@ -477,6 +476,7 @@ namespace Ryujinx.Graphics.Gpu.Shader /// The currently cached stage /// The new texture buffer index /// The new sampler buffer index + /// Stage index of the constant buffer [MethodImpl(MethodImplOptions.AggressiveInlining)] private void UpdateCachedBuffer( GpuChannel channel, @@ -578,10 +578,7 @@ namespace Ryujinx.Graphics.Gpu.Shader ref readonly Image.TextureDescriptor descriptor = ref pool.GetDescriptorRef(textureId); - Box specializationState = kv.Value; - - if (specializationState.Value.QueriedFlags.HasFlag(QueriedTextureStateFlags.CoordNormalized) && - specializationState.Value.CoordNormalized != descriptor.UnpackTextureCoordNormalized()) + if (!MatchesTexture(kv.Value, descriptor)) { return false; } @@ -597,6 +594,8 @@ namespace Ryujinx.Graphics.Gpu.Shader /// Texture specialization state /// Texture descriptor /// True if the state matches, false otherwise + + [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool MatchesTexture(Box specializationState, in Image.TextureDescriptor descriptor) { if (specializationState != null)