summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-07-20 19:56:45 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-07-22 16:27:35 -0700
commit95e9d58bdb7df402d9035842c3fe76234a14c2da (patch)
treecef782cf60302f14c0ddaaab01054a7be7be4497 /src/compiler/spirv
parent7c7acf53b2ddd41d307699ebd8bf108c4478ce07 (diff)
downloadexternal_mesa3d-95e9d58bdb7df402d9035842c3fe76234a14c2da.zip
external_mesa3d-95e9d58bdb7df402d9035842c3fe76234a14c2da.tar.gz
external_mesa3d-95e9d58bdb7df402d9035842c3fe76234a14c2da.tar.bz2
spirv/nir: Properly handle gather components
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/spirv')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index c32dfaa..b1bb48b 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1368,14 +1368,23 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
break;
}
- /* These all have an explicit depth value as their next source */
+ unsigned gather_component = 0;
switch (opcode) {
case SpvOpImageSampleDrefImplicitLod:
case SpvOpImageSampleDrefExplicitLod:
case SpvOpImageSampleProjDrefImplicitLod:
case SpvOpImageSampleProjDrefExplicitLod:
+ case SpvOpImageDrefGather:
+ /* These all have an explicit depth value as their next source */
(*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_comparitor);
break;
+
+ case SpvOpImageGather:
+ /* This has a component as its next source */
+ gather_component =
+ vtn_value(b, w[idx++], vtn_value_type_constant)->constant->value.u[0];
+ break;
+
default:
break;
}
@@ -1481,6 +1490,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
instr->is_shadow = glsl_sampler_type_is_shadow(image_type);
instr->is_new_style_shadow = instr->is_shadow &&
glsl_get_components(ret_type->type) == 1;
+ instr->component = gather_component;
if (has_coord) {
switch (instr->sampler_dim) {