shader: Add explicit location for out in gles mode

Without this, when running under ES 3.2 profile (nvidia driver), I
hit "error C5121: multiple bindings to output semantic".

Tested by running Chrome OS under qemu with these profiles:

core profile: 4.5.0 NVIDIA 384.111
core profile: 3.3 (Core Profile) Mesa 17.3.3
es profile: OpenGL ES 3.2 NVIDIA 384.111
es profile: OpenGL ES 3.0 Mesa 17.3.3
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Lepton Wu 7 years ago committed by Dave Airlie
parent 23e3c635de
commit 75da5a7b99
  1. 3
      src/vrend_shader.c

@ -2438,6 +2438,9 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
} }
if (ctx->write_all_cbufs) { if (ctx->write_all_cbufs) {
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (ctx->cfg->use_gles)
snprintf(buf, 255, "layout (location=%d) out vec4 fsout_c%d;\n", i, i);
else
snprintf(buf, 255, "out vec4 fsout_c%d;\n", i); snprintf(buf, 255, "out vec4 fsout_c%d;\n", i);
STRCAT_WITH_RET(glsl_hdr, buf); STRCAT_WITH_RET(glsl_hdr, buf);
} }

Loading…
Cancel
Save