mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
i965: Fix shared atomic intrinsics to pay attention to base.
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 76e161056a)
This commit is contained in:
parent
e1c20919a8
commit
2f80fb368b
1 changed files with 12 additions and 1 deletions
|
|
@ -4060,12 +4060,23 @@ fs_visitor::nir_emit_shared_atomic(const fs_builder &bld,
|
||||||
dest = get_nir_dest(instr->dest);
|
dest = get_nir_dest(instr->dest);
|
||||||
|
|
||||||
fs_reg surface = brw_imm_ud(GEN7_BTI_SLM);
|
fs_reg surface = brw_imm_ud(GEN7_BTI_SLM);
|
||||||
fs_reg offset = get_nir_src(instr->src[0]);
|
fs_reg offset;
|
||||||
fs_reg data1 = get_nir_src(instr->src[1]);
|
fs_reg data1 = get_nir_src(instr->src[1]);
|
||||||
fs_reg data2;
|
fs_reg data2;
|
||||||
if (op == BRW_AOP_CMPWR)
|
if (op == BRW_AOP_CMPWR)
|
||||||
data2 = get_nir_src(instr->src[2]);
|
data2 = get_nir_src(instr->src[2]);
|
||||||
|
|
||||||
|
/* Get the offset */
|
||||||
|
nir_const_value *const_offset = nir_src_as_const_value(instr->src[0]);
|
||||||
|
if (const_offset) {
|
||||||
|
offset = brw_imm_ud(instr->const_index[0] + const_offset->u32[0]);
|
||||||
|
} else {
|
||||||
|
offset = vgrf(glsl_type::uint_type);
|
||||||
|
bld.ADD(offset,
|
||||||
|
retype(get_nir_src(instr->src[0]), BRW_REGISTER_TYPE_UD),
|
||||||
|
brw_imm_ud(instr->const_index[0]));
|
||||||
|
}
|
||||||
|
|
||||||
/* Emit the actual atomic operation operation */
|
/* Emit the actual atomic operation operation */
|
||||||
|
|
||||||
fs_reg atomic_result = emit_untyped_atomic(bld, surface, offset,
|
fs_reg atomic_result = emit_untyped_atomic(bld, surface, offset,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue