From e9eb3c4753e4f56b03d16d8d6f71d49f1e7b97db Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Mon, 6 Nov 2017 10:37:05 +0000 Subject: spirv: Use correct type for sampled images We should use the result type of the OpSampledImage opcode, rather than the type of the underlying image/samplers. This resolves an issue when using separate images and shadow samplers with glslang. Example: layout (...) uniform samplerShadow s0; layout (...) uniform texture2D res0; ... float result = textureLod(sampler2DShadow(res0, s0), uv, 0); For this, for the combined OpSampledImage, the type of the base image was being used (which does not have the Depth flag set, whereas the result type does), therefore it was not being recognised as a shadow sampler. This led to the wrong LLVM intrinsics being emitted by RADV. Signed-off-by: Alex Smith Cc: "17.2 17.3" Reviewed-by: Jason Ekstrand --- src/compiler/spirv/vtn_private.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compiler/spirv/vtn_private.h') diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 84584620fc1..6b4645acc8b 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -411,6 +411,7 @@ struct vtn_image_pointer { }; struct vtn_sampled_image { + struct vtn_type *type; struct vtn_pointer *image; /* Image or array of images */ struct vtn_pointer *sampler; /* Sampler */ }; -- cgit v1.2.3