r600: don't enable depth test if there is no depth buffer
[mesa.git] / src / gallium / winsys / drm / vmware / core / vmw_surface.c
index 9ec4bf927261bd8c0e9f096b0fd451ffdc9fc4e2..5f1b9ad577093dd49099fc6d02f46fb0728970a2 100644 (file)
@@ -37,15 +37,17 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
 {
    struct pipe_reference *src_ref;
    struct pipe_reference *dst_ref;
-   struct vmw_svga_winsys_surface *dst = *pdst;
-   
-   if(*pdst == src || pdst == NULL)
+   struct vmw_svga_winsys_surface *dst;
+
+   if(pdst == NULL || *pdst == src)
       return;
-   
+
+   dst = *pdst;
+
    src_ref = src ? &src->refcnt : NULL;
    dst_ref = dst ? &dst->refcnt : NULL;
 
-   if (pipe_reference(&dst_ref, src_ref)) {
+   if (pipe_reference(dst_ref, src_ref)) {
       vmw_ioctl_surface_destroy(dst->screen, dst->sid);
 #ifdef DEBUG
       /* to detect dangling pointers */