tgsi/scan: record if a shader writes the position output
authorMarek Olšák <marek.olsak@amd.com>
Mon, 14 Nov 2016 01:01:34 +0000 (02:01 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 21 Nov 2016 20:44:35 +0000 (21:44 +0100)
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index f0dba0b1bda40fa458a8223eaae02a41a3a90454..84d64568c4befa62b54255af78a6d32229d33bda 100644 (file)
@@ -575,6 +575,8 @@ scan_declaration(struct tgsi_shader_info *info,
          case TGSI_SEMANTIC_POSITION:
             if (procType == PIPE_SHADER_FRAGMENT)
                info->writes_z = true;
+            else
+               info->writes_position = true;
             break;
          }
          break;
index 602a8703d502a30bde7298c624ec59cbd1e09cd6..fe503e8ba366cc9729e2ba3000d5bcbcaf8be6ad 100644 (file)
@@ -110,6 +110,7 @@ struct tgsi_shader_info
    boolean uses_primid;
    boolean uses_frontface;
    boolean uses_invocationid;
+   boolean writes_position;
    boolean writes_psize;
    boolean writes_clipvertex;
    boolean writes_viewport_index;