r600/sb/cayman: fix indirect ubo access on cayman
authorDave Airlie <airlied@redhat.com>
Mon, 5 Feb 2018 06:04:18 +0000 (16:04 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 6 Feb 2018 20:08:11 +0000 (06:08 +1000)
With sb enabled on cayman, this was overwriting the proper
cf index value with random ones if the dst gpr was 2 or 3,
only save the value for a MOVA instruction.

Fixes:
KHR-GL45.gpu_shader5.uniform_blocks_array_indexing
(on cayman with sb)

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/sb/sb_bc_parser.cpp

index 970e4141d54400f14c5ee0ed009b380eca510839..87035ee2a6b9fdb4948de5a2dcca1f7739a0cf9b 100644 (file)
@@ -567,7 +567,7 @@ int bc_parser::prepare_alu_group(cf_node* cf, alu_group_node *g) {
                        n->src.push_back(get_cf_index_value(1));
                }
 
-               if ((n->bc.dst_gpr == CM_V_SQ_MOVA_DST_CF_IDX0 || n->bc.dst_gpr == CM_V_SQ_MOVA_DST_CF_IDX1) &&
+               if ((flags & AF_MOVA) && (n->bc.dst_gpr == CM_V_SQ_MOVA_DST_CF_IDX0 || n->bc.dst_gpr == CM_V_SQ_MOVA_DST_CF_IDX1) &&
                    ctx.is_cayman())
                        // Move CF_IDX value into tex instruction operands, scheduler will later re-emit setting of CF_IDX
                        save_set_cf_index(n->src[0], n->bc.dst_gpr == CM_V_SQ_MOVA_DST_CF_IDX1);