u_blitter: add a msaa parameter to util_blitter_clear
[mesa.git] / src / gallium / drivers / svga / svga_cmd.c
index ecf2e9d2ca0cb876186d0c0f29b775763a735518..6577c839cf0e432df474bb9b83a78f94654b9364 100644 (file)
@@ -121,6 +121,8 @@ SVGA3D_FIFOReserve(struct svga_winsys_context *swc,
 
    swc->last_command = cmd;
 
+   swc->num_commands++;
+
    return &header[1];
 }
 
@@ -271,7 +273,7 @@ SVGA3D_DestroyContext(struct svga_winsys_context *swc)  // IN
 enum pipe_error
 SVGA3D_BeginDefineSurface(struct svga_winsys_context *swc,
                           struct svga_winsys_surface *sid, // IN
-                          SVGA3dSurfaceFlags flags,    // IN
+                          SVGA3dSurface1Flags flags,    // IN
                           SVGA3dSurfaceFormat format,  // IN
                           SVGA3dSurfaceFace **faces,   // OUT
                           SVGA3dSize **mipSizes,       // OUT
@@ -1022,6 +1024,8 @@ SVGA3D_BeginDrawPrimitives(struct svga_winsys_context *swc,
 
    swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
 
+   swc->num_draw_commands++;
+
    return PIPE_OK;
 }
 
@@ -1689,7 +1693,7 @@ SVGA3D_BindGBSurface(struct svga_winsys_context *swc,
       return PIPE_ERROR_OUT_OF_MEMORY;
 
    swc->surface_relocation(swc, &cmd->sid, &cmd->mobid, surface,
-                           SVGA_RELOC_READ | SVGA_RELOC_INTERNAL);
+                           SVGA_RELOC_READ);
 
    swc->commit(swc);
 
@@ -1870,6 +1874,24 @@ SVGA3D_InvalidateGBImagePartial(struct svga_winsys_context *swc,
    return PIPE_OK;
 }
 
+enum pipe_error
+SVGA3D_InvalidateGBSurface(struct svga_winsys_context *swc,
+                           struct svga_winsys_surface *surface)
+{
+   SVGA3dCmdInvalidateGBSurface *cmd =
+      SVGA3D_FIFOReserve(swc,
+                         SVGA_3D_CMD_INVALIDATE_GB_SURFACE,
+                         sizeof *cmd,
+                         1);  /* one relocation */
+   if (!cmd)
+      return PIPE_ERROR_OUT_OF_MEMORY;
+
+   swc->surface_relocation(swc, &cmd->sid, NULL, surface,
+                           SVGA_RELOC_READ | SVGA_RELOC_INTERNAL);
+   swc->commit(swc);
+
+   return PIPE_OK;
+}
 
 enum pipe_error
 SVGA3D_SetGBShaderConstsInline(struct svga_winsys_context *swc,