From 10571677e5429347d4be47eea1f352da351c067d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 25 Aug 2020 13:54:38 -0400 Subject: [PATCH] radeonsi: fix tess levels coming as scalar arrays from SPIR-V This fixes: KHR-GL45.gl_spirv.spirv_modules_positive_test Fixes: 75ce078a0af "radeonsi: enable NIR by default and document GL 4.6 support" Reviewed-by: Bas Nieuwenhuizen Part-of: (cherry picked from commit a61890883ddb993cce1b94ccff20b638acd0a4f7) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_shader_llvm_tess.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 329ad56df13..4a10eac2247 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -904,7 +904,7 @@ "description": "radeonsi: fix tess levels coming as scalar arrays from SPIR-V", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "75ce078a0aff7fa0f4d6467bea787327da3a4b69" }, diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c index 627e0ffdd5d..13bed5f2569 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c @@ -513,7 +513,7 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_ { struct si_shader_context *ctx = si_shader_context_from_abi(abi); struct si_shader_info *info = &ctx->shader->selector->info; - const unsigned component = var->data.location_frac; + unsigned component = var->data.location_frac; unsigned driver_location = var->data.driver_location; LLVMValueRef dw_addr, stride; LLVMValueRef buffer, base, addr; @@ -521,6 +521,12 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_ bool skip_lds_store; bool is_tess_factor = false, is_tess_inner = false; + if (var->data.compact) { + component += const_index; + writemask <<= const_index; + const_index = 0; + } + driver_location = driver_location / 4; ubyte name = info->output_semantic_name[driver_location]; ubyte index = info->output_semantic_index[driver_location];