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:
parent
312be74861
commit
fd7567a6b5
11 changed files with 85 additions and 16 deletions
|
@ -244,11 +244,18 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
/// </summary>
|
||||
/// <param name="memoryManager">GPU memory manager where the texture is mapped</param>
|
||||
/// <param name="colorState">Color buffer texture to find or create</param>
|
||||
/// <param name="layered">Indicates if the texture might be accessed with a non-zero layer index</param>
|
||||
/// <param name="samplesInX">Number of samples in the X direction, for MSAA</param>
|
||||
/// <param name="samplesInY">Number of samples in the Y direction, for MSAA</param>
|
||||
/// <param name="sizeHint">A hint indicating the minimum used size for the texture</param>
|
||||
/// <returns>The texture</returns>
|
||||
public Texture FindOrCreateTexture(MemoryManager memoryManager, RtColorState colorState, int samplesInX, int samplesInY, Size sizeHint)
|
||||
public Texture FindOrCreateTexture(
|
||||
MemoryManager memoryManager,
|
||||
RtColorState colorState,
|
||||
bool layered,
|
||||
int samplesInX,
|
||||
int samplesInY,
|
||||
Size sizeHint)
|
||||
{
|
||||
bool isLinear = colorState.MemoryLayout.UnpackIsLinear();
|
||||
|
||||
|
@ -263,13 +270,13 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
}
|
||||
else if ((samplesInX | samplesInY) != 1)
|
||||
{
|
||||
target = colorState.Depth > 1
|
||||
target = colorState.Depth > 1 && layered
|
||||
? Target.Texture2DMultisampleArray
|
||||
: Target.Texture2DMultisample;
|
||||
}
|
||||
else
|
||||
{
|
||||
target = colorState.Depth > 1
|
||||
target = colorState.Depth > 1 && layered
|
||||
? Target.Texture2DArray
|
||||
: Target.Texture2D;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue