summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2013-09-15 18:23:14 +1200
committerChris Forbes <chrisf@ijw.co.nz>2013-10-03 07:56:34 +1300
commitdd4c2a516cf2c700694bcbd37d644d7239f4cf48 (patch)
tree23dddfb2a6627c30d700e6d047f752fd66c0fb2c /src/mesa
parentc08f2083ee0c5d71351fe8eb9f41218a6fed7b10 (diff)
downloadexternal_mesa3d-dd4c2a516cf2c700694bcbd37d644d7239f4cf48.zip
external_mesa3d-dd4c2a516cf2c700694bcbd37d644d7239f4cf48.tar.gz
external_mesa3d-dd4c2a516cf2c700694bcbd37d644d7239f4cf48.tar.bz2
i965: use gather slots in the binding table for gather4.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_generator.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_generator.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 5672eae..5b1ecc8 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -522,11 +522,15 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src
src = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW);
}
+ uint32_t surface_index = inst->opcode == SHADER_OPCODE_TG4
+ ? SURF_INDEX_GATHER_TEXTURE(inst->sampler)
+ : SURF_INDEX_TEXTURE(inst->sampler);
+
brw_SAMPLE(p,
retype(dst, BRW_REGISTER_TYPE_UW),
inst->base_mrf,
src,
- SURF_INDEX_TEXTURE(inst->sampler),
+ surface_index,
inst->sampler,
msg_type,
rlen,
@@ -535,7 +539,7 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src
simd_mode,
return_format);
- mark_surface_used(SURF_INDEX_TEXTURE(inst->sampler));
+ mark_surface_used(surface_index);
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index 6bdffb3..00efb10 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -385,11 +385,15 @@ vec4_generator::generate_tex(vec4_instruction *inst,
break;
}
+ uint32_t surface_index = inst->opcode == SHADER_OPCODE_TG4
+ ? SURF_INDEX_VEC4_GATHER_TEXTURE(inst->sampler)
+ : SURF_INDEX_VEC4_TEXTURE(inst->sampler);
+
brw_SAMPLE(p,
dst,
inst->base_mrf,
src,
- SURF_INDEX_VEC4_TEXTURE(inst->sampler),
+ surface_index,
inst->sampler,
msg_type,
1, /* response length */
@@ -398,7 +402,7 @@ vec4_generator::generate_tex(vec4_instruction *inst,
BRW_SAMPLER_SIMD_MODE_SIMD4X2,
return_format);
- mark_surface_used(SURF_INDEX_VEC4_TEXTURE(inst->sampler));
+ mark_surface_used(surface_index);
}
void