Mesa (staging/21.3): aco: only load streamout buffers if streamout is enabled
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Oct 25 17:31:22 UTC 2021
Module: Mesa
Branch: staging/21.3
Commit: 5635071adc2c578e90b35ceaff65a16349c39a20
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5635071adc2c578e90b35ceaff65a16349c39a20
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Mon Oct 25 13:58:20 2021 +0200
aco: only load streamout buffers if streamout is enabled
The streamout_config SGPR is used to determine if streamout is enabled.
This fixes a GPU hang with various transform feedback tests:
- dEQP-GLES3.functional.transform_feedback.*
- KHR-GL46.transform_feedback.api_errors_test
- KHR-GL46.draw_indirect.basic-draw*-xfbPaused
- KHR-GL46.geometry_shader.api.draw_calls_while_tf_is_paused
Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13514>
(cherry picked from commit dc74285d32df9c09eb896bc4571066402d32d10b)
---
.pick_status.json | 2 +-
src/amd/compiler/aco_instruction_selection.cpp | 16 +++++-----------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 4e8c787513c..429ae82a566 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -13,7 +13,7 @@
"description": "aco: only load streamout buffers if streamout is enabled",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 808e004edfa..ebc8555d40d 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -11218,17 +11218,6 @@ emit_streamout(isel_context* ctx, unsigned stream)
{
Builder bld(ctx->program, ctx->block);
- Temp so_buffers[4];
- Temp buf_ptr = convert_pointer_to_64_bit(ctx, get_arg(ctx, ctx->args->streamout_buffers));
- for (unsigned i = 0; i < 4; i++) {
- unsigned stride = ctx->program->info->so.strides[i];
- if (!stride)
- continue;
-
- Operand off = bld.copy(bld.def(s1), Operand::c32(i * 16u));
- so_buffers[i] = bld.smem(aco_opcode::s_load_dwordx4, bld.def(s4), buf_ptr, off);
- }
-
Temp so_vtx_count =
bld.sop2(aco_opcode::s_bfe_u32, bld.def(s1), bld.def(s1, scc),
get_arg(ctx, ctx->args->ac.streamout_config), Operand::c32(0x70010u));
@@ -11245,13 +11234,18 @@ emit_streamout(isel_context* ctx, unsigned stream)
Temp so_write_index =
bld.vadd32(bld.def(v1), get_arg(ctx, ctx->args->ac.streamout_write_index), tid);
+ Temp so_buffers[4];
Temp so_write_offset[4];
+ Temp buf_ptr = convert_pointer_to_64_bit(ctx, get_arg(ctx, ctx->args->streamout_buffers));
for (unsigned i = 0; i < 4; i++) {
unsigned stride = ctx->program->info->so.strides[i];
if (!stride)
continue;
+ so_buffers[i] = bld.smem(aco_opcode::s_load_dwordx4, bld.def(s4), buf_ptr,
+ bld.copy(bld.def(s1), Operand::c32(i * 16u)));
+
if (stride == 1) {
Temp offset = bld.sop2(aco_opcode::s_add_i32, bld.def(s1), bld.def(s1, scc),
get_arg(ctx, ctx->args->ac.streamout_write_index),
More information about the mesa-commit
mailing list