summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-07-20 19:55:51 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-07-22 16:27:35 -0700
commit7c7acf53b2ddd41d307699ebd8bf108c4478ce07 (patch)
treeaa6bc9ff520aeba43608a55f13814eab1bb2502a /src/compiler
parent2ddefd03b748024735c106b97b9acbdab6c93766 (diff)
downloadexternal_mesa3d-7c7acf53b2ddd41d307699ebd8bf108c4478ce07.zip
external_mesa3d-7c7acf53b2ddd41d307699ebd8bf108c4478ce07.tar.gz
external_mesa3d-7c7acf53b2ddd41d307699ebd8bf108c4478ce07.tar.bz2
spirv/nir: Add support for shadow samplers that return vec4
While SPIR-V technically doesn't support "old style" shadow, the shadow-compare gather instruction does return a vec4 so we need to be able to set the old_style_shadow bit in NIR. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-dev@lists.freedesktop.org>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 22cd2e7..c32dfaa 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1479,7 +1479,8 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
instr->sampler_dim = glsl_get_sampler_dim(image_type);
instr->is_array = glsl_sampler_type_is_array(image_type);
instr->is_shadow = glsl_sampler_type_is_shadow(image_type);
- instr->is_new_style_shadow = instr->is_shadow;
+ instr->is_new_style_shadow = instr->is_shadow &&
+ glsl_get_components(ret_type->type) == 1;
if (has_coord) {
switch (instr->sampler_dim) {