|
@@ -360,15 +360,16 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
/// Commits bindings on the graphics pipeline.
|
|
/// Commits bindings on the graphics pipeline.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="specState">Specialization state for the bound shader</param>
|
|
/// <param name="specState">Specialization state for the bound shader</param>
|
|
|
|
|
+ /// <param name="scaleMismatch">True if there is a scale mismatch in the render targets, indicating they must be re-evaluated</param>
|
|
|
/// <returns>True if all bound textures match the current shader specialization state, false otherwise</returns>
|
|
/// <returns>True if all bound textures match the current shader specialization state, false otherwise</returns>
|
|
|
- public bool CommitGraphicsBindings(ShaderSpecializationState specState)
|
|
|
|
|
|
|
+ public bool CommitGraphicsBindings(ShaderSpecializationState specState, out bool scaleMismatch)
|
|
|
{
|
|
{
|
|
|
_texturePoolCache.Tick();
|
|
_texturePoolCache.Tick();
|
|
|
_samplerPoolCache.Tick();
|
|
_samplerPoolCache.Tick();
|
|
|
|
|
|
|
|
bool result = _gpBindingsManager.CommitBindings(specState);
|
|
bool result = _gpBindingsManager.CommitBindings(specState);
|
|
|
|
|
|
|
|
- UpdateRenderTargets();
|
|
|
|
|
|
|
+ scaleMismatch = UpdateRenderTargets();
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -426,9 +427,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Update host framebuffer attachments based on currently bound render target buffers.
|
|
/// Update host framebuffer attachments based on currently bound render target buffers.
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
- public void UpdateRenderTargets()
|
|
|
|
|
|
|
+ /// <returns>True if there is a scale mismatch in the render targets, indicating they must be re-evaluated</returns>
|
|
|
|
|
+ public bool UpdateRenderTargets()
|
|
|
{
|
|
{
|
|
|
bool anyChanged = false;
|
|
bool anyChanged = false;
|
|
|
|
|
+ float expectedScale = RenderTargetScale;
|
|
|
|
|
+ bool scaleMismatch = false;
|
|
|
|
|
|
|
|
Texture dsTexture = _rtDepthStencil;
|
|
Texture dsTexture = _rtDepthStencil;
|
|
|
ITexture hostDsTexture = null;
|
|
ITexture hostDsTexture = null;
|
|
@@ -448,6 +452,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
{
|
|
{
|
|
|
_rtHostDs = hostDsTexture;
|
|
_rtHostDs = hostDsTexture;
|
|
|
anyChanged = true;
|
|
anyChanged = true;
|
|
|
|
|
+
|
|
|
|
|
+ if (dsTexture != null && dsTexture.ScaleFactor != expectedScale)
|
|
|
|
|
+ {
|
|
|
|
|
+ scaleMismatch = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (int index = 0; index < _rtColors.Length; index++)
|
|
for (int index = 0; index < _rtColors.Length; index++)
|
|
@@ -470,6 +479,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
{
|
|
{
|
|
|
_rtHostColors[index] = hostTexture;
|
|
_rtHostColors[index] = hostTexture;
|
|
|
anyChanged = true;
|
|
anyChanged = true;
|
|
|
|
|
+
|
|
|
|
|
+ if (texture != null && texture.ScaleFactor != expectedScale)
|
|
|
|
|
+ {
|
|
|
|
|
+ scaleMismatch = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -477,6 +491,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|
|
{
|
|
{
|
|
|
_context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, _rtHostDs);
|
|
_context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, _rtHostDs);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ return scaleMismatch;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|