VK_CMD_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF
} VkCmdBufferLevel;
-typedef enum {
- VK_STATE_BIND_POINT_VIEWPORT = 0,
- VK_STATE_BIND_POINT_RASTER = 1,
- VK_STATE_BIND_POINT_COLOR_BLEND = 2,
- VK_STATE_BIND_POINT_DEPTH_STENCIL = 3,
- VK_STATE_BIND_POINT_BEGIN_RANGE = VK_STATE_BIND_POINT_VIEWPORT,
- VK_STATE_BIND_POINT_END_RANGE = VK_STATE_BIND_POINT_DEPTH_STENCIL,
- VK_STATE_BIND_POINT_NUM = (VK_STATE_BIND_POINT_DEPTH_STENCIL - VK_STATE_BIND_POINT_VIEWPORT + 1),
- VK_STATE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF
-} VkStateBindPoint;
-
typedef enum {
VK_INDEX_TYPE_UINT16 = 0,
VK_INDEX_TYPE_UINT32 = 1,
typedef VkResult (VKAPI *PFN_vkEndCommandBuffer)(VkCmdBuffer cmdBuffer);
typedef VkResult (VKAPI *PFN_vkResetCommandBuffer)(VkCmdBuffer cmdBuffer);
typedef void (VKAPI *PFN_vkCmdBindPipeline)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
-typedef void (VKAPI *PFN_vkCmdBindDynamicStateObject)(VkCmdBuffer cmdBuffer, VkStateBindPoint stateBindPoint, VkDynamicStateObject dynamicState);
+typedef void (VKAPI *PFN_vkCmdBindDynamicViewportState)(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState);
+typedef void (VKAPI *PFN_vkCmdBindDynamicRasterState)(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState);
+typedef void (VKAPI *PFN_vkCmdBindDynamicColorBlendState)(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState);
+typedef void (VKAPI *PFN_vkCmdBindDynamicDepthStencilState)(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState);
typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
typedef void (VKAPI *PFN_vkCmdBindIndexBuffer)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
typedef void (VKAPI *PFN_vkCmdBindVertexBuffers)(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline);
-void VKAPI vkCmdBindDynamicStateObject(
+void VKAPI vkCmdBindDynamicViewportState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicViewportState dynamicViewportState);
+
+void VKAPI vkCmdBindDynamicRasterState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicRasterState dynamicRasterState);
+
+void VKAPI vkCmdBindDynamicColorBlendState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicColorBlendState dynamicColorBlendState);
+
+void VKAPI vkCmdBindDynamicDepthStencilState(
VkCmdBuffer cmdBuffer,
- VkStateBindPoint stateBindPoint,
- VkDynamicStateObject dynamicState);
+ VkDynamicDepthStencilState dynamicDepthStencilState);
void VKAPI vkCmdBindDescriptorSets(
VkCmdBuffer cmdBuffer,
}
}
-void anv_CmdBindDynamicStateObject(
+void anv_CmdBindDynamicViewportState(
VkCmdBuffer cmdBuffer,
- VkStateBindPoint stateBindPoint,
- VkDynamicStateObject dynamicState)
+ VkDynamicViewportState dynamicViewportState)
{
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_dynamic_vp_state, vp_state, dynamicViewportState);
- switch (stateBindPoint) {
- case VK_STATE_BIND_POINT_VIEWPORT:
- cmd_buffer->vp_state = anv_dynamic_vp_state_from_handle(dynamicState);
- cmd_buffer->dirty |= ANV_CMD_BUFFER_VP_DIRTY;
- break;
- case VK_STATE_BIND_POINT_RASTER:
- cmd_buffer->rs_state = anv_dynamic_rs_state_from_handle(dynamicState);
- cmd_buffer->dirty |= ANV_CMD_BUFFER_RS_DIRTY;
- break;
- case VK_STATE_BIND_POINT_COLOR_BLEND:
- cmd_buffer->cb_state = anv_dynamic_cb_state_from_handle(dynamicState);
- cmd_buffer->dirty |= ANV_CMD_BUFFER_CB_DIRTY;
- break;
- case VK_STATE_BIND_POINT_DEPTH_STENCIL:
- cmd_buffer->ds_state = anv_dynamic_ds_state_from_handle(dynamicState);
- cmd_buffer->dirty |= ANV_CMD_BUFFER_DS_DIRTY;
- break;
- default:
- break;
- };
+ cmd_buffer->vp_state = vp_state;
+ cmd_buffer->dirty |= ANV_CMD_BUFFER_VP_DIRTY;
+}
+
+void anv_CmdBindDynamicRasterState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicRasterState dynamicRasterState)
+{
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_dynamic_rs_state, rs_state, dynamicRasterState);
+
+ cmd_buffer->rs_state = rs_state;
+ cmd_buffer->dirty |= ANV_CMD_BUFFER_RS_DIRTY;
+}
+
+void anv_CmdBindDynamicColorBlendState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicColorBlendState dynamicColorBlendState)
+{
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_dynamic_cb_state, cb_state, dynamicColorBlendState);
+
+ cmd_buffer->cb_state = cb_state;
+ cmd_buffer->dirty |= ANV_CMD_BUFFER_CB_DIRTY;
+}
+
+void anv_CmdBindDynamicDepthStencilState(
+ VkCmdBuffer cmdBuffer,
+ VkDynamicDepthStencilState dynamicDepthStencilState)
+{
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_dynamic_ds_state, ds_state, dynamicDepthStencilState);
+
+ cmd_buffer->ds_state = ds_state;
+ cmd_buffer->dirty |= ANV_CMD_BUFFER_DS_DIRTY;
}
static struct anv_state
/* We don't need anything here, only set if not already set. */
if (cmd_buffer->rs_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_RASTER,
+ anv_CmdBindDynamicRasterState(anv_cmd_buffer_to_handle(cmd_buffer),
device->meta_state.shared.rs_state);
if (cmd_buffer->vp_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_VIEWPORT,
- cmd_buffer->framebuffer->vp_state);
+ anv_CmdBindDynamicViewportState(anv_cmd_buffer_to_handle(cmd_buffer),
+ cmd_buffer->framebuffer->vp_state);
if (cmd_buffer->ds_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_DEPTH_STENCIL,
- device->meta_state.shared.ds_state);
+ anv_CmdBindDynamicDepthStencilState(anv_cmd_buffer_to_handle(cmd_buffer),
+ device->meta_state.shared.ds_state);
if (cmd_buffer->cb_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_COLOR_BLEND,
- device->meta_state.shared.cb_state);
+ anv_CmdBindDynamicColorBlendState(anv_cmd_buffer_to_handle(cmd_buffer),
+ device->meta_state.shared.cb_state);
anv_CmdDraw(anv_cmd_buffer_to_handle(cmd_buffer), 0, 3, 0, num_instances);
}
/* We don't need anything here, only set if not already set. */
if (cmd_buffer->rs_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_RASTER,
+ anv_CmdBindDynamicRasterState(anv_cmd_buffer_to_handle(cmd_buffer),
device->meta_state.shared.rs_state);
if (cmd_buffer->ds_state == NULL)
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_DEPTH_STENCIL,
- device->meta_state.shared.ds_state);
+ anv_CmdBindDynamicDepthStencilState(anv_cmd_buffer_to_handle(cmd_buffer),
+ device->meta_state.shared.ds_state);
saved_state->cb_state = anv_dynamic_cb_state_to_handle(cmd_buffer->cb_state);
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_COLOR_BLEND,
- device->meta_state.shared.cb_state);
+ anv_CmdBindDynamicColorBlendState(anv_cmd_buffer_to_handle(cmd_buffer),
+ device->meta_state.shared.cb_state);
}
struct blit_region {
.pAttachmentClearValues = NULL,
}, VK_RENDER_PASS_CONTENTS_INLINE);
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_VIEWPORT,
- anv_framebuffer_from_handle(fb)->vp_state);
+ anv_CmdBindDynamicViewportState(anv_cmd_buffer_to_handle(cmd_buffer),
+ anv_framebuffer_from_handle(fb)->vp_state);
anv_CmdBindDescriptorSets(anv_cmd_buffer_to_handle(cmd_buffer),
VK_PIPELINE_BIND_POINT_GRAPHICS,
const struct anv_saved_state *saved_state)
{
anv_cmd_buffer_restore(cmd_buffer, saved_state);
- anv_CmdBindDynamicStateObject(anv_cmd_buffer_to_handle(cmd_buffer),
- VK_STATE_BIND_POINT_COLOR_BLEND,
- saved_state->cb_state);
+ anv_CmdBindDynamicColorBlendState(anv_cmd_buffer_to_handle(cmd_buffer),
+ saved_state->cb_state);
}
static VkFormat