svga: set rendered_to flag with texture uploaded using TransferFromBuffer command
[mesa.git] / src / gallium / drivers / svga / svga_state_vs.c
index a103dab25fe6966def02ba20b86d628f9c67cca8..aa351bd1aa540f7339efc67f4e03cc13dff9b7d2 100644 (file)
@@ -54,7 +54,7 @@ get_dummy_vertex_shader(void)
    struct ureg_dst dst;
    unsigned num_tokens;
 
-   ureg = ureg_create(TGSI_PROCESSOR_VERTEX);
+   ureg = ureg_create(PIPE_SHADER_VERTEX);
    if (!ureg)
       return NULL;
 
@@ -162,7 +162,7 @@ compile_vs(struct svga_context *svga,
 static void
 make_vs_key(struct svga_context *svga, struct svga_compile_key *key)
 {
-   const unsigned shader = PIPE_SHADER_VERTEX;
+   const enum pipe_shader_type shader = PIPE_SHADER_VERTEX;
 
    memset(key, 0, sizeof *key);
 
@@ -273,7 +273,7 @@ compile_passthrough_vs(struct svga_context *svga,
 
    num_inputs = fs->base.info.num_inputs;
 
-   ureg = ureg_create(TGSI_PROCESSOR_VERTEX);
+   ureg = ureg_create(PIPE_SHADER_VERTEX);
    if (!ureg)
       return PIPE_ERROR_OUT_OF_MEMORY;
 
@@ -346,6 +346,8 @@ emit_hw_vs(struct svga_context *svga, unsigned dirty)
    enum pipe_error ret = PIPE_OK;
    struct svga_compile_key key;
 
+   SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_EMITVS);
+
    /* If there is an active geometry shader, and it has stream output
     * defined, then we will skip the stream output from the vertex shader
     */
@@ -381,7 +383,7 @@ emit_hw_vs(struct svga_context *svga, unsigned dirty)
             ret = compile_vs(svga, vs, &key, &variant);
          }
          if (ret != PIPE_OK)
-            return ret;
+            goto done;
 
          /* insert the new variant at head of linked list */
          assert(variant);
@@ -395,7 +397,7 @@ emit_hw_vs(struct svga_context *svga, unsigned dirty)
       if (variant) {
          ret = svga_set_shader(svga, SVGA3D_SHADERTYPE_VS, variant);
          if (ret != PIPE_OK)
-            return ret;
+            goto done;
          svga->rebind.flags.vs = FALSE;
       }
 
@@ -403,7 +405,9 @@ emit_hw_vs(struct svga_context *svga, unsigned dirty)
       svga->state.hw_draw.vs = variant;
    }
 
-   return PIPE_OK;
+done:
+   SVGA_STATS_TIME_POP(svga_sws(svga));
+   return ret;
 }
 
 struct svga_tracked_state svga_hw_vs =