llvmpipe: Silence Coverity incorrect sizeof expression defect.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_state_surface.c
index 7d86c5750c5e7e22d4e0b303235a8947bcd17631..375ceb2b942177aadd637f81bd25be9fb18d1de9 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
+#include "util/u_framebuffer.h"
 #include "util/u_surface.h"
 #include "lp_context.h"
 #include "lp_scene.h"
@@ -52,13 +53,17 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
 
    boolean changed = !util_framebuffer_state_equal(&lp->framebuffer, fb);
 
-   assert(fb->width <= MAXWIDTH);
-   assert(fb->height <= MAXHEIGHT);
+   assert(fb->width <= LP_MAX_WIDTH);
+   assert(fb->height <= LP_MAX_HEIGHT);
 
    if (changed) {
 
       util_copy_framebuffer_state(&lp->framebuffer, fb);
 
+      if (LP_PERF & PERF_NO_DEPTH) {
+        pipe_surface_reference(&lp->framebuffer.zsbuf, NULL);
+      }
+
       /* Tell draw module how deep the Z/depth buffer is */
       if (lp->framebuffer.zsbuf) {
          int depth_bits;
@@ -72,6 +77,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
          else {
             mrd = 0.00002;
          }
+         lp->mrd = mrd;
          draw_set_mrd(lp->draw, mrd);
       }