shader: Add layout qualifier to fragment shader outputs

This is required per GLES specification.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
macos/master
Lepton Wu 4 years ago
parent 43148d1115
commit b17ba74ae5
  1. 8
      src/vrend_shader.c

@ -6225,7 +6225,13 @@ static void emit_ios_fs(struct dump_ctx *ctx)
for (i = 0; i < ctx->num_outputs; i++) {
if (!ctx->outputs[i].glsl_predefined_no_emit) {
emit_ios_generic(ctx, io_out, "", &ctx->outputs[i],
char prefix[64] = "";
if (ctx->cfg->use_gles &&
ctx->outputs[i].name == TGSI_SEMANTIC_COLOR)
sprintf(prefix, "layout(location = %d)", ctx->outputs[i].sid);
emit_ios_generic(ctx, io_out, prefix, &ctx->outputs[i],
ctx->outputs[i].fbfetch_used ? "inout" : "out", "");
} else if (ctx->outputs[i].invariant || ctx->outputs[i].precise) {

Loading…
Cancel
Save