LLVMValueRef vindex,
LLVMValueRef voffset,
LLVMValueRef soffset,
- LLVMValueRef immoffset)
+ LLVMValueRef immoffset,
+ LLVMValueRef glc)
{
const char *name = "llvm.amdgcn.tbuffer.load.i32";
LLVMTypeRef type = ctx->i32;
immoffset,
LLVMConstInt(ctx->i32, V_008F0C_BUF_DATA_FORMAT_16, false),
LLVMConstInt(ctx->i32, V_008F0C_BUF_NUM_FORMAT_UINT, false),
- ctx->i1false,
+ glc,
ctx->i1false,
};
LLVMValueRef res = ac_build_intrinsic(ctx, name, type, params, 9, 0);
LLVMValueRef src_data = get_src(ctx, instr->src[0]);
int elem_size_bytes = ac_get_elem_bits(&ctx->ac, LLVMTypeOf(src_data)) / 8;
unsigned writemask = nir_intrinsic_write_mask(instr);
+ enum gl_access_qualifier access = nir_intrinsic_access(instr);
+ LLVMValueRef glc = ctx->ac.i1false;
+
+ if (access & (ACCESS_VOLATILE | ACCESS_COHERENT))
+ glc = ctx->ac.i1true;
LLVMValueRef rsrc = ctx->abi->load_ssbo(ctx->abi,
get_src(ctx, instr->src[1]), true);
ctx->ac.i32_0,
LLVMConstInt(ctx->ac.i32, 2, false), // dfmt (= 16bit)
LLVMConstInt(ctx->ac.i32, 4, false), // nfmt (= uint)
- ctx->ac.i1false,
+ glc,
ctx->ac.i1false,
};
ac_build_intrinsic(&ctx->ac, store_name,
rsrc,
ctx->ac.i32_0, /* vindex */
offset,
- ctx->ac.i1false, /* glc */
+ glc,
ctx->ac.i1false, /* slc */
};
ac_build_intrinsic(&ctx->ac, store_name,
int elem_size_bytes = instr->dest.ssa.bit_size / 8;
int num_components = instr->num_components;
int num_bytes = num_components * elem_size_bytes;
+ enum gl_access_qualifier access = nir_intrinsic_access(instr);
+ LLVMValueRef glc = ctx->ac.i1false;
+
+ if (access & (ACCESS_VOLATILE | ACCESS_COHERENT))
+ glc = ctx->ac.i1true;
for (int i = 0; i < num_bytes; i += load_bytes) {
load_bytes = MIN2(num_bytes - i, 16);
vindex,
offset,
ctx->ac.i32_0,
- immoffset);
+ immoffset,
+ glc);
} else {
switch (load_bytes) {
case 16:
rsrc,
vindex,
LLVMBuildAdd(ctx->ac.builder, offset, immoffset, ""),
- ctx->ac.i1false,
+ glc,
ctx->ac.i1false,
};
results[idx] = ac_build_intrinsic(&ctx->ac, load_name, data_type, params, 5, 0);
ctx->ac.i32_0,
offset,
ctx->ac.i32_0,
- LLVMConstInt(ctx->ac.i32, 2 * i, 0));
+ LLVMConstInt(ctx->ac.i32, 2 * i, 0),
+ ctx->ac.i1false);
}
ret = ac_build_gather_values(&ctx->ac, results, num_components);
} else {