summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-11-29 15:55:00 +0100
committerNicolai Hähnle <[email protected]>2016-12-12 09:04:43 +0100
commitdfb69cac3354ecb338987b02f635de0bfdcf37d2 (patch)
treebc414af6a08d4c3c07efcc2047dfc95eec3a84bb /src
parent21f2bb22a3077dce5ce8e93a0bebc9a9b7fdb82d (diff)
radeonsi: only export from GS copy shader for vertex stream 0
When running the copy shader for vertex streams != 0, the SX does not need any data from us (there is no rasterization for the higher vertex streams, only streamout). Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 7c8fad1d659..daff6296c94 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -6421,26 +6421,33 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
}
}
- if (gs_selector->so.num_outputs) {
- for (int stream = 0; stream < 4; stream++) {
- struct lp_build_if_state if_ctx_stream;
+ for (int stream = 0; stream < 4; stream++) {
+ struct lp_build_if_state if_ctx_stream;
- if (!gsinfo->num_stream_output_components[stream])
- continue;
+ if (!gsinfo->num_stream_output_components[stream])
+ continue;
+
+ if (stream > 0 && !gs_selector->so.num_outputs)
+ continue;
- LLVMValueRef is_stream =
- LLVMBuildICmp(builder, LLVMIntEQ,
- stream_id,
- lp_build_const_int32(gallivm, stream), "");
+ LLVMValueRef is_stream =
+ LLVMBuildICmp(builder, LLVMIntEQ,
+ stream_id,
+ lp_build_const_int32(gallivm, stream), "");
- lp_build_if(&if_ctx_stream, gallivm, is_stream);
+ lp_build_if(&if_ctx_stream, gallivm, is_stream);
+
+ if (gs_selector->so.num_outputs) {
si_llvm_emit_streamout(&ctx, outputs,
gsinfo->num_outputs,
stream);
- lp_build_endif(&if_ctx_stream);
}
+
+ if (stream == 0)
+ si_llvm_export_vs(bld_base, outputs, gsinfo->num_outputs);
+
+ lp_build_endif(&if_ctx_stream);
}
- si_llvm_export_vs(bld_base, outputs, gsinfo->num_outputs);
LLVMBuildRetVoid(gallivm->builder);