In softpipe_set_viewport() use ordinary (struct) assignment to update softpipe->viewport.
authorBrian <brian.paul@tungstengraphics.com>
Fri, 15 Jun 2007 16:50:48 +0000 (10:50 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 15 Jun 2007 16:50:48 +0000 (10:50 -0600)
The previous memcpy() was incorrect since it only copied 4 bytes instead of 32.
With struct assignment we avoid data size errors.

src/mesa/pipe/softpipe/sp_state_clip.c

index 6e83b055fbc4f3a752282ca1e7c9ad7a9a9ec5fd..4b83f2b07ef20fc9214bd7798805a291adb94fff 100644 (file)
@@ -56,7 +56,7 @@ void softpipe_set_viewport( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
-   memcpy(&softpipe->viewport, viewport, sizeof(viewport));
+   softpipe->viewport = *viewport; /* struct copy */
 
    /* Using tnl/ and vf/ modules is temporary while getting started.
     * Full pipe will have vertex shader, vertex fetch of its own.