Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
24068b023c | ||
|
1217a8e69b | ||
|
732db7581f |
@@ -343,11 +343,22 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||
|
||||
bool unalignedChanged = _currentSpecState.SetHasUnalignedStorageBuffer(_channel.BufferManager.HasUnalignedStorageBuffers);
|
||||
|
||||
if (!_channel.TextureManager.CommitGraphicsBindings(_shaderSpecState) || unalignedChanged)
|
||||
bool scaleMismatch;
|
||||
do
|
||||
{
|
||||
// Shader must be reloaded. _vtgWritesRtLayer should not change.
|
||||
UpdateShaderState();
|
||||
if (!_channel.TextureManager.CommitGraphicsBindings(_shaderSpecState, out scaleMismatch) || unalignedChanged)
|
||||
{
|
||||
// Shader must be reloaded. _vtgWritesRtLayer should not change.
|
||||
UpdateShaderState();
|
||||
}
|
||||
|
||||
if (scaleMismatch)
|
||||
{
|
||||
// Binding textures changed scale of the bound render targets, correct the render target scale and rebind.
|
||||
UpdateRenderTargetState();
|
||||
}
|
||||
}
|
||||
while (scaleMismatch);
|
||||
|
||||
_channel.BufferManager.CommitGraphicsBindings(_drawState.DrawIndexed);
|
||||
}
|
||||
|
@@ -360,15 +360,16 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// Commits bindings on the graphics pipeline.
|
||||
/// </summary>
|
||||
/// <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>
|
||||
public bool CommitGraphicsBindings(ShaderSpecializationState specState)
|
||||
public bool CommitGraphicsBindings(ShaderSpecializationState specState, out bool scaleMismatch)
|
||||
{
|
||||
_texturePoolCache.Tick();
|
||||
_samplerPoolCache.Tick();
|
||||
|
||||
bool result = _gpBindingsManager.CommitBindings(specState);
|
||||
|
||||
UpdateRenderTargets();
|
||||
scaleMismatch = UpdateRenderTargets();
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -426,9 +427,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// <summary>
|
||||
/// Update host framebuffer attachments based on currently bound render target buffers.
|
||||
/// </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;
|
||||
float expectedScale = RenderTargetScale;
|
||||
bool scaleMismatch = false;
|
||||
|
||||
Texture dsTexture = _rtDepthStencil;
|
||||
ITexture hostDsTexture = null;
|
||||
@@ -448,6 +452,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
_rtHostDs = hostDsTexture;
|
||||
anyChanged = true;
|
||||
|
||||
if (dsTexture != null && dsTexture.ScaleFactor != expectedScale)
|
||||
{
|
||||
scaleMismatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int index = 0; index < _rtColors.Length; index++)
|
||||
@@ -470,6 +479,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
_rtHostColors[index] = hostTexture;
|
||||
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);
|
||||
}
|
||||
|
||||
return scaleMismatch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -781,7 +781,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
PrimitiveTopology.Quads => PrimitiveTopology.Triangles,
|
||||
PrimitiveTopology.QuadStrip => PrimitiveTopology.TriangleStrip,
|
||||
PrimitiveTopology.TriangleFan => Capabilities.PortabilitySubset.HasFlag(PortabilitySubsetFlags.NoTriangleFans) ? PrimitiveTopology.Triangles : topology,
|
||||
PrimitiveTopology.TriangleFan or PrimitiveTopology.Polygon => Capabilities.PortabilitySubset.HasFlag(PortabilitySubsetFlags.NoTriangleFans)
|
||||
? PrimitiveTopology.Triangles
|
||||
: topology,
|
||||
_ => topology,
|
||||
};
|
||||
}
|
||||
@@ -791,7 +793,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
return topology switch
|
||||
{
|
||||
PrimitiveTopology.Quads => true,
|
||||
PrimitiveTopology.TriangleFan => Capabilities.PortabilitySubset.HasFlag(PortabilitySubsetFlags.NoTriangleFans),
|
||||
PrimitiveTopology.TriangleFan or PrimitiveTopology.Polygon => Capabilities.PortabilitySubset.HasFlag(PortabilitySubsetFlags.NoTriangleFans),
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ namespace Ryujinx.UI.Common
|
||||
public static class DiscordIntegrationModule
|
||||
{
|
||||
private const string Description = "A simple, experimental Nintendo Switch emulator.";
|
||||
private const string CliendId = "568815339807309834";
|
||||
private const string ApplicationId = "1216775165866807456";
|
||||
|
||||
private static DiscordRpcClient _discordClient;
|
||||
private static RichPresence _discordPresenceMain;
|
||||
@@ -24,14 +24,14 @@ namespace Ryujinx.UI.Common
|
||||
Details = "Main Menu",
|
||||
State = "Idling",
|
||||
Timestamps = Timestamps.Now,
|
||||
Buttons = new[]
|
||||
{
|
||||
Buttons =
|
||||
[
|
||||
new Button
|
||||
{
|
||||
Label = "Website",
|
||||
Url = "https://ryujinx.org/",
|
||||
Url = "https://ryujinx.org/",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
ConfigurationState.Instance.EnableDiscordIntegration.Event += Update;
|
||||
@@ -52,7 +52,7 @@ namespace Ryujinx.UI.Common
|
||||
// If we need to activate it and the client isn't active, initialize it
|
||||
if (evnt.NewValue && _discordClient == null)
|
||||
{
|
||||
_discordClient = new DiscordRpcClient(CliendId);
|
||||
_discordClient = new DiscordRpcClient(ApplicationId);
|
||||
|
||||
_discordClient.Initialize();
|
||||
_discordClient.SetPresence(_discordPresenceMain);
|
||||
@@ -74,14 +74,14 @@ namespace Ryujinx.UI.Common
|
||||
Details = $"Playing {titleName}",
|
||||
State = (titleId == "0000000000000000") ? "Homebrew" : titleId.ToUpper(),
|
||||
Timestamps = Timestamps.Now,
|
||||
Buttons = new[]
|
||||
{
|
||||
Buttons =
|
||||
[
|
||||
new Button
|
||||
{
|
||||
Label = "Website",
|
||||
Url = "https://ryujinx.org/",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user