aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TexturePool.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-09-29 17:28:50 -0300
committerGitHub <noreply@github.com>2020-09-29 22:28:50 +0200
commit1560f236da032b36110672eeceb0b3ca62b68e2d (patch)
treebdd0050e4dbc01d4b61ac09947fb25b846a3929b /Ryujinx.Graphics.Gpu/Image/TexturePool.cs
parenta15459366e7cd76ddb33eb882fd117f5aa79493d (diff)
Convert 1D texture targets to 2D (#1584)
* Convert 1D texture targets to 2D * Fix typo * Simplify some code * Should mask that too * Consistency
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePool.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TexturePool.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs
index 4fd51988..59f2e901 100644
--- a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs
@@ -144,6 +144,22 @@ namespace Ryujinx.Graphics.Gpu.Image
Target target = descriptor.UnpackTextureTarget().Convert((samplesInX | samplesInY) != 1);
+ // We use 2D targets for 1D textures as that makes texture cache
+ // management easier. We don't know the target for render target
+ // and copies, so those would normally use 2D targets, which are
+ // not compatible with 1D targets. By doing that we also allow those
+ // to match when looking for compatible textures on the cache.
+ if (target == Target.Texture1D)
+ {
+ target = Target.Texture2D;
+ height = 1;
+ }
+ else if (target == Target.Texture1DArray)
+ {
+ target = Target.Texture2DArray;
+ height = 1;
+ }
+
uint format = descriptor.UnpackFormat();
bool srgb = descriptor.UnpackSrgb();