summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-01 13:47:13 -0800
committerJason Ekstrand <[email protected]>2016-02-01 14:03:05 -0800
commitb1a16232932058f1b3db478964098c3a7c76e8d4 (patch)
treeb21dfafecee12815e000174a51c0641738f0c59d
parent593f88c0db10c31486db872c0eeda0c66ca22afb (diff)
nir/spirv: Add support for SpvOpImage
-rw-r--r--src/glsl/nir/spirv/spirv_to_nir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c
index 32188e5f364..ed6ad6d7e63 100644
--- a/src/glsl/nir/spirv/spirv_to_nir.c
+++ b/src/glsl/nir/spirv/spirv_to_nir.c
@@ -1167,6 +1167,17 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
val->sampled_image->sampler =
vtn_value(b, w[4], vtn_value_type_access_chain)->access_chain;
return;
+ } else if (opcode == SpvOpImage) {
+ struct vtn_value *val =
+ vtn_push_value(b, w[2], vtn_value_type_access_chain);
+ struct vtn_value *src_val = vtn_untyped_value(b, w[3]);
+ if (src_val->value_type == vtn_value_type_sampled_image) {
+ val->access_chain = src_val->sampled_image->image;
+ } else {
+ assert(src_val->value_type == vtn_value_type_access_chain);
+ val->access_chain = src_val->access_chain;
+ }
+ return;
}
struct vtn_type *ret_type = vtn_value(b, w[1], vtn_value_type_type)->type;
@@ -2380,6 +2391,7 @@ vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode,
break;
case SpvOpSampledImage:
+ case SpvOpImage:
case SpvOpImageSampleImplicitLod:
case SpvOpImageSampleExplicitLod:
case SpvOpImageSampleDrefImplicitLod: