[virglrenderer-devel] [PATCH 07/19] shader: consolidate winsys_adjust_y uniform emission.

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


From: Dave Airlie <airlied at redhat.com>

tess will needs this as well
---
 src/vrend_shader.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index 907f813..6a07611 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -3010,10 +3010,13 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
       }
    }
 
-   if (ctx->prog_type == TGSI_PROCESSOR_VERTEX) {
+   if (ctx->prog_type == TGSI_PROCESSOR_VERTEX ||
+       ctx->prog_type == TGSI_PROCESSOR_GEOMETRY) {
       snprintf(buf, 255, "uniform float winsys_adjust_y;\n");
       STRCAT_WITH_RET(glsl_hdr, buf);
+   }
 
+   if (ctx->prog_type == TGSI_PROCESSOR_VERTEX) {
       if (ctx->has_clipvertex) {
          snprintf(buf, 255, "%svec4 clipv_tmp;\n", ctx->has_clipvertex_so ? "out " : "");
          STRCAT_WITH_RET(glsl_hdr, buf);
@@ -3051,8 +3054,6 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
    }
 
    if (ctx->prog_type == TGSI_PROCESSOR_GEOMETRY) {
-      snprintf(buf, 255, "uniform float winsys_adjust_y;\n");
-      STRCAT_WITH_RET(glsl_hdr, buf);
       if (ctx->num_in_clip_dist || ctx->key->clip_plane_enable || ctx->key->prev_stage_pervertex_out) {
          int clip_dist, cull_dist;
          char clip_var[64] = {}, cull_var[64] = {};
-- 
2.14.3



More information about the virglrenderer-devel mailing list