[virglrenderer-devel] [PATCH 3/3] vrend: only emit alpha test if something writes to mrt 0

Dave Airlie airlied at gmail.com
Fri Mar 9 06:51:32 UTC 2018


From: Dave Airlie <airlied at redhat.com>

The piglit test generates a failed to compile shader:
gl-2.1-fbo-mrt-alphatest-no-buffer-zero-write

The test never validates any result as it can't, but this fixes
the debug logging of the error on the host.
---
 src/vrend_shader.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index fd38478..a71890b 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -835,6 +835,14 @@ static int emit_alpha_test(struct dump_ctx *ctx)
    char comp_buf[128];
    char *sret;
 
+   if (!ctx->num_outputs)
+           return 0;
+
+   if (!ctx->write_all_cbufs) {
+           /* only emit alpha stanza if first output is 0 */
+           if (ctx->outputs[0].sid != 0)
+                   return 0;
+   }
    switch (ctx->key->alpha_test) {
    case PIPE_FUNC_NEVER:
    case PIPE_FUNC_ALWAYS:
-- 
2.14.3



More information about the virglrenderer-devel mailing list