[virglrenderer-devel] [PATCH 16/21] tessellation: handle output block variables.

Dave Airlie airlied at gmail.com
Mon Jun 11 05:11:07 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 ce34326..e8de9d7 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -2096,8 +2096,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