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

Jakob Bornecrantz jakob at collabora.com
Fri Mar 23 12:44:20 UTC 2018


On 2018-03-22 17:58, Lepton Wu wrote:
> 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

Great, thanks for the fix!

Tested-by: Jakob Bornecrantz <jakob at collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob at collabora.com>

> ---
>   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 {
> 



More information about the virglrenderer-devel mailing list