diff options
author | Charmaine Lee <[email protected]> | 2017-10-16 11:31:15 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | 2d39e6d0c82ce311b6289204e8b2337569b3ef84 (patch) | |
tree | 5b3927aa1369706fc9978ba56035654ef9847662 /src | |
parent | 9a24b08a49ae4bed4d45600b5a7a3f778f2cf32d (diff) |
svga: add a helper function to send ResolveCopy command
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/svga/svga_cmd.h | 13 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_cmd_vgpu10.c | 33 |
2 files changed, 40 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h index b191ed5d307..f6cb4fc27c1 100644 --- a/src/gallium/drivers/svga/svga_cmd.h +++ b/src/gallium/drivers/svga/svga_cmd.h @@ -685,9 +685,16 @@ SVGA3D_vgpu10_TransferFromBuffer(struct svga_winsys_context *swc, /*Cap2 commands*/ enum pipe_error SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc, - struct svga_winsys_surface *src, - unsigned level, unsigned face, - const SVGA3dCopyBox *box); + struct svga_winsys_surface *src, + unsigned level, unsigned face, + const SVGA3dCopyBox *box); +enum pipe_error +SVGA3D_vgpu10_ResolveCopy(struct svga_winsys_context *swc, + unsigned dstSubResource, + struct svga_winsys_surface *dst, + unsigned srcSubResource, + struct svga_winsys_surface *src, + const SVGA3dSurfaceFormat copyFormat); #endif /* __SVGA3D_H__ */ diff --git a/src/gallium/drivers/svga/svga_cmd_vgpu10.c b/src/gallium/drivers/svga/svga_cmd_vgpu10.c index e0e47e1c26e..c1e471e0f49 100644 --- a/src/gallium/drivers/svga/svga_cmd_vgpu10.c +++ b/src/gallium/drivers/svga/svga_cmd_vgpu10.c @@ -1375,9 +1375,9 @@ SVGA3D_vgpu10_TransferFromBuffer(struct svga_winsys_context *swc, enum pipe_error SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc, - struct svga_winsys_surface *surface, - unsigned level, unsigned face, - const SVGA3dCopyBox *box) + struct svga_winsys_surface *surface, + unsigned level, unsigned face, + const SVGA3dCopyBox *box) { SVGA3dCmdIntraSurfaceCopy *cmd = SVGA3D_FIFOReserve(swc, @@ -1396,3 +1396,30 @@ SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc, return PIPE_OK; } + +enum pipe_error +SVGA3D_vgpu10_ResolveCopy(struct svga_winsys_context *swc, + unsigned dstSubResource, + struct svga_winsys_surface *dst, + unsigned srcSubResource, + struct svga_winsys_surface *src, + const SVGA3dSurfaceFormat copyFormat) +{ + SVGA3dCmdDXResolveCopy *cmd = + SVGA3D_FIFOReserve(swc, + SVGA_3D_CMD_DX_RESOLVE_COPY, + sizeof(SVGA3dCmdDXResolveCopy), + 2); /* two relocations */ + if (!cmd) + return PIPE_ERROR_OUT_OF_MEMORY; + + cmd->dstSubResource = dstSubResource; + swc->surface_relocation(swc, &cmd->dstSid, NULL, dst, SVGA_RELOC_WRITE); + cmd->srcSubResource = srcSubResource; + swc->surface_relocation(swc, &cmd->srcSid, NULL, src, SVGA_RELOC_READ); + cmd->copyFormat = copyFormat; + + swc->commit(swc); + + return PIPE_OK; +} |