radeonsi: stop using output_semantic[] for LS outputs passed via VGPRs

this is also required to make mediump work

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
This commit is contained in:
Marek Olšák 2026-03-19 21:55:17 -04:00 committed by Marge Bot
parent ef229b8c3e
commit d4538b90a7
3 changed files with 8 additions and 5 deletions

View file

@ -554,7 +554,7 @@ static bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shade
switch (ctx->stage) {
case MESA_SHADER_VERTEX:
if (shader->key.ge.as_ls)
si_llvm_ls_build_end(ctx);
si_llvm_ls_build_end(ctx, nir);
else if (shader->key.ge.as_es)
si_llvm_es_build_end(ctx);
break;

View file

@ -60,7 +60,7 @@ void si_llvm_es_build_end(struct si_shader_context *ctx);
void si_llvm_gs_build_end(struct si_shader_context *ctx);
/* si_shader_llvm_tess.c */
void si_llvm_ls_build_end(struct si_shader_context *ctx);
void si_llvm_ls_build_end(struct si_shader_context *ctx, const nir_shader *nir);
void si_llvm_init_tcs_callbacks(struct si_shader_context *ctx);
/* si_shader_llvm_ps.c */

View file

@ -8,6 +8,7 @@
#include "si_shader_internal.h"
#include "si_shader_llvm.h"
#include "sid.h"
#include "nir.h"
static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMTypeRef type,
unsigned driver_location, unsigned component,
@ -32,7 +33,7 @@ static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMType
return ac_build_gather_values(&ctx->ac, value + component, num_components);
}
void si_llvm_ls_build_end(struct si_shader_context *ctx)
void si_llvm_ls_build_end(struct si_shader_context *ctx, const nir_shader *nir)
{
struct si_shader *shader = ctx->shader;
bool same_thread_count = shader->key.ge.opt.same_patch_vertices;
@ -75,13 +76,15 @@ void si_llvm_ls_build_end(struct si_shader_context *ctx)
struct si_shader_info *info = &shader->selector->info;
for (unsigned i = 0; i < info->num_outputs; i++) {
unsigned semantic = info->output_semantic[i];
u_foreach_bit64_two_masks(semantic, nir->info.outputs_written,
VARYING_SLOT_VAR0_16BIT, nir->info.outputs_written_16bit) {
int param = si_shader_io_get_unique_index(semantic);
if (!(info->ls_es_outputs_written & BITFIELD64_BIT(param)))
continue;
unsigned i = ac_nir_get_io_driver_location(nir, semantic, false);
for (unsigned chan = 0; chan < 4; chan++) {
if (!ctx->abi.outputs[4 * i + chan])
continue;