Use ResScaleUnsupported flag for texture arrays

This commit is contained in:
Gabriel A 2024-04-08 12:29:58 -03:00
parent c1b0ab805a
commit d136f59322

View file

@ -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);