gallium: add PIPE_CAP_TGSI CLOCK
[mesa.git] / src / gallium / drivers / svga / svga_pipe_clear.c
index 803afc60ff8098d0bab2e5342776ef4d95541c95..56db713cfc95c419eabc30ba506733348e76496a 100644 (file)
@@ -323,8 +323,10 @@ svga_clear_texture(struct pipe_context *pipe,
       struct pipe_surface *dsv =
          svga_validate_surface_view(svga, svga_surface_dst);
 
-      if (!dsv)
+      if (!dsv) {
+         pipe_surface_reference(&surface, NULL);
          return;
+      }
 
       if (box->x == 0 && box->y == 0 && box->width == surface->width &&
           box->height == surface->height) {
@@ -382,8 +384,10 @@ svga_clear_texture(struct pipe_context *pipe,
       struct pipe_surface *rtv =
          svga_validate_surface_view(svga, svga_surface_dst);
 
-      if (!rtv)
+      if (!rtv) {
+         pipe_surface_reference(&surface, NULL);
          return;
+      }
 
       if (box->x == 0 && box->y == 0 && box->width == surface->width &&
           box->height == surface->height) {
@@ -449,6 +453,7 @@ svga_clear_texture(struct pipe_context *pipe,
          }
       }
    }
+   pipe_surface_reference(&surface, NULL);
 }
 
 /**