svga: use svga_shader_too_large() in compile_vs()
[mesa.git] / src / gallium / drivers / svga / svga_state.c
index 1c21d3acfe3b5c53c82350c3b383a3d0d124925e..b0bc867f63a08da8318d6ab759b1b3cad68a509d 100644 (file)
@@ -63,7 +63,6 @@ static const struct svga_tracked_state *hw_clear_state[] =
  */
 static const struct svga_tracked_state *hw_draw_state[] =
 {
-   &svga_hw_update_zero_stride,
    &svga_hw_fs,
    &svga_hw_vs,
    &svga_hw_rss,
@@ -71,8 +70,8 @@ static const struct svga_tracked_state *hw_draw_state[] =
    &svga_hw_tss_binding,
    &svga_hw_clip_planes,
    &svga_hw_vdecl,
-   &svga_hw_fs_parameters,
-   &svga_hw_vs_parameters,
+   &svga_hw_fs_constants,
+   &svga_hw_vs_constants,
    NULL
 };
 
@@ -119,16 +118,17 @@ static void xor_states( unsigned *result,
 
 
 
-static int update_state( struct svga_context *svga,
-                         const struct svga_tracked_state *atoms[],
-                         unsigned *state )
+static enum pipe_error
+update_state(struct svga_context *svga,
+             const struct svga_tracked_state *atoms[],
+             unsigned *state)
 {
    boolean debug = TRUE;
-   enum pipe_error ret = 0;
+   enum pipe_error ret = PIPE_OK;
    unsigned i;
 
    ret = svga_hwtnl_flush( svga->hwtnl );
-   if (ret != 0)
+   if (ret != PIPE_OK)
       return ret;
 
    if (debug) {
@@ -151,7 +151,7 @@ static int update_state( struct svga_context *svga,
            if (0)
                debug_printf("update: %s\n", atoms[i]->name);
            ret = atoms[i]->update( svga, *state );
-            if (ret != 0)
+            if (ret != PIPE_OK)
                return ret;
         }
 
@@ -174,23 +174,23 @@ static int update_state( struct svga_context *svga,
       for (i = 0; atoms[i] != NULL; i++) {      
         if (check_state(*state, atoms[i]->dirty)) {
            ret = atoms[i]->update( svga, *state );
-            if (ret != 0)
+            if (ret != PIPE_OK)
                return ret;
          }
       }
    }
 
-   return 0;
+   return PIPE_OK;
 }
 
 
 
-int svga_update_state( struct svga_context *svga,
-                       unsigned max_level )
+enum pipe_error
+svga_update_state(struct svga_context *svga, unsigned max_level)
 {
    struct svga_screen *screen = svga_screen(svga->pipe.screen);
-   int ret = 0;
-   int i;
+   enum pipe_error ret = PIPE_OK;
+   unsigned i;
 
    /* Check for updates to bound textures.  This can't be done in an
     * atom as there is no flag which could provoke this test, and we
@@ -208,7 +208,7 @@ int svga_update_state( struct svga_context *svga,
          ret = update_state( svga, 
                              state_levels[i], 
                              &svga->dirty );
-         if (ret != 0)
+         if (ret != PIPE_OK)
             return ret;
 
          svga->state.dirty[i] = 0;
@@ -219,7 +219,7 @@ int svga_update_state( struct svga_context *svga,
       svga->state.dirty[i] |= svga->dirty;
 
    svga->dirty = 0;
-   return 0;
+   return PIPE_OK;
 }
 
 
@@ -228,7 +228,7 @@ int svga_update_state( struct svga_context *svga,
 void svga_update_state_retry( struct svga_context *svga,
                               unsigned max_level )
 {
-   int ret;
+   enum pipe_error ret;
 
    ret = svga_update_state( svga, max_level );
 
@@ -237,7 +237,7 @@ void svga_update_state_retry( struct svga_context *svga,
       ret = svga_update_state( svga, max_level );
    }
 
-   assert( ret == 0 );
+   assert( ret == PIPE_OK );
 }
 
 
@@ -261,7 +261,7 @@ enum pipe_error svga_emit_initial_state( struct svga_context *svga )
    enum pipe_error ret;
 
    ret = SVGA3D_BeginSetRenderState( svga->swc, &rs, COUNT );
-   if (ret)
+   if (ret != PIPE_OK)
       return ret;
 
    /* Always use D3D style coordinate space as this is the only one
@@ -273,6 +273,5 @@ enum pipe_error svga_emit_initial_state( struct svga_context *svga )
    assert( COUNT == count );
    SVGA_FIFOCommitAll( svga->swc );
 
-   return 0;
-
+   return PIPE_OK;
 }