Mesa (master): spirv/nir: Add support for shadow samplers that return vec4

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Jul 22 23:20:51 UTC 2016


Module: Mesa
Branch: master
Commit: 7c7acf53b2ddd41d307699ebd8bf108c4478ce07
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c7acf53b2ddd41d307699ebd8bf108c4478ce07

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jul 20 19:55:51 2016 -0700

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 at jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "12.0" <mesa-dev at lists.freedesktop.org>

---

 src/compiler/spirv/spirv_to_nir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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) {




More information about the mesa-commit mailing list