[virglrenderer-devel] [PATCH] shader: Add explicit location for out in gles mode

Lepton Wu lepton at chromium.org
Thu Mar 22 17:58:00 UTC 2018


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
---
 src/vrend_shader.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index a71890b..bf0d0fb 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2416,7 +2416,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 {
-- 
2.17.0.rc0.231.g781580f067-goog



More information about the virglrenderer-devel mailing list