shader: Skip explicit location for dual_src_blend

If host support dual_src_blend extension, it's possible we need
to call glBindFragDataLocationIndexed to set fragment output location.
We can't explicitly set it in GLSL in such cases.

Fixes: b17ba74 ("shader: Add layout qualifier to fragment shader outputs")
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
macos/master
Lepton Wu 4 years ago
parent c5663614be
commit 75c1ae0919
  1. 1
      src/vrend_renderer.c
  2. 3
      src/vrend_shader.c
  3. 1
      src/vrend_shader.h

@ -6237,6 +6237,7 @@ struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *de
grctx->shader_cfg.has_es31_compat = has_feature(feat_gles31_compatibility);
grctx->shader_cfg.has_conservative_depth = has_feature(feat_conservative_depth);
grctx->shader_cfg.use_integer = vrend_state.use_integer;
grctx->shader_cfg.has_dual_src_blend = has_feature(feat_dual_src_blend);
vrend_renderer_create_sub_ctx(grctx, 0);
vrend_renderer_set_sub_ctx(grctx, 0);

@ -6336,7 +6336,8 @@ static void emit_ios_fs(struct dump_ctx *ctx)
char prefix[64] = "";
if (ctx->cfg->use_gles &&
ctx->outputs[i].name == TGSI_SEMANTIC_COLOR)
ctx->outputs[i].name == TGSI_SEMANTIC_COLOR &&
!ctx->cfg->has_dual_src_blend)
sprintf(prefix, "layout(location = %d)", ctx->outputs[i].sid);
emit_ios_generic(ctx, io_out, prefix, &ctx->outputs[i],

@ -169,6 +169,7 @@ struct vrend_shader_cfg {
bool has_es31_compat;
bool has_conservative_depth;
bool use_integer;
bool has_dual_src_blend;
};
struct vrend_context;

Loading…
Cancel
Save