[virglrenderer-devel] [PATCH 15/19] tessellation: handle output block variables.

Dave Airlie airlied at gmail.com
Fri Jun 8 05:14:19 UTC 2018


From: Dave Airlie <airlied at redhat.com>

---
 src/vrend_shader.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index cf972f6..00cedbe 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2046,8 +2046,17 @@ get_destination_info(struct dump_ctx *ctx,
                      dinfo->dstconv = INT;
                   }
                } else {
-                  snprintf(dsts[i], 255, "%s%s", ctx->outputs[j].glsl_name, ctx->outputs[j].override_no_wm ? "" : writemask);
-                  dinfo->dst_override_no_wm[i] = ctx->outputs[j].override_no_wm;
+                  if (ctx->outputs[j].glsl_gl_block) {
+                     snprintf(dsts[i], 255, "gl_out[%s].%s%s",
+                              ctx->prog_type == TGSI_PROCESSOR_TESS_CTRL ? "gl_InvocationID" : "0",
+                              ctx->outputs[j].glsl_name,
+                              ctx->outputs[j].override_no_wm ? "" : writemask);
+                  } else if (ctx->prog_type == TGSI_PROCESSOR_TESS_CTRL && ctx->outputs[j].name != TGSI_SEMANTIC_PATCH) {
+                     snprintf(dsts[i], 255, "%s[gl_InvocationID]%s", ctx->outputs[j].glsl_name, ctx->outputs[j].override_no_wm ? "" : writemask);
+                  } else {
+                     snprintf(dsts[i], 255, "%s%s", ctx->outputs[j].glsl_name, ctx->outputs[j].override_no_wm ? "" : writemask);
+                     dinfo->dst_override_no_wm[i] = ctx->outputs[j].override_no_wm;
+                  }
                   if (ctx->outputs[j].is_int) {
                      if (dinfo->dtypeprefix == TYPE_CONVERSION_NONE)
                         dinfo->dtypeprefix = FLOAT_BITS_TO_INT;
-- 
2.14.3



More information about the virglrenderer-devel mailing list