From: Courtney Goeltzenleuchter Date: Mon, 13 Apr 2015 22:16:56 +0000 (-0600) Subject: FIXUP: Add IMAGE_LAYOUT X-Git-Tag: upstream/1.1.92~5875 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d2e34cfee1fbe06756316b7fff631c199c1b241;p=platform%2Fupstream%2FVulkan-Tools.git FIXUP: Add IMAGE_LAYOUT commit 6f5bca9057be71e818982c4cece0cb5ed1743b0f Author: Courtney Goeltzenleuchter Date: Wed Mar 25 11:25:10 2015 -0600 xgl: Add IMAGE_LAYOUT to Cmd*Image* calls This is part 2 of bug #12904. (2) Blit operations need to know what layout images are in. How do they figure that out? - Added new parameter(s) specifying the image layout(s) to the following functions: xglCmdCopyImage xglCmdCopyBufferToImage xglCmdCopyImageToBuffer xglCmdClearColorImage xglCmdClearColorImageRaw xglCmdClearDepthStencilImage xglCmdResolveImage --- diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 32a4fbc..e329dd7 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -2184,7 +2184,11 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdCopyBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_BUFF nextTable.CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); } -XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, uint32_t regionCount, const XGL_IMAGE_COPY* pRegions) +XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImage( + XGL_CMD_BUFFER cmdBuffer, + XGL_IMAGE srcImage, XGL_IMAGE_LAYOUT srcImageLayout, + XGL_IMAGE destImage, XGL_IMAGE_LAYOUT destImageLayout, + uint32_t regionCount, const XGL_IMAGE_COPY* pRegions) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2196,7 +2200,7 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdCopyImage(cmdBuffer, srcImage, destImage, regionCount, pRegions); + nextTable.CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); } XGL_LAYER_EXPORT void XGLAPI xglCmdBlitImage(XGL_CMD_BUFFER cmdBuffer, @@ -2217,7 +2221,11 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdBlitImage(XGL_CMD_BUFFER cmdBuffer, nextTable.CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); } -XGL_LAYER_EXPORT void XGLAPI xglCmdCopyBufferToImage(XGL_CMD_BUFFER cmdBuffer, XGL_BUFFER srcBuffer, XGL_IMAGE destImage, uint32_t regionCount, const XGL_BUFFER_IMAGE_COPY* pRegions) +XGL_LAYER_EXPORT void XGLAPI xglCmdCopyBufferToImage( + XGL_CMD_BUFFER cmdBuffer, + XGL_BUFFER srcBuffer, + XGL_IMAGE destImage, XGL_IMAGE_LAYOUT destImageLayout, + uint32_t regionCount, const XGL_BUFFER_IMAGE_COPY* pRegions) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2229,10 +2237,14 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdCopyBufferToImage(XGL_CMD_BUFFER cmdBuffer, X sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, regionCount, pRegions); + nextTable.CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); } -XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImageToBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_BUFFER destBuffer, uint32_t regionCount, const XGL_BUFFER_IMAGE_COPY* pRegions) +XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImageToBuffer( + XGL_CMD_BUFFER cmdBuffer, + XGL_IMAGE srcImage, XGL_IMAGE_LAYOUT srcImageLayout, + XGL_BUFFER destBuffer, + uint32_t regionCount, const XGL_BUFFER_IMAGE_COPY* pRegions) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2244,7 +2256,7 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdCopyImageToBuffer(XGL_CMD_BUFFER cmdBuffer, X sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdCopyImageToBuffer(cmdBuffer, srcImage, destBuffer, regionCount, pRegions); + nextTable.CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); } XGL_LAYER_EXPORT void XGLAPI xglCmdCloneImageData(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_LAYOUT srcImageLayout, XGL_IMAGE destImage, XGL_IMAGE_LAYOUT destImageLayout) @@ -2292,7 +2304,11 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdFillBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_BUFF nextTable.CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); } -XGL_LAYER_EXPORT void XGLAPI xglCmdClearColorImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, XGL_CLEAR_COLOR color, uint32_t rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) +XGL_LAYER_EXPORT void XGLAPI xglCmdClearColorImage( + XGL_CMD_BUFFER cmdBuffer, + XGL_IMAGE image, XGL_IMAGE_LAYOUT imageLayout, + XGL_CLEAR_COLOR color, + uint32_t rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2304,10 +2320,14 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdClearColorImage(XGL_CMD_BUFFER cmdBuffer, XGL sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdClearColorImage(cmdBuffer, image, color, rangeCount, pRanges); + nextTable.CmdClearColorImage(cmdBuffer, image, imageLayout, color, rangeCount, pRanges); } -XGL_LAYER_EXPORT void XGLAPI xglCmdClearDepthStencil(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, float depth, uint32_t stencil, uint32_t rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) +XGL_LAYER_EXPORT void XGLAPI xglCmdClearDepthStencil( + XGL_CMD_BUFFER cmdBuffer, + XGL_IMAGE image, XGL_IMAGE_LAYOUT imageLayout, + float depth, uint32_t stencil, + uint32_t rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2319,10 +2339,14 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdClearDepthStencil(XGL_CMD_BUFFER cmdBuffer, X sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdClearDepthStencil(cmdBuffer, image, depth, stencil, rangeCount, pRanges); + nextTable.CmdClearDepthStencil(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges); } -XGL_LAYER_EXPORT void XGLAPI xglCmdResolveImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, uint32_t rectCount, const XGL_IMAGE_RESOLVE* pRects) +XGL_LAYER_EXPORT void XGLAPI xglCmdResolveImage( + XGL_CMD_BUFFER cmdBuffer, + XGL_IMAGE srcImage, XGL_IMAGE_LAYOUT srcImageLayout, + XGL_IMAGE destImage, XGL_IMAGE_LAYOUT destImageLayout, + uint32_t rectCount, const XGL_IMAGE_RESOLVE* pRects) { GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer); if (pCB) { @@ -2334,7 +2358,7 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdResolveImage(XGL_CMD_BUFFER cmdBuffer, XGL_IM sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer); layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS", str); } - nextTable.CmdResolveImage(cmdBuffer, srcImage, destImage, rectCount, pRects); + nextTable.CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, rectCount, pRects); } XGL_LAYER_EXPORT void XGLAPI xglCmdSetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event, XGL_PIPE_EVENT pipeEvent)