[virglrenderer-devel] [PATCH 08/21] shader: consolidate winsys_adjust_y uniform emission.

Dave Airlie airlied at gmail.com
Wed Jun 13 00:56:42 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 2f8f907..45920b9 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -3158,10 +3158,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);
@@ -3199,8 +3202,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