summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-21 12:01:46 -0700
committerJason Ekstrand <[email protected]>2016-07-22 16:48:54 -0700
commit71202352c8d9f87d7b6f06bece67771d7cf641a4 (patch)
tree11ea2df131a6e368ed3f7e7c55730c93e9c8e6b8 /src
parent36c31b8fa22acee78c26ec9a82fbc13d992d022f (diff)
spirv/nir: Handle texture projectors
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 6ebf951ab47..27d2b4239bb 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: