vkr: Enable VK_EXT_extended_dynamic_state

Dispatches for the following commands are implemented:

- vkCmdBindVertexBuffers2
- vkCmdSetCullMode
- vkCmdSetDepthBoundsTestEnable
- vkCmdSetDepthCompareOp
- vkCmdSetDepthTestEnable
- vkCmdSetDepthWriteEnable
- vkCmdSetFrontFace
- vkCmdSetPrimitiveTopology
- vkCmdSetScissorWithCount
- vkCmdSetStencilOp
- vkCmdSetStencilTestEnable
- vkCmdSetViewportWithCount

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Omar Akkila 3 years ago
parent cc2c53a183
commit ddf7da25bf
  1. 141
      src/venus/vkr_command_buffer.c
  2. 2
      src/venus/vkr_common.c
  3. 60
      src/venus/vkr_device.c
  4. 14
      src/venus/vkr_device.h

@ -652,6 +652,133 @@ vkr_dispatch_vkCmdDrawIndirectByteCountEXT(
args->counterBufferOffset, args->counterOffset, args->vertexStride);
}
static void
vkr_dispatch_vkCmdBindVertexBuffers2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBindVertexBuffers2 *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBindVertexBuffers2_args_handle(args);
cmd->device->cmd_bind_vertex_buffers_2(args->commandBuffer, args->firstBinding,
args->bindingCount, args->pBuffers,
args->pOffsets, args->pSizes, args->pStrides);
}
static void
vkr_dispatch_vkCmdSetCullMode(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetCullMode *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetCullMode_args_handle(args);
cmd->device->cmd_set_cull_mode(args->commandBuffer, args->cullMode);
}
static void
vkr_dispatch_vkCmdSetDepthBoundsTestEnable(
UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetDepthBoundsTestEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetDepthBoundsTestEnable_args_handle(args);
cmd->device->cmd_set_depth_bounds_test_enable(args->commandBuffer,
args->depthBoundsTestEnable);
}
static void
vkr_dispatch_vkCmdSetDepthCompareOp(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetDepthCompareOp *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetDepthCompareOp_args_handle(args);
cmd->device->cmd_set_depth_compare_op(args->commandBuffer, args->depthCompareOp);
}
static void
vkr_dispatch_vkCmdSetDepthTestEnable(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetDepthTestEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetDepthTestEnable_args_handle(args);
cmd->device->cmd_set_depth_test_enable(args->commandBuffer, args->depthTestEnable);
}
static void
vkr_dispatch_vkCmdSetDepthWriteEnable(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetDepthWriteEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetDepthWriteEnable_args_handle(args);
cmd->device->cmd_set_depth_write_enable(args->commandBuffer, args->depthWriteEnable);
}
static void
vkr_dispatch_vkCmdSetFrontFace(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetFrontFace *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetFrontFace_args_handle(args);
cmd->device->cmd_set_front_face(args->commandBuffer, args->frontFace);
}
static void
vkr_dispatch_vkCmdSetPrimitiveTopology(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetPrimitiveTopology *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetPrimitiveTopology_args_handle(args);
cmd->device->cmd_set_primitive_topology(args->commandBuffer, args->primitiveTopology);
}
static void
vkr_dispatch_vkCmdSetScissorWithCount(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetScissorWithCount *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetScissorWithCount_args_handle(args);
cmd->device->cmd_set_scissor_with_count(args->commandBuffer, args->scissorCount,
args->pScissors);
}
static void
vkr_dispatch_vkCmdSetStencilOp(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetStencilOp *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetStencilOp_args_handle(args);
cmd->device->cmd_set_stencil_op(args->commandBuffer, args->faceMask, args->failOp,
args->passOp, args->depthFailOp, args->compareOp);
}
static void
vkr_dispatch_vkCmdSetStencilTestEnable(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetStencilTestEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetStencilTestEnable_args_handle(args);
cmd->device->cmd_set_stencil_test_enable(args->commandBuffer, args->stencilTestEnable);
}
static void
vkr_dispatch_vkCmdSetViewportWithCount(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetViewportWithCount *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdSetViewportWithCount_args_handle(args);
cmd->device->cmd_set_viewport_with_count(args->commandBuffer, args->viewportCount,
args->pViewports);
}
void
vkr_context_init_command_pool_dispatch(struct vkr_context *ctx)
{
@ -739,4 +866,18 @@ vkr_context_init_command_buffer_dispatch(struct vkr_context *ctx)
dispatch->dispatch_vkCmdEndQueryIndexedEXT = vkr_dispatch_vkCmdEndQueryIndexedEXT;
dispatch->dispatch_vkCmdDrawIndirectByteCountEXT =
vkr_dispatch_vkCmdDrawIndirectByteCountEXT;
dispatch->dispatch_vkCmdBindVertexBuffers2 = vkr_dispatch_vkCmdBindVertexBuffers2;
dispatch->dispatch_vkCmdSetCullMode = vkr_dispatch_vkCmdSetCullMode;
dispatch->dispatch_vkCmdSetDepthBoundsTestEnable =
vkr_dispatch_vkCmdSetDepthBoundsTestEnable;
dispatch->dispatch_vkCmdSetDepthCompareOp = vkr_dispatch_vkCmdSetDepthCompareOp;
dispatch->dispatch_vkCmdSetDepthTestEnable = vkr_dispatch_vkCmdSetDepthTestEnable;
dispatch->dispatch_vkCmdSetDepthWriteEnable = vkr_dispatch_vkCmdSetDepthWriteEnable;
dispatch->dispatch_vkCmdSetFrontFace = vkr_dispatch_vkCmdSetFrontFace;
dispatch->dispatch_vkCmdSetPrimitiveTopology = vkr_dispatch_vkCmdSetPrimitiveTopology;
dispatch->dispatch_vkCmdSetScissorWithCount = vkr_dispatch_vkCmdSetScissorWithCount;
dispatch->dispatch_vkCmdSetStencilOp = vkr_dispatch_vkCmdSetStencilOp;
dispatch->dispatch_vkCmdSetStencilTestEnable = vkr_dispatch_vkCmdSetStencilTestEnable;
dispatch->dispatch_vkCmdSetViewportWithCount = vkr_dispatch_vkCmdSetViewportWithCount;
}

