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.
diff --git a/tests/xglrenderframework.h b/tests/xglrenderframework.h
index 4bf55f1..531063d 100644
--- a/tests/xglrenderframework.h
+++ b/tests/xglrenderframework.h
@@ -55,6 +55,7 @@
XGL_DEVICE device() {return m_device->device();}
XGL_PHYSICAL_GPU gpu() {return objs[0];}
XGL_RENDER_PASS renderPass() {return m_renderPass;}
+ XGL_FRAMEBUFFER framebuffer() {return m_framebuffer;}
void InitViewport(float width, float height);
void InitViewport();
void InitRenderTarget();
@@ -72,7 +73,7 @@
XglDevice *m_device;
XGL_CMD_BUFFER m_cmdBuffer;
XGL_RENDER_PASS m_renderPass;
- XGL_FRAMEBUFFER m_frameBuffer;
+ XGL_FRAMEBUFFER m_framebuffer;
XGL_MEMORY_REF m_memRefs[5];
XGL_DYNAMIC_RS_STATE_OBJECT m_stateRaster;
XGL_DYNAMIC_CB_STATE_OBJECT m_colorBlend;
@@ -118,7 +119,7 @@
XglCommandBufferObj(XglDevice *device);
XGL_CMD_BUFFER GetBufferHandle();
XGL_RESULT BeginCommandBuffer(XGL_CMD_BUFFER_BEGIN_INFO *pInfo);
- XGL_RESULT BeginCommandBuffer(XGL_RENDER_PASS renderpass_obj);
+ XGL_RESULT BeginCommandBuffer(XGL_RENDER_PASS renderpass_obj, XGL_FRAMEBUFFER framebuffer_obj);
XGL_RESULT BeginCommandBuffer();
XGL_RESULT EndCommandBuffer();
void PipelineBarrier(XGL_PIPELINE_BARRIER *barrierPtr);
@@ -131,6 +132,8 @@
void BindVertexBuffer(XglConstantBufferObj *vertexBuffer, uint32_t offset, uint32_t binding);
void BindIndexBuffer(XglIndexBufferObj *indexBuffer, uint32_t offset);
void BindStateObject(XGL_STATE_BIND_POINT stateBindPoint, XGL_DYNAMIC_STATE_OBJECT stateObject);
+ void BeginRenderPass(XGL_RENDER_PASS renderpass, XGL_FRAMEBUFFER framebuffer);
+ void EndRenderPass(XGL_RENDER_PASS renderpass);
void Draw(uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
void DrawIndexed(uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
void QueueCommandBuffer(XGL_MEMORY_REF *memRefs, uint32_t numMemRefs);