|
@@ -197,6 +197,27 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
return changesScale || (hasValue && color.ScaleMode != TextureScaleMode.Blacklisted && color.ScaleFactor != GraphicsConfig.ResScale);
|
|
return changesScale || (hasValue && color.ScaleMode != TextureScaleMode.Blacklisted && color.ScaleFactor != GraphicsConfig.ResScale);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Sets the render target depth-stencil buffer.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="depthStencil">The depth-stencil buffer texture</param>
|
|
|
|
|
+ /// <returns>True if render target scale must be updated.</returns>
|
|
|
|
|
+ public bool SetRenderTargetDepthStencil(Texture depthStencil)
|
|
|
|
|
+ {
|
|
|
|
|
+ bool hasValue = depthStencil != null;
|
|
|
|
|
+ bool changesScale = (hasValue != (_rtDepthStencil != null)) || (hasValue && RenderTargetScale != depthStencil.ScaleFactor);
|
|
|
|
|
+
|
|
|
|
|
+ if (_rtDepthStencil != depthStencil)
|
|
|
|
|
+ {
|
|
|
|
|
+ _rtDepthStencil?.SignalModifying(false);
|
|
|
|
|
+ depthStencil?.SignalModifying(true);
|
|
|
|
|
+
|
|
|
|
|
+ _rtDepthStencil = depthStencil;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return changesScale || (hasValue && depthStencil.ScaleMode != TextureScaleMode.Blacklisted && depthStencil.ScaleFactor != GraphicsConfig.ResScale);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Gets the first available bound colour target, or the depth stencil target if not present.
|
|
/// Gets the first available bound colour target, or the depth stencil target if not present.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -290,27 +311,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
RenderTargetScale = targetScale;
|
|
RenderTargetScale = targetScale;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Sets the render target depth-stencil buffer.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <param name="depthStencil">The depth-stencil buffer texture</param>
|
|
|
|
|
- /// <returns>True if render target scale must be updated.</returns>
|
|
|
|
|
- public bool SetRenderTargetDepthStencil(Texture depthStencil)
|
|
|
|
|
- {
|
|
|
|
|
- bool hasValue = depthStencil != null;
|
|
|
|
|
- bool changesScale = (hasValue != (_rtDepthStencil != null)) || (hasValue && RenderTargetScale != depthStencil.ScaleFactor);
|
|
|
|
|
-
|
|
|
|
|
- if (_rtDepthStencil != depthStencil)
|
|
|
|
|
- {
|
|
|
|
|
- _rtDepthStencil?.SignalModifying(false);
|
|
|
|
|
- depthStencil?.SignalModifying(true);
|
|
|
|
|
-
|
|
|
|
|
- _rtDepthStencil = depthStencil;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return changesScale || (hasValue && depthStencil.ScaleMode != TextureScaleMode.Blacklisted && depthStencil.ScaleFactor != GraphicsConfig.ResScale);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Commits bindings on the compute pipeline.
|
|
/// Commits bindings on the compute pipeline.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -716,7 +716,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
// If they don't, it may still be mapped to the same physical region, so we
|
|
// If they don't, it may still be mapped to the same physical region, so we
|
|
|
// do a more expensive check to tell if they are mapped into the same physical regions.
|
|
// do a more expensive check to tell if they are mapped into the same physical regions.
|
|
|
// If the GPU VA for the texture has ever been unmapped, then the range must be checked regardless.
|
|
// If the GPU VA for the texture has ever been unmapped, then the range must be checked regardless.
|
|
|
- if ((overlap.Info.GpuAddress != info.GpuAddress || overlap.ChangedMapping) &&
|
|
|
|
|
|
|
+ if ((overlap.Info.GpuAddress != info.GpuAddress || overlap.ChangedMapping) &&
|
|
|
!_context.MemoryManager.CompareRange(overlap.Range, info.GpuAddress))
|
|
!_context.MemoryManager.CompareRange(overlap.Range, info.GpuAddress))
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
@@ -775,7 +775,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
Array.Resize(ref _overlapInfo, _textureOverlaps.Length);
|
|
Array.Resize(ref _overlapInfo, _textureOverlaps.Length);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // =============== Find Texture View of Existing Texture ===============
|
|
|
|
|
|
|
+ // =============== Find Texture View of Existing Texture ===============
|
|
|
|
|
|
|
|
int fullyCompatible = 0;
|
|
int fullyCompatible = 0;
|
|
|
|
|
|
|
@@ -841,7 +841,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
if (texture != null)
|
|
if (texture != null)
|
|
|
{
|
|
{
|
|
|
// This texture could be a view of multiple parent textures with different storages, even if it is a view.
|
|
// This texture could be a view of multiple parent textures with different storages, even if it is a view.
|
|
|
- // When a texture is created, make sure all possible dependencies to other textures are created as copies.
|
|
|
|
|
|
|
+ // When a texture is created, make sure all possible dependencies to other textures are created as copies.
|
|
|
// (even if it could be fulfilled without a copy)
|
|
// (even if it could be fulfilled without a copy)
|
|
|
|
|
|
|
|
for (int index = 0; index < overlapsCount; index++)
|
|
for (int index = 0; index < overlapsCount; index++)
|
|
@@ -859,7 +859,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
texture.SynchronizeMemory();
|
|
texture.SynchronizeMemory();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // =============== Create a New Texture ===============
|
|
|
|
|
|
|
+ // =============== Create a New Texture ===============
|
|
|
|
|
|
|
|
// No match, create a new texture.
|
|
// No match, create a new texture.
|
|
|
if (texture == null)
|
|
if (texture == null)
|
|
@@ -993,7 +993,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
overlap.ReplaceView(texture, overlapInfo, newView, oInfo.FirstLayer, oInfo.FirstLevel);
|
|
overlap.ReplaceView(texture, overlapInfo, newView, oInfo.FirstLayer, oInfo.FirstLevel);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
texture.SynchronizeMemory();
|
|
texture.SynchronizeMemory();
|
|
|
}
|
|
}
|
|
|
|
|
|