@ -77,7 +77,7 @@ static const struct vn_info_extension_table vkr_extension_table = {
.KHR_synchronization2 = false,
.KHR_zero_initialize_workgroup_memory = false,
.EXT_4444_formats = false,
.EXT_extended_dynamic_state = false,
.EXT_extended_dynamic_state = true,
.EXT_extended_dynamic_state2 = false,
.EXT_image_robustness = false,
.EXT_inline_uniform_block = false,

@ -125,6 +125,66 @@ vkr_device_init_entry_points(struct vkr_device *dev, uint32_t api_version)
handle, "vkCmdDrawIndexedIndirectCountKHR");
}
if (api_version >= VK_API_VERSION_1_3) {
dev->cmd_bind_vertex_buffers_2 = (PFN_vkCmdBindVertexBuffers2)vkGetDeviceProcAddr(
handle, "vkCmdBindVertexBuffers2");
dev->cmd_set_cull_mode =
(PFN_vkCmdSetCullMode)vkGetDeviceProcAddr(handle, "vkCmdSetCullMode");
dev->cmd_set_depth_bounds_test_enable =
(PFN_vkCmdSetDepthBoundsTestEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthBoundsTestEnable");
dev->cmd_set_depth_compare_op = (PFN_vkCmdSetDepthCompareOp)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthCompareOp");
dev->cmd_set_depth_test_enable = (PFN_vkCmdSetDepthTestEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthTestEnable");
dev->cmd_set_depth_write_enable = (PFN_vkCmdSetDepthWriteEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthWriteEnable");
dev->cmd_set_front_face =
(PFN_vkCmdSetFrontFace)vkGetDeviceProcAddr(handle, "vkCmdSetFrontFace");
dev->cmd_set_primitive_topology =
(PFN_vkCmdSetPrimitiveTopology)vkGetDeviceProcAddr(handle,
"vkCmdSetPrimitiveTopology");
dev->cmd_set_scissor_with_count = (PFN_vkCmdSetScissorWithCount)vkGetDeviceProcAddr(
handle, "vkCmdSetScissorWithCount");
dev->cmd_set_stencil_op =
(PFN_vkCmdSetStencilOp)vkGetDeviceProcAddr(handle, "vkCmdSetStencilOp");
dev->cmd_set_stencil_test_enable =
(PFN_vkCmdSetStencilTestEnable)vkGetDeviceProcAddr(handle,
"vkCmdSetStencilTestEnable");
dev->cmd_set_viewport_with_count =
(PFN_vkCmdSetViewportWithCount)vkGetDeviceProcAddr(handle,
"vkCmdSetViewportWithCount");
} else {
dev->cmd_bind_vertex_buffers_2 = (PFN_vkCmdBindVertexBuffers2)vkGetDeviceProcAddr(
handle, "vkCmdBindVertexBuffers2EXT");
dev->cmd_set_cull_mode =
(PFN_vkCmdSetCullMode)vkGetDeviceProcAddr(handle, "vkCmdSetCullModeEXT");
dev->cmd_set_depth_bounds_test_enable =
(PFN_vkCmdSetDepthBoundsTestEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthBoundsTestEnableEXT");
dev->cmd_set_depth_compare_op = (PFN_vkCmdSetDepthCompareOp)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthCompareOpEXT");
dev->cmd_set_depth_test_enable = (PFN_vkCmdSetDepthTestEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthTestEnableEXT");
dev->cmd_set_depth_write_enable = (PFN_vkCmdSetDepthWriteEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetDepthWriteEnableEXT");
dev->cmd_set_front_face =
(PFN_vkCmdSetFrontFace)vkGetDeviceProcAddr(handle, "vkCmdSetFrontFaceEXT");
dev->cmd_set_primitive_topology =
(PFN_vkCmdSetPrimitiveTopology)vkGetDeviceProcAddr(
handle, "vkCmdSetPrimitiveTopologyEXT");
dev->cmd_set_scissor_with_count = (PFN_vkCmdSetScissorWithCount)vkGetDeviceProcAddr(
handle, "vkCmdSetScissorWithCountEXT");
dev->cmd_set_stencil_op =
(PFN_vkCmdSetStencilOp)vkGetDeviceProcAddr(handle, "vkCmdSetStencilOpEXT");
dev->cmd_set_stencil_test_enable =
(PFN_vkCmdSetStencilTestEnable)vkGetDeviceProcAddr(
handle, "vkCmdSetStencilTestEnableEXT");
dev->cmd_set_viewport_with_count =
(PFN_vkCmdSetViewportWithCount)vkGetDeviceProcAddr(
handle, "vkCmdSetViewportWithCountEXT");
}
dev->cmd_bind_transform_feedback_buffers =
(PFN_vkCmdBindTransformFeedbackBuffersEXT)vkGetDeviceProcAddr(
handle, "vkCmdBindTransformFeedbackBuffersEXT");

@ -30,6 +30,20 @@ struct vkr_device {
PFN_vkCmdDrawIndirectCount CmdDrawIndirectCount;
PFN_vkCmdDrawIndexedIndirectCount CmdDrawIndexedIndirectCount;
/* Vulkan 1.3 */
PFN_vkCmdBindVertexBuffers2 cmd_bind_vertex_buffers_2;
PFN_vkCmdSetCullMode cmd_set_cull_mode;
PFN_vkCmdSetDepthBoundsTestEnable cmd_set_depth_bounds_test_enable;
PFN_vkCmdSetDepthCompareOp cmd_set_depth_compare_op;
PFN_vkCmdSetDepthTestEnable cmd_set_depth_test_enable;
PFN_vkCmdSetDepthWriteEnable cmd_set_depth_write_enable;
PFN_vkCmdSetFrontFace cmd_set_front_face;
PFN_vkCmdSetPrimitiveTopology cmd_set_primitive_topology;
PFN_vkCmdSetScissorWithCount cmd_set_scissor_with_count;
PFN_vkCmdSetStencilOp cmd_set_stencil_op;
PFN_vkCmdSetStencilTestEnable cmd_set_stencil_test_enable;
PFN_vkCmdSetViewportWithCount cmd_set_viewport_with_count;
PFN_vkCmdBindTransformFeedbackBuffersEXT cmd_bind_transform_feedback_buffers;
PFN_vkCmdBeginTransformFeedbackEXT cmd_begin_transform_feedback;
PFN_vkCmdEndTransformFeedbackEXT cmd_end_transform_feedback;

Loading…
Cancel
Save