svga: add SVGA_3D_CMD_INVALIDATE_GB_SURFACE support
authorCharmaine Lee <charmainel@vmware.com>
Wed, 2 Mar 2016 17:31:58 +0000 (09:31 -0800)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2016 20:29:22 +0000 (14:29 -0600)
This command will be used in a subsequent patch to invalidate a surface.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_cmd.c
src/gallium/drivers/svga/svga_cmd.h

index ecf2e9d2ca0cb876186d0c0f29b775763a735518..7b78cb735472ccf94a2ceb38c4f12980233390ad 100644 (file)
@@ -1870,6 +1870,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,
index db0f8908e5d136a67094ca8464346020a8e2acf8..cd2cb6509ea02f0977ce6ae30cf0d7b0b6ff0a83 100644 (file)
@@ -299,6 +299,10 @@ SVGA3D_InvalidateGBImagePartial(struct svga_winsys_context *swc,
                                 const SVGA3dBox *box,
                                 bool invertBox);
 
+enum pipe_error
+SVGA3D_InvalidateGBSurface(struct svga_winsys_context *swc,
+                           struct svga_winsys_surface *surface);
+
 
 enum pipe_error
 SVGA3D_SetGBShaderConstsInline(struct svga_winsys_context *swc,