gallium: Fix texture sampling with explicit LOD in softpipe.
[mesa.git] / src / gallium / drivers / softpipe / sp_state_clip.c
index c797c0dd3b15556ea70acb15227b41d8a1310ad2..4946c776e3eb5e803763c9f33d1d2612b8855217 100644 (file)
@@ -42,24 +42,16 @@ void softpipe_set_clip_state( struct pipe_context *pipe,
 }
 
 
-
-/* Called when driver state tracker notices changes to the viewport
- * matrix:
- */
 void softpipe_set_viewport_state( struct pipe_context *pipe,
                                   const struct pipe_viewport_state *viewport )
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
-   softpipe->viewport = *viewport; /* struct copy */
-   softpipe->dirty |= SP_NEW_VIEWPORT;
-
    /* pass the viewport info to the draw module */
    draw_set_viewport_state(softpipe->draw, viewport);
 
-   /* Using tnl/ and vf/ modules is temporary while getting started.
-    * Full pipe will have vertex shader, vertex fetch of its own.
-    */
+   softpipe->viewport = *viewport; /* struct copy */
+   softpipe->dirty |= SP_NEW_VIEWPORT;
 }
 
 
@@ -68,7 +60,9 @@ void softpipe_set_scissor_state( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
-   memcpy( &softpipe->scissor, scissor, sizeof(*scissor) );
+   draw_flush(softpipe->draw);
+
+   softpipe->scissor = *scissor; /* struct copy */
    softpipe->dirty |= SP_NEW_SCISSOR;
 }
 
@@ -78,6 +72,8 @@ void softpipe_set_polygon_stipple( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
-   memcpy( &softpipe->poly_stipple, stipple, sizeof(*stipple) );
+   draw_flush(softpipe->draw);
+
+   softpipe->poly_stipple = *stipple; /* struct copy */
    softpipe->dirty |= SP_NEW_STIPPLE;
 }