Only make render target 2D textures layered if needed (#2646)
* Only make render target 2D textures layered if needed * Shader cache version bump * Ensure topology is updated on channel swap
This commit is contained in:
@@ -11,6 +11,7 @@ namespace Ryujinx.Graphics.Shader
|
||||
public ReadOnlyCollection<TextureDescriptor> Images { get; }
|
||||
|
||||
public bool UsesInstanceId { get; }
|
||||
public bool UsesRtLayer { get; }
|
||||
public byte ClipDistancesWritten { get; }
|
||||
|
||||
public ShaderProgramInfo(
|
||||
@@ -19,6 +20,7 @@ namespace Ryujinx.Graphics.Shader
|
||||
TextureDescriptor[] textures,
|
||||
TextureDescriptor[] images,
|
||||
bool usesInstanceId,
|
||||
bool usesRtLayer,
|
||||
byte clipDistancesWritten)
|
||||
{
|
||||
CBuffers = Array.AsReadOnly(cBuffers);
|
||||
@@ -27,6 +29,7 @@ namespace Ryujinx.Graphics.Shader
|
||||
Images = Array.AsReadOnly(images);
|
||||
|
||||
UsesInstanceId = usesInstanceId;
|
||||
UsesRtLayer = usesRtLayer;
|
||||
ClipDistancesWritten = clipDistancesWritten;
|
||||
}
|
||||
}
|
||||
|
@@ -121,6 +121,11 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.Stage != ShaderStage.Fragment && attribute == AttributeConsts.Layer)
|
||||
{
|
||||
Config.SetUsedFeature(FeatureFlags.RtLayer);
|
||||
}
|
||||
}
|
||||
|
||||
public void MarkLabel(Operand label)
|
||||
|
@@ -17,8 +17,9 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
|
||||
Bindless = 1 << 2,
|
||||
InstanceId = 1 << 3,
|
||||
CbIndexing = 1 << 4,
|
||||
IaIndexing = 1 << 5,
|
||||
OaIndexing = 1 << 6
|
||||
RtLayer = 1 << 4,
|
||||
CbIndexing = 1 << 5,
|
||||
IaIndexing = 1 << 6,
|
||||
OaIndexing = 1 << 7
|
||||
}
|
||||
}
|
||||
|
@@ -106,6 +106,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
config.GetTextureDescriptors(),
|
||||
config.GetImageDescriptors(),
|
||||
config.UsedFeatures.HasFlag(FeatureFlags.InstanceId),
|
||||
config.UsedFeatures.HasFlag(FeatureFlags.RtLayer),
|
||||
config.ClipDistancesWritten);
|
||||
|
||||
return program;
|
||||
|
Reference in New Issue
Block a user