Mesa (master): radeonsi: don't crash if input_usage_mask is 0 for a VS input
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Sep 3 02:58:36 UTC 2020
Module: Mesa
Branch: master
Commit: 0464ee7f9d9383175c31192500ee9e6d9f01fe60
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0464ee7f9d9383175c31192500ee9e6d9f01fe60
Author: Marek Olšák <marek.olsak at amd.com>
Date: Thu Aug 13 22:12:12 2020 -0400
radeonsi: don't crash if input_usage_mask is 0 for a VS input
This will start happening with the lowered IO intrinstics and new scanning
code.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6445>
---
src/gallium/drivers/radeonsi/si_shader_llvm_vs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c b/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c
index 62ec43cd195..f0c93ac3264 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c
@@ -132,8 +132,14 @@ static void load_input_vs(struct si_shader_context *ctx, unsigned input_index, L
return;
}
- /* Do multiple loads for special formats. */
unsigned required_channels = util_last_bit(info->input_usage_mask[input_index]);
+ if (required_channels == 0) {
+ for (unsigned i = 0; i < 4; ++i)
+ out[i] = LLVMGetUndef(ctx->ac.f32);
+ return;
+ }
+
+ /* Do multiple loads for special formats. */
LLVMValueRef fetches[4];
unsigned num_fetches;
unsigned fetch_stride;
More information about the mesa-commit
mailing list