aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-10-10 19:57:29 +1300
committerChris Forbes <[email protected]>2013-10-26 22:16:32 +1300
commit3c98d77460df0e7dde7fb22beaa4c4e6dc8a3602 (patch)
tree6a8e3edd3658b82b81d7c627bb46dedc7de99bb6
parent32f898a71cd0a83677944f0444145c4a04c966a1 (diff)
i965/fs: Add support for shadow comparitors with gather4
Note that gather4_po_c's parameters are too long for SIMD16. It might be worth emitting 2xSIMD8 messages in this case at some point. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_generator.cpp15
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 6b9f70b5693..853120dc9bf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -435,12 +435,21 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src
msg_type = GEN5_SAMPLER_MESSAGE_LOD;
break;
case SHADER_OPCODE_TG4:
- assert(brw->gen >= 6);
- msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4;
+ if (inst->shadow_compare) {
+ assert(brw->gen >= 7);
+ msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_C;
+ } else {
+ assert(brw->gen >= 6);
+ msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4;
+ }
break;
case SHADER_OPCODE_TG4_OFFSET:
assert(brw->gen >= 7);
- msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO;
+ if (inst->shadow_compare) {
+ msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO_C;
+ } else {
+ msg_type = GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO;
+ }
break;
default:
assert(!"not reached");
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 314fe2ab519..1d2da8cf1b6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1359,6 +1359,9 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
break;
case ir_tg4:
if (has_nonconstant_offset) {
+ if (ir->shadow_comparitor && dispatch_width == 16)
+ fail("Gen7 does not support gather4_po_c in SIMD16 mode.");
+
/* More crazy intermixing */
ir->offset->accept(this);
fs_reg offset_value = this->result;