From f0b00c1ae92a2e8fdff9c532e7f2f79ad708b184 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 2 Sep 2021 04:17:43 +0100 Subject: Fix TXQ for 3D textures. (#2613) * Fix TXQ for 3D textures. Assumes the texture is 3D if the component mask contains Z. This fixes a bug in UE4 games where parts of the map had garbage pointers to lighting voxels, as the lookup 3D texture was not being initialized. Most notable game is THPS1+2. May need another PR to keep image store data alive and properly flush it in order using the AutoDeleteCache. * Get sampler type for TextureSize from bound textures. --- .../Shader/TextureDescriptorCapableGpuAccessor.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs') diff --git a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs index 54b4133a..7c4eea02 100644 --- a/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs +++ b/Ryujinx.Graphics.Gpu/Shader/TextureDescriptorCapableGpuAccessor.cs @@ -119,14 +119,14 @@ namespace Ryujinx.Graphics.Gpu.Shader } /// - /// Queries texture target information. + /// Queries sampler type information. /// /// Texture handle /// Constant buffer slot for the texture handle - /// True if the texture is a buffer texture, false otherwise - public bool QueryIsTextureBuffer(int handle, int cbufSlot = -1) + /// The sampler type value for the given handle + public SamplerType QuerySamplerType(int handle, int cbufSlot = -1) { - return GetTextureDescriptor(handle, cbufSlot).UnpackTextureTarget() == TextureTarget.TextureBuffer; + return GetTextureDescriptor(handle, cbufSlot).UnpackTextureTarget().ConvertSamplerType(); } /// -- cgit v1.2.3