shader: Pass invariant flag based on SID

Since not all varyings are passed from one shader stage to the next,
the invariant flag must be set based on the SID and not the number of
the IO slot used.

Fixes: 5f28eb8868
  shader: fix mismatching shader invariants on GL

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 5 years ago
parent efff41d204
commit a9ca391a86
  1. 6
      src/vrend_shader.c

@ -4653,8 +4653,10 @@ iter_instruction(struct tgsi_iterate_context *iter,
* GLSL < 4.30 it is required to match the output of the previous stage */
if (!ctx->cfg->use_gles) {
for (unsigned i = 0; i < ctx->num_inputs; ++i) {
if (ctx->key->force_invariant_inputs & (1ull << i))
if (ctx->key->force_invariant_inputs & (1ull << ctx->inputs[i].sid))
ctx->inputs[i].invariant = 1;
else
ctx->inputs[i].invariant = 0;
}
}
}
@ -6596,7 +6598,7 @@ static void fill_sinfo(struct dump_ctx *ctx, struct vrend_shader_info *sinfo)
for (unsigned i = 0; i < ctx->num_outputs; ++i) {
if (ctx->outputs[i].invariant)
sinfo->invariant_outputs |= 1ull << i;
sinfo->invariant_outputs |= 1ull << ctx->outputs[i].sid;
}
}

Loading…
Cancel
Save