diff options
author | Charmaine Lee <[email protected]> | 2016-09-01 13:40:34 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-09-17 10:24:12 -0600 |
commit | c8ef82d65a2c563c1dbafb2a252aca230ab9d1c7 (patch) | |
tree | 1afb93b20d6bdd8d63f7db06fb2a9b2cd948405a /src/gallium/drivers/svga | |
parent | 2a4b019239ea74c5573322881d663529bfd8191a (diff) |
svga: add SVGA3d_vgpu10_TransferFromBuffer()
Also add the corresponding dump function to dump the TransferFromBuffer command.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_cmd.h | 10 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_cmd_vgpu10.c | 29 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svgadump/svga_dump.c | 12 |
3 files changed, 51 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h index 47a33ec3932..db0f8908e5d 100644 --- a/src/gallium/drivers/svga/svga_cmd.h +++ b/src/gallium/drivers/svga/svga_cmd.h @@ -668,4 +668,14 @@ SVGA3D_vgpu10_BufferCopy(struct svga_winsys_context *swc, struct svga_winsys_surface *src, struct svga_winsys_surface *dst, unsigned srcx, unsigned dstx, unsigned width); + +enum pipe_error +SVGA3D_vgpu10_TransferFromBuffer(struct svga_winsys_context *swc, + struct svga_winsys_surface *src, + unsigned srcOffset, unsigned srcPitch, + unsigned srcSlicePitch, + struct svga_winsys_surface *dst, + unsigned dstSubResource, + SVGA3dBox *dstBox); + #endif /* __SVGA3D_H__ */ diff --git a/src/gallium/drivers/svga/svga_cmd_vgpu10.c b/src/gallium/drivers/svga/svga_cmd_vgpu10.c index 1f13193d233..55465f53030 100644 --- a/src/gallium/drivers/svga/svga_cmd_vgpu10.c +++ b/src/gallium/drivers/svga/svga_cmd_vgpu10.c @@ -1338,3 +1338,32 @@ SVGA3D_vgpu10_BufferCopy(struct svga_winsys_context *swc, swc->commit(swc); return PIPE_OK; } + +enum pipe_error +SVGA3D_vgpu10_TransferFromBuffer(struct svga_winsys_context *swc, + struct svga_winsys_surface *src, + unsigned srcOffset, unsigned srcPitch, + unsigned srcSlicePitch, + struct svga_winsys_surface *dst, + unsigned dstSubResource, + SVGA3dBox *dstBox) +{ + SVGA3dCmdDXTransferFromBuffer *cmd; + + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER, + sizeof(SVGA3dCmdDXTransferFromBuffer), 2); + + if (!cmd) + return PIPE_ERROR_OUT_OF_MEMORY; + + swc->surface_relocation(swc, &cmd->srcSid, NULL, src, SVGA_RELOC_READ); + swc->surface_relocation(swc, &cmd->destSid, NULL, dst, SVGA_RELOC_WRITE); + cmd->srcOffset = srcOffset; + cmd->srcPitch = srcPitch; + cmd->srcSlicePitch = srcSlicePitch; + cmd->destSubResource = dstSubResource; + cmd->destBox = *dstBox; + + swc->commit(swc); + return PIPE_OK; +} diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.c b/src/gallium/drivers/svga/svgadump/svga_dump.c index 5dc731a82e4..c8e6856f170 100644 --- a/src/gallium/drivers/svga/svgadump/svga_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_dump.c @@ -2030,6 +2030,17 @@ SVGA3D_DUMP_HEADER(GenMips) SVGA3D_DUMP_PARAMETER(shaderResourceViewId, u); } +SVGA3D_DUMP_HEADER(TransferFromBuffer) +{ + SVGA3D_DUMP_PARAMETER(srcSid, u); + SVGA3D_DUMP_PARAMETER(srcOffset, u); + SVGA3D_DUMP_PARAMETER(srcPitch, u); + SVGA3D_DUMP_PARAMETER(srcSlicePitch, u); + SVGA3D_DUMP_PARAMETER(destSid, u); + SVGA3D_DUMP_PARAMETER(destSubResource, u); + dump_SVGA3dBox(&cmd->destBox); +} + static void dump_SVGA3dCmdInvalidateGBSurface(const SVGA3dCmdInvalidateGBSurface *cmd) { @@ -2130,6 +2141,7 @@ svga_dump_command(uint32_t cmd_id, const void *data, uint32_t size) SVGA3D_DUMP_CASE_BASIC(BufferCopy, BUFFER_COPY); SVGA3D_DUMP_CASE_BASIC(BufferUpdate, BUFFER_UPDATE); SVGA3D_DUMP_CASE_BASIC(GenMips, GENMIPS); + SVGA3D_DUMP_CASE_BASIC(TransferFromBuffer, TRANSFER_FROM_BUFFER); case SVGA_3D_CMD_DX_SET_RENDERTARGETS: _debug_printf("\tSVGA_3D_CMD_DX_SET_RENDERTARGETS\n"); |