summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-06-03 19:43:44 -0400
committerMarek Olšák <[email protected]>2019-06-11 20:05:21 -0400
commit4773f5a293d103ea225b54274026018275d208d9 (patch)
tree06e6cd23c8cfa3eec16aeec319a34b778447b903 /src/gallium/drivers
parent579003e7bd979d3285c60becd1357c5f95799cca (diff)
radeonsi: use the ac helper for index buffer stores in the culling shader
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_compute_prim_discard.c21
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c2
2 files changed, 10 insertions, 13 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
index 362c63c2e44..3bed818d5ad 100644
--- a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
+++ b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c
@@ -856,18 +856,15 @@ void si_build_prim_discard_compute_shader(struct si_shader_context *ctx)
}
/* Write indices for accepted primitives. */
- LLVMValueRef buf_args[] = {
- ac_to_float(&ctx->ac, ac_build_expand_to_vec4(&ctx->ac,
- ac_build_gather_values(&ctx->ac, index, 3), 3)),
- output_indexbuf,
- LLVMBuildAdd(builder, start, prim_index, ""),
- ctx->i32_0, /* voffset */
- ctx->i1true, /* glc */
- LLVMConstInt(ctx->i1, INDEX_STORES_USE_SLC, 0),
- };
- ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.buffer.store.format.v4f32",
- ctx->voidt, buf_args, 6,
- ac_get_store_intr_attribs(true));
+ LLVMValueRef vindex = LLVMBuildAdd(builder, start, prim_index, "");
+ LLVMValueRef vdata = ac_build_gather_values(&ctx->ac, index, 3);
+
+ if (!ac_has_vec3_support(ctx->ac.chip_class, true))
+ vdata = ac_build_expand_to_vec4(&ctx->ac, vdata, 3);
+
+ ac_build_buffer_store_format(&ctx->ac, output_indexbuf, vdata,
+ vindex, ctx->i32_0, 3, true,
+ INDEX_STORES_USE_SLC, true);
}
lp_build_endif(&if_accepted);
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
index 2cf1f902cee..5f60d8dc33f 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
@@ -728,7 +728,7 @@ static void store_emit(
ac_build_gather_values(&ctx->ac, chans, num_channels),
vindex, ctx->i32_0 /* voffset */,
num_channels,
- !!(args.cache_policy & ac_glc),
+ !!(args.cache_policy & ac_glc), false,
writeonly_memory);
} else {
args.opcode = ac_image_store;