mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
brw: Also check for ADDRESS file in update_for_reads
Like accumulators and ARF address registers, the virtual address registers are not tracked in a way the defs analysis can know about. This could actually be fixed, but that is future work. Fixes:b110b06447("brw: introduce a new register type for the address register") Suggested-by: Lionel Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit8624da56ee) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
parent
815691378b
commit
0d52c7941e
3 changed files with 30 additions and 5 deletions
|
|
@ -2944,7 +2944,7 @@
|
|||
"description": "brw: Also check for ADDRESS file in update_for_reads",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "b110b06447b421c4ee5b0d55c37e6a1cc1b62cd5",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -60,10 +60,11 @@ brw_def_analysis::update_for_reads(const brw_idom_tree &idom,
|
|||
/* Similarly, explicit reads of accumulators, address registers,
|
||||
* and flags make the destination not a def, as we don't track those.
|
||||
*/
|
||||
if (inst->src[i].file == ARF &&
|
||||
(brw_reg_is_arf(inst->src[i], BRW_ARF_ADDRESS) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_ACCUMULATOR) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_FLAG)))
|
||||
if (inst->src[i].file == ADDRESS ||
|
||||
(inst->src[i].file == ARF &&
|
||||
(brw_reg_is_arf(inst->src[i], BRW_ARF_ADDRESS) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_ACCUMULATOR) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_FLAG))))
|
||||
mark_invalid(inst->dst);
|
||||
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -91,3 +91,27 @@ TEST_F(defs_test, src_is_acc2)
|
|||
|
||||
EXPECT_EQ(NULL, defs.get(dst0));
|
||||
}
|
||||
|
||||
TEST_F(defs_test, src_is_address)
|
||||
{
|
||||
set_gfx_verx10(125);
|
||||
|
||||
brw_builder bld = make_shader(MESA_SHADER_FRAGMENT, 16);
|
||||
|
||||
brw_reg dst0 = vgrf(bld, BRW_TYPE_UW);
|
||||
brw_reg src0 = vgrf(bld, BRW_TYPE_UW);
|
||||
brw_reg addr = brw_address_reg(0);
|
||||
|
||||
addr.nr = 1;
|
||||
|
||||
bld.MOV(src0, brw_imm_uw(1));
|
||||
bld.uniform().MOV(addr, brw_imm_uw(2));
|
||||
bld.ADD(dst0, src0, addr);
|
||||
|
||||
brw_calculate_cfg(*bld.shader);
|
||||
brw_validate(*bld.shader);
|
||||
|
||||
const brw_def_analysis &defs = bld.shader->def_analysis.require();
|
||||
|
||||
EXPECT_EQ(NULL, defs.get(dst0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue