tgsi/scan: add flag colors_written
authorMarek Olšák <marek.olsak@amd.com>
Thu, 10 Dec 2015 12:15:50 +0000 (13:15 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 11 Dec 2015 14:25:11 +0000 (15:25 +0100)
This is a prerequisite for the following r600g fix.

Cc: 11.0 11.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index 4645ef26cab5932c0133c28061306f273fed4af3..e04f4076e9cb600235cc97df207e7fa9f1c2f1e2 100644 (file)
@@ -365,6 +365,9 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   info->output_semantic_index[reg] = (ubyte) semIndex;
                   info->num_outputs++;
 
+                  if (semName == TGSI_SEMANTIC_COLOR)
+                     info->colors_written |= 1 << semIndex;
+
                   if (procType == TGSI_PROCESSOR_VERTEX ||
                       procType == TGSI_PROCESSOR_GEOMETRY ||
                       procType == TGSI_PROCESSOR_TESS_CTRL ||
index d60ccabda6d2cc1cd4ad813a162bda1c14c927e7..7e9a5597db2fa7459bfe88998d9f233245919595 100644 (file)
@@ -77,6 +77,7 @@ struct tgsi_shader_info
 
    uint opcode_count[TGSI_OPCODE_LAST];  /**< opcode histogram */
 
+   ubyte colors_written;
    boolean reads_position; /**< does fragment shader read position? */
    boolean reads_z; /**< does fragment shader read depth? */
    boolean writes_z;  /**< does fragment shader write Z value? */