LLVMValueRef main_fn,
uint8_t *vs_output_param_offset,
uint32_t num_outputs,
+ uint32_t skip_output_mask,
uint8_t *num_param_exports)
{
LLVMBasicBlockRef bb;
target -= V_008DFC_SQ_EXP_PARAM;
+ if ((1u << target) & skip_output_mask)
+ continue;
+
/* Parse the instruction. */
memset(&exp, 0, sizeof(exp));
exp.offset = target;
LLVMValueRef main_fn,
uint8_t *vs_output_param_offset,
uint32_t num_outputs,
+ uint32_t skip_output_mask,
uint8_t *num_param_exports);
void ac_init_exec_full_mask(struct ac_llvm_context *ctx);
ac_optimize_vs_outputs(&ctx->ac,
ctx->main_function,
outinfo->vs_output_param_offset,
- VARYING_SLOT_MAX,
+ VARYING_SLOT_MAX, 0,
&outinfo->param_exports);
}
{
struct si_shader *shader = ctx->shader;
struct si_shader_info *info = &shader->selector->info;
+ unsigned skip_vs_optim_mask = 0;
if ((ctx->type != PIPE_SHADER_VERTEX && ctx->type != PIPE_SHADER_TESS_EVAL) ||
shader->key.as_ls || shader->key.as_es)
return;
+ /* Optimizing these outputs is not possible, since they might be overriden
+ * at runtime with S_028644_PT_SPRITE_TEX. */
+ for (int i = 0; i < info->num_outputs; i++) {
+ if (info->output_semantic_name[i] == TGSI_SEMANTIC_PCOORD ||
+ info->output_semantic_name[i] == TGSI_SEMANTIC_TEXCOORD) {
+ skip_vs_optim_mask |= 1u << shader->info.vs_output_param_offset[i];
+ }
+ }
+
ac_optimize_vs_outputs(&ctx->ac, ctx->main_fn, shader->info.vs_output_param_offset,
- info->num_outputs, &shader->info.nr_param_exports);
+ info->num_outputs, skip_vs_optim_mask,
+ &shader->info.nr_param_exports);
}
static bool si_vs_needs_prolog(const struct si_shader_selector *sel,