aboutsummaryrefslogtreecommitdiff
path: root/layers/draw_state.cpp
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-03 15:25:24 -0600
committerChia-I Wu <olv@lunarg.com>2015-04-16 17:33:25 +0800
commit53968d8ee5baaf90d2e8922c452f663c3df0c363 (patch)
treea02c5aae88d85c9cf89f4d282f04463f64db2c7c /layers/draw_state.cpp
parent4953b9a7291ac1c14c9926b751085552ac8a16b4 (diff)
downloadusermoji-53968d8ee5baaf90d2e8922c452f663c3df0c363.tar.xz
xgl: Proposal to remove XGL_FRAMEBUFFER
bug # 13323 alpha header: r29635 Don't actually remove XGL_FRAMEBUFFER but do change how RenderPass and Framebuffer are connected. Some comments from the bug: - Created a new structure XGL_RENDER_PASS_BEGIN that contains both the XGL_RENDER_PASS and XGL_FRAMEBUFFER. - XGL_CMD_BUFFER_GRAPHICS_BEGIN_INFO and xglCmdBeginRenderPass both use XGL_RENDER_PASS_BEGIN to ensure they stay consistent. - Renamed the member in XGL_CMD_BUFFER_GRAPHICS_BEGIN_INFO to renderPassContinue with a comment to clarify that this is only needed when a render pass is split across two command buffer. The last has the biggest impact on this patch. The tests now directly call CmdBeginRenderPass and CmdEndRenderPass in the command buffer rather than set the BEGIN_INFO to a render pass and have the driver implicitly do BeginRenderPass and EndRenderPass. It would probably still work, but didn't seem to match the intent with this change in the header file.
Diffstat (limited to 'layers/draw_state.cpp')
-rw-r--r--layers/draw_state.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 3687c06c..c37930cf 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -509,10 +509,10 @@ static void validatePipelineState(const GLOBAL_CB_NODE* pCB, const XGL_PIPELINE_
uint32_t psoNumSamples = getNumSamples(pipeline);
if (pCB->activeRenderPass) {
XGL_RENDER_PASS_CREATE_INFO* pRPCI = renderPassMap[pCB->activeRenderPass];
- XGL_FRAMEBUFFER_CREATE_INFO* pFBCI = frameBufferMap[pRPCI->framebuffer];
+ XGL_FRAMEBUFFER_CREATE_INFO* pFBCI = frameBufferMap[pCB->framebuffer];
if (psoNumSamples != pFBCI->sampleCount) {
char str[1024];
- sprintf(str, "Num samples mismatche! Binding PSO (%p) with %u samples while current RenderPass (%p) uses FB (%p) with %u samples!", (void*)pipeline, psoNumSamples, (void*)pCB->activeRenderPass, (void*)pRPCI->framebuffer, pFBCI->sampleCount);
+ sprintf(str, "Num samples mismatche! Binding PSO (%p) with %u samples while current RenderPass (%p) uses FB (%p) with %u samples!", (void*)pipeline, psoNumSamples, (void*)pCB->activeRenderPass, (void*)pCB->framebuffer, pFBCI->sampleCount);
layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, pipeline, 0, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS", str);
}
} else {
@@ -1894,7 +1894,7 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer(XGL_CMD_BUFFER cmdBuffe
if (pBeginInfo->pNext) {
XGL_CMD_BUFFER_GRAPHICS_BEGIN_INFO* pCbGfxBI = (XGL_CMD_BUFFER_GRAPHICS_BEGIN_INFO*)pBeginInfo->pNext;
if (XGL_STRUCTURE_TYPE_CMD_BUFFER_GRAPHICS_BEGIN_INFO == pCbGfxBI->sType) {
- pCB->activeRenderPass = pCbGfxBI->renderPass;
+ pCB->activeRenderPass = pCbGfxBI->renderPassContinue.renderPass;
}
}
}
@@ -2526,21 +2526,21 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateRenderPass(XGL_DEVICE device, const
return result;
}
-XGL_LAYER_EXPORT void XGLAPI xglCmdBeginRenderPass(XGL_CMD_BUFFER cmdBuffer, XGL_RENDER_PASS renderPass)
+XGL_LAYER_EXPORT void XGLAPI xglCmdBeginRenderPass(XGL_CMD_BUFFER cmdBuffer, const XGL_RENDER_PASS_BEGIN *pRenderPassBegin)
{
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
updateCBTracking(cmdBuffer);
addCmd(pCB, CMD_BEGINRENDERPASS);
- pCB->activeRenderPass = renderPass;
+ pCB->activeRenderPass = pRenderPassBegin->renderPass;
+ pCB->framebuffer = pRenderPassBegin->framebuffer;
validatePipelineState(pCB, XGL_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
- }
- else {
+ } else {
char str[1024];
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.CmdBeginRenderPass(cmdBuffer, renderPass);
+ nextTable.CmdBeginRenderPass(cmdBuffer, pRenderPassBegin);
}
XGL_LAYER_EXPORT void XGLAPI xglCmdEndRenderPass(XGL_CMD_BUFFER cmdBuffer, XGL_RENDER_PASS renderPass)