mesa/st: only compare the one scissor
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 6 Mar 2014 03:34:27 +0000 (22:34 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 6 Mar 2014 03:51:58 +0000 (22:51 -0500)
sizeof(scissor) returns the size of the full array rather than a single
element. Fix it to consider just the one element.

Fixes: 0705fa35 ("st/mesa: add support for GL_ARB_viewport_array (v0.2)")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_atom_scissor.c

index a19ade1fafed32710d0b5aff3c3610c412acd2e1..b72030944066d4db6ad4e676cdc9fc1e8cb56f47 100644 (file)
@@ -85,7 +85,7 @@ update_scissor( struct st_context *st )
          scissor[i].maxy = maxy;
       }
 
-      if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor)) != 0) {
+      if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor[0])) != 0) {
          /* state has changed */
          st->state.scissor[i] = scissor[i];  /* struct copy */
          changed = true;