aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-04-09 14:24:46 -0300
committerGitHub <noreply@github.com>2024-04-09 14:24:46 -0300
commit338ff79e1e962250110047be781e069b4dccba01 (patch)
tree770f661513ccb46781048b21665b9954fc34db28
parent80201466ae097fafb1b2a4b32dde98ce3ed3932c (diff)
Use ResScaleUnsupported flag for texture arrays (#6626)1.1.1271
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
index 70ea1f6b..4645317c 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
@@ -224,7 +224,8 @@ namespace Ryujinx.Graphics.Gpu.Image
/// Synchronizes memory for all textures in the array.
/// </summary>
/// <param name="isStore">Indicates if the texture may be modified by the access</param>
- public void SynchronizeMemory(bool isStore)
+ /// <param name="blacklistScale">Indicates if the texture should be blacklisted for scaling</param>
+ public void SynchronizeMemory(bool isStore, bool blacklistScale)
{
foreach (Texture texture in Textures.Keys)
{
@@ -234,6 +235,13 @@ namespace Ryujinx.Graphics.Gpu.Image
{
texture.SignalModified();
}
+
+ if (blacklistScale && texture.ScaleMode != TextureScaleMode.Blacklisted)
+ {
+ // Scaling textures used on arrays is currently not supported.
+
+ texture.BlacklistScale();
+ }
}
}
@@ -467,6 +475,7 @@ namespace Ryujinx.Graphics.Gpu.Image
bool poolsModified = entry.PoolsModified();
bool isStore = bindingInfo.Flags.HasFlag(TextureUsageFlags.ImageStore);
+ bool resScaleUnsupported = bindingInfo.Flags.HasFlag(TextureUsageFlags.ResScaleUnsupported);
ReadOnlySpan<int> cachedTextureBuffer;
ReadOnlySpan<int> cachedSamplerBuffer;
@@ -475,7 +484,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{
if (entry.MatchesSequenceNumber(_context.SequenceNumber))
{
- entry.SynchronizeMemory(isStore);
+ entry.SynchronizeMemory(isStore, resScaleUnsupported);
if (isImage)
{
@@ -504,7 +513,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (entry.MatchesBufferData(cachedTextureBuffer, cachedSamplerBuffer, separateSamplerBuffer, samplerWordOffset))
{
- entry.SynchronizeMemory(isStore);
+ entry.SynchronizeMemory(isStore, resScaleUnsupported);
if (isImage)
{
@@ -569,6 +578,13 @@ namespace Ryujinx.Graphics.Gpu.Image
{
texture.SignalModified();
}
+
+ if (resScaleUnsupported && texture.ScaleMode != TextureScaleMode.Blacklisted)
+ {
+ // Scaling textures used on arrays is currently not supported.
+
+ texture.BlacklistScale();
+ }
}
Sampler sampler = samplerPool?.Get(samplerId);