Mesa (master): spirv/nir: Handle texture projectors

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Jul 22 23:33:09 UTC 2016


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Thu Jul 21 12:01:46 2016 -0700

spirv/nir: Handle texture projectors

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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 6ebf951..27d2b42 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1442,6 +1442,21 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
       break;
    }
 
+   switch (opcode) {
+   case SpvOpImageSampleProjImplicitLod:
+   case SpvOpImageSampleProjExplicitLod:
+   case SpvOpImageSampleProjDrefImplicitLod:
+   case SpvOpImageSampleProjDrefExplicitLod:
+      /* These have the projector as the last coordinate component */
+      p->src = nir_src_for_ssa(nir_channel(&b->nb, coord, coord_components));
+      p->src_type = nir_tex_src_projector;
+      p++;
+      break;
+
+   default:
+      break;
+   }
+
    unsigned gather_component = 0;
    switch (opcode) {
    case SpvOpImageSampleDrefImplicitLod:




More information about the mesa-commit mailing list