diff options
| author | Chia-I Wu <olv@lunarg.com> | 2015-03-28 15:23:55 +0800 |
|---|---|---|
| committer | Chia-I Wu <olv@lunarg.com> | 2015-04-16 17:33:27 +0800 |
| commit | a28bdde711fae9c44b80f99d1701fc55dd0e0b56 (patch) | |
| tree | e5717301a6661d06f4ecea8335224506f4dfebc3 | |
| parent | 91e8e214e883b5c5d4956cb7e524af9f18a6af99 (diff) | |
| download | usermoji-a28bdde711fae9c44b80f99d1701fc55dd0e0b56.tar.xz | |
binding: update for xglCmdBindDescriptorSets()
This update makes it possible to bind multiple descriptor sets to the command
buffer. We introduced intel_cmd_dset_data to hold the descriptor set offsets
in the global descriptor region as well as their dynamic offsets. We also
changed the descriptor reading routines from
intel_desc_set_read_surface()
intel_desc_set_read_sampler()
to
intel_desc_region_read_surface()
intel_desc_region_read_sampler()
v2: fix a potential crash when allocation of dynamic_desc_indices fails
| -rw-r--r-- | demos/cube.c | 4 | ||||
| -rw-r--r-- | demos/tri.c | 4 | ||||
| -rw-r--r-- | icd/nulldrv/nulldrv.c | 7 | ||||
| -rw-r--r-- | include/xgl.h | 9 | ||||
| -rw-r--r-- | include/xglLayer.h | 2 | ||||
| -rw-r--r-- | xgl.py | 7 |
6 files changed, 21 insertions, 12 deletions
diff --git a/demos/cube.c b/demos/cube.c index 4a5c4a45..319ef05e 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -441,8 +441,8 @@ static void demo_draw_build_cmd(struct demo *demo, XGL_CMD_BUFFER cmd_buf) xglCmdBindPipeline(cmd_buf, XGL_PIPELINE_BIND_POINT_GRAPHICS, demo->pipeline); - xglCmdBindDescriptorSet(cmd_buf, XGL_PIPELINE_BIND_POINT_GRAPHICS, - demo->desc_set, NULL); + xglCmdBindDescriptorSets(cmd_buf, XGL_PIPELINE_BIND_POINT_GRAPHICS, + demo->desc_layout_chain, 0, 1, &demo->desc_set, NULL); xglCmdBindDynamicStateObject(cmd_buf, XGL_STATE_BIND_VIEWPORT, demo->viewport); xglCmdBindDynamicStateObject(cmd_buf, XGL_STATE_BIND_RASTER, demo->raster); diff --git a/demos/tri.c b/demos/tri.c index 2fbe6b9f..2818e10c 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -269,8 +269,8 @@ static void demo_draw_build_cmd(struct demo *demo) xglCmdBindPipeline(demo->cmd, XGL_PIPELINE_BIND_POINT_GRAPHICS, demo->pipeline); - xglCmdBindDescriptorSet(demo->cmd, XGL_PIPELINE_BIND_POINT_GRAPHICS, - demo->desc_set, NULL); + xglCmdBindDescriptorSets(demo->cmd, XGL_PIPELINE_BIND_POINT_GRAPHICS, + demo->desc_layout_chain, 0, 1, & demo->desc_set, NULL); xglCmdBindDynamicStateObject(demo->cmd, XGL_STATE_BIND_VIEWPORT, demo->viewport); xglCmdBindDynamicStateObject(demo->cmd, XGL_STATE_BIND_RASTER, demo->raster); diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c index c2ff7330..49439222 100644 --- a/icd/nulldrv/nulldrv.c +++ b/icd/nulldrv/nulldrv.c @@ -1098,10 +1098,13 @@ ICD_EXPORT void XGLAPI xglCmdBindDynamicStateObject( NULLDRV_LOG_FUNC; } -ICD_EXPORT void XGLAPI xglCmdBindDescriptorSet( +ICD_EXPORT void XGLAPI xglCmdBindDescriptorSets( XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, - XGL_DESCRIPTOR_SET descriptorSet, + XGL_DESCRIPTOR_SET_LAYOUT_CHAIN layoutChain, + uint32_t layoutChainSlot, + uint32_t count, + const XGL_DESCRIPTOR_SET* pDescriptorSets, const uint32_t* pUserData) { NULLDRV_LOG_FUNC; diff --git a/include/xgl.h b/include/xgl.h index f90b8a7e..bae9c3fb 100644 --- a/include/xgl.h +++ b/include/xgl.h @@ -2336,7 +2336,7 @@ typedef XGL_RESULT (XGLAPI *xglEndCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); typedef XGL_RESULT (XGLAPI *xglResetCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); typedef void (XGLAPI *xglCmdBindPipelineType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline); typedef void (XGLAPI *xglCmdBindDynamicStateObjectType)(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_DYNAMIC_STATE_OBJECT state); -typedef void (XGLAPI *xglCmdBindDescriptorSetType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_DESCRIPTOR_SET descriptorSet, const uint32_t* pUserData); +typedef void (XGLAPI *xglCmdBindDescriptorSetsType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_DESCRIPTOR_SET_LAYOUT_CHAIN layoutChain, uint32_t layoutChainSlot, uint32_t count, const XGL_DESCRIPTOR_SET* pDescriptorSets, const uint32_t* pUserData); typedef void (XGLAPI *xglCmdBindIndexBufferType)(XGL_CMD_BUFFER cmdBuffer, XGL_BUFFER buffer, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType); typedef void (XGLAPI *xglCmdBindVertexBufferType)(XGL_CMD_BUFFER cmdBuffer, XGL_BUFFER buffer, XGL_GPU_SIZE offset, uint32_t binding); typedef void (XGLAPI *xglCmdDrawType)(XGL_CMD_BUFFER cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount); @@ -2807,10 +2807,13 @@ void XGLAPI xglCmdBindDynamicStateObject( XGL_STATE_BIND_POINT stateBindPoint, XGL_DYNAMIC_STATE_OBJECT dynamicState); -void XGLAPI xglCmdBindDescriptorSet( +void XGLAPI xglCmdBindDescriptorSets( XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, - XGL_DESCRIPTOR_SET descriptorSet, + XGL_DESCRIPTOR_SET_LAYOUT_CHAIN layoutChain, + uint32_t layoutChainSlot, + uint32_t count, + const XGL_DESCRIPTOR_SET* pDescriptorSets, const uint32_t* pUserData); void XGLAPI xglCmdBindIndexBuffer( diff --git a/include/xglLayer.h b/include/xglLayer.h index 98e52537..6111bcb9 100644 --- a/include/xglLayer.h +++ b/include/xglLayer.h @@ -104,7 +104,7 @@ typedef struct _XGL_LAYER_DISPATCH_TABLE xglResetCommandBufferType ResetCommandBuffer; xglCmdBindPipelineType CmdBindPipeline; xglCmdBindDynamicStateObjectType CmdBindDynamicStateObject; - xglCmdBindDescriptorSetType CmdBindDescriptorSet; + xglCmdBindDescriptorSetsType CmdBindDescriptorSets; xglCmdBindVertexBufferType CmdBindVertexBuffer; xglCmdBindIndexBufferType CmdBindIndexBuffer; xglCmdDrawType CmdDraw; @@ -602,10 +602,13 @@ core = Extension( Param("XGL_STATE_BIND_POINT", "stateBindPoint"), Param("XGL_DYNAMIC_STATE_OBJECT", "state")]), - Proto("void", "CmdBindDescriptorSet", + Proto("void", "CmdBindDescriptorSets", [Param("XGL_CMD_BUFFER", "cmdBuffer"), Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), - Param("XGL_DESCRIPTOR_SET", "descriptorSet"), + Param("XGL_DESCRIPTOR_SET_LAYOUT_CHAIN", "layoutChain"), + Param("uint32_t", "layoutChainSlot"), + Param("uint32_t", "count"), + Param("const XGL_DESCRIPTOR_SET*", "pDescriptorSets"), Param("const uint32_t*", "pUserData")]), Proto("void", "CmdBindVertexBuffer", |
