diff options
author | Lepton Wu <lepton@chromium.org> | 2018-03-22 10:58:00 -0700 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-03-26 13:15:35 +1000 |
commit | 75da5a7b99d5e16b174c4a64255f061c70a63736 (patch) | |
tree | 877a4f7dec728c03deb5ddcf344c2e36856fc626 | |
parent | 23e3c635de49d5b42855d72f70e41484498a3ce1 (diff) |
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>
-rw-r--r-- | src/vrend_shader.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 2b7d951..7032a90 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2438,7 +2438,10 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr) } if (ctx->write_all_cbufs) { for (i = 0; i < 8; i++) { - snprintf(buf, 255, "out vec4 fsout_c%d;\n", 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); STRCAT_WITH_RET(glsl_hdr, buf); } } else { |