v2: Update NIR atomic intrinsic handling too (Ken).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
break;
case SHADER_OPCODE_UNTYPED_ATOMIC:
- assert(src[1].file == BRW_IMMEDIATE_VALUE &&
- src[2].file == BRW_IMMEDIATE_VALUE);
+ assert(src[2].file == BRW_IMMEDIATE_VALUE);
brw_untyped_atomic(p, dst, src[0], src[1], src[2].dw1.ud,
inst->mlen, !inst->dst.is_null());
- brw_mark_surface_used(prog_data, src[1].dw1.ud);
break;
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
- assert(src[1].file == BRW_IMMEDIATE_VALUE &&
- src[2].file == BRW_IMMEDIATE_VALUE);
+ assert(src[2].file == BRW_IMMEDIATE_VALUE);
brw_untyped_surface_read(p, dst, src[0], src[1],
inst->mlen, src[2].dw1.ud);
- brw_mark_surface_used(prog_data, src[1].dw1.ud);
break;
case SHADER_OPCODE_UNTYPED_SURFACE_WRITE:
default:
unreachable("Unreachable");
}
+
+ /* Mark the surface as used. */
+ brw_mark_surface_used(stage_prog_data, surf_index);
break;
}
break;
case SHADER_OPCODE_UNTYPED_ATOMIC:
- assert(src[1].file == BRW_IMMEDIATE_VALUE &&
- src[2].file == BRW_IMMEDIATE_VALUE);
+ assert(src[2].file == BRW_IMMEDIATE_VALUE);
brw_untyped_atomic(p, dst, src[0], src[1], src[2].dw1.ud, inst->mlen,
!inst->dst.is_null());
- brw_mark_surface_used(&prog_data->base, src[1].dw1.ud);
break;
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
- assert(src[1].file == BRW_IMMEDIATE_VALUE &&
- src[2].file == BRW_IMMEDIATE_VALUE);
+ assert(src[2].file == BRW_IMMEDIATE_VALUE);
brw_untyped_surface_read(p, dst, src[0], src[1], inst->mlen,
src[2].dw1.ud);
- brw_mark_surface_used(&prog_data->base, src[1].dw1.ud);
break;
case SHADER_OPCODE_UNTYPED_SURFACE_WRITE:
emit_untyped_atomic(BRW_AOP_PREDEC, surf_index, dst, offset,
src_reg(), src_reg());
}
+
+ brw_mark_surface_used(stage_prog_data, surf_index);
}
void