draw: use common exit path in pipeline finish.
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi_scan.c
index 3ed8d1a3ed3fd9f4196e321e9672ddb14378afdc..0cd4a8883ae735278fdff93586e4967e39e491c2 100644 (file)
@@ -293,6 +293,15 @@ scan_src_operand(struct tgsi_shader_info *info,
        !is_mem_query_inst(fullinst->Instruction.Opcode)) {
       *is_mem_inst = true;
 
+      if (src->Register.File == TGSI_FILE_IMAGE &&
+          (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA ||
+           fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)) {
+         if (src->Register.Indirect)
+            info->msaa_images_declared = info->images_declared;
+         else
+            info->msaa_images_declared |= 1 << src->Register.Index;
+      }
+
       if (tgsi_get_opcode_info(fullinst->Instruction.Opcode)->is_store) {
          info->writes_memory = TRUE;
 
@@ -560,6 +569,14 @@ scan_instruction(struct tgsi_shader_info *info,
          info->writes_memory = TRUE;
 
          if (dst->Register.File == TGSI_FILE_IMAGE) {
+            if (fullinst->Memory.Texture == TGSI_TEXTURE_2D_MSAA ||
+                fullinst->Memory.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA) {
+               if (dst->Register.Indirect)
+                  info->msaa_images_declared = info->images_declared;
+               else
+                  info->msaa_images_declared |= 1 << dst->Register.Index;
+            }
+
             if (dst->Register.Indirect)
                info->images_store = info->images_declared;
             else
@@ -851,7 +868,6 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
       info->file_max[i] = -1;
    for (i = 0; i < ARRAY_SIZE(info->const_file_max); i++)
       info->const_file_max[i] = -1;
-   info->properties[TGSI_PROPERTY_GS_INVOCATIONS] = 1;
    for (i = 0; i < ARRAY_SIZE(info->sampler_targets); i++)
       info->sampler_targets[i] = TGSI_TEXTURE_UNKNOWN;
 
@@ -872,6 +888,9 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
    info->processor = procType;
    info->num_tokens = tgsi_num_tokens(parse.Tokens);
 
+   if (procType == PIPE_SHADER_GEOMETRY)
+      info->properties[TGSI_PROPERTY_GS_INVOCATIONS] = 1;
+
    /**
     ** Loop over incoming program tokens/instructions
     */