vkr: remove vkr_device_init_entry_points

Removes the old method and update all the affected functions.

Co-authored-by: Igor Torrente <igor.torrente@collabora.com>
Co-authored-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/719>
macos/master
Chia-I Wu 3 years ago committed by Marge Bot
parent d66378dbb4
commit 805bfda52c
  1. 6
      src/venus/vkr_buffer.c
  2. 72
      src/venus/vkr_command_buffer.c
  3. 160
      src/venus/vkr_device.c
  4. 44
      src/venus/vkr_device.h
  5. 10
      src/venus/vkr_device_memory.c
  6. 3
      src/venus/vkr_image.c
  7. 3
      src/venus/vkr_query_pool.c
  8. 9
      src/venus/vkr_queue.c
  9. 3
      src/venus/vkr_render_pass.c

@ -88,9 +88,10 @@ vkr_dispatch_vkGetBufferOpaqueCaptureAddress(
struct vn_command_vkGetBufferOpaqueCaptureAddress *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkGetBufferOpaqueCaptureAddress_args_handle(args);
args->ret = dev->GetBufferOpaqueCaptureAddress(args->device, args->pInfo);
args->ret = vk->GetBufferOpaqueCaptureAddress(args->device, args->pInfo);
}
static void
@ -98,9 +99,10 @@ vkr_dispatch_vkGetBufferDeviceAddress(UNUSED struct vn_dispatch_context *dispatc
struct vn_command_vkGetBufferDeviceAddress *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkGetBufferDeviceAddress_args_handle(args);
args->ret = dev->GetBufferDeviceAddress(args->device, args->pInfo);
args->ret = vk->GetBufferDeviceAddress(args->device, args->pInfo);
}
static void

@ -526,9 +526,10 @@ vkr_dispatch_vkCmdBeginRenderPass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBeginRenderPass2 *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdBeginRenderPass2_args_handle(args);
cmd->device->CmdBeginRenderPass2(args->commandBuffer, args->pRenderPassBegin,
vk->CmdBeginRenderPass2(args->commandBuffer, args->pRenderPassBegin,
args->pSubpassBeginInfo);
}
@ -537,9 +538,10 @@ vkr_dispatch_vkCmdNextSubpass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdNextSubpass2 *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdNextSubpass2_args_handle(args);
cmd->device->CmdNextSubpass2(args->commandBuffer, args->pSubpassBeginInfo,
vk->CmdNextSubpass2(args->commandBuffer, args->pSubpassBeginInfo,
args->pSubpassEndInfo);
}
@ -548,9 +550,10 @@ vkr_dispatch_vkCmdEndRenderPass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdEndRenderPass2 *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdEndRenderPass2_args_handle(args);
cmd->device->CmdEndRenderPass2(args->commandBuffer, args->pSubpassEndInfo);
vk->CmdEndRenderPass2(args->commandBuffer, args->pSubpassEndInfo);
}
static void
@ -558,9 +561,10 @@ vkr_dispatch_vkCmdDrawIndirectCount(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdDrawIndirectCount *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdDrawIndirectCount_args_handle(args);
cmd->device->CmdDrawIndirectCount(args->commandBuffer, args->buffer, args->offset,
vk->CmdDrawIndirectCount(args->commandBuffer, args->buffer, args->offset,
args->countBuffer, args->countBufferOffset,
args->maxDrawCount, args->stride);
}
@ -573,7 +577,7 @@ vkr_dispatch_vkCmdDrawIndexedIndirectCount(
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdDrawIndexedIndirectCount_args_handle(args);
cmd->device->CmdDrawIndexedIndirectCount(
cmd->device->proc_table.CmdDrawIndexedIndirectCount(
args->commandBuffer, args->buffer, args->offset, args->countBuffer,
args->countBufferOffset, args->maxDrawCount, args->stride);
}
@ -583,9 +587,10 @@ vkr_dispatch_vkCmdSetLineStippleEXT(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdSetLineStippleEXT *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetLineStippleEXT_args_handle(args);
cmd->device->cmd_set_line_stipple(args->commandBuffer, args->lineStippleFactor,
vk->CmdSetLineStippleEXT(args->commandBuffer, args->lineStippleFactor,
args->lineStipplePattern);
}
@ -597,7 +602,7 @@ vkr_dispatch_vkCmdBindTransformFeedbackBuffersEXT(
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBindTransformFeedbackBuffersEXT_args_handle(args);
cmd->device->cmd_bind_transform_feedback_buffers(
cmd->device->proc_table.CmdBindTransformFeedbackBuffersEXT(
args->commandBuffer, args->firstBinding, args->bindingCount, args->pBuffers,
args->pOffsets, args->pSizes);
}
@ -610,7 +615,7 @@ vkr_dispatch_vkCmdBeginTransformFeedbackEXT(
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBeginTransformFeedbackEXT_args_handle(args);
cmd->device->cmd_begin_transform_feedback(
cmd->device->proc_table.CmdBeginTransformFeedbackEXT(
args->commandBuffer, args->firstCounterBuffer, args->counterBufferCount,
args->pCounterBuffers, args->pCounterBufferOffsets);
}
@ -623,7 +628,7 @@ vkr_dispatch_vkCmdEndTransformFeedbackEXT(
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdEndTransformFeedbackEXT_args_handle(args);
cmd->device->cmd_end_transform_feedback(
cmd->device->proc_table.CmdEndTransformFeedbackEXT(
args->commandBuffer, args->firstCounterBuffer, args->counterBufferCount,
args->pCounterBuffers, args->pCounterBufferOffsets);
}
@ -633,9 +638,10 @@ vkr_dispatch_vkCmdBeginQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispat
struct vn_command_vkCmdBeginQueryIndexedEXT *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdBeginQueryIndexedEXT_args_handle(args);
cmd->device->cmd_begin_query_indexed(args->commandBuffer, args->queryPool, args->query,
vk->CmdBeginQueryIndexedEXT(args->commandBuffer, args->queryPool, args->query,
args->flags, args->index);
}
@ -644,9 +650,10 @@ vkr_dispatch_vkCmdEndQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispatch
struct vn_command_vkCmdEndQueryIndexedEXT *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdEndQueryIndexedEXT_args_handle(args);
cmd->device->cmd_end_query_indexed(args->commandBuffer, args->queryPool, args->query,
vk->CmdEndQueryIndexedEXT(args->commandBuffer, args->queryPool, args->query,
args->index);
}
@ -658,7 +665,7 @@ vkr_dispatch_vkCmdDrawIndirectByteCountEXT(
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdDrawIndirectByteCountEXT_args_handle(args);
cmd->device->cmd_draw_indirect_byte_count(
cmd->device->proc_table.CmdDrawIndirectByteCountEXT(
args->commandBuffer, args->instanceCount, args->firstInstance, args->counterBuffer,
args->counterBufferOffset, args->counterOffset, args->vertexStride);
}
@ -668,11 +675,12 @@ 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);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
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);
vk->CmdBindVertexBuffers2(args->commandBuffer, args->firstBinding, args->bindingCount,
args->pBuffers, args->pOffsets, args->pSizes,
args->pStrides);
}
static void
@ -682,7 +690,7 @@ vkr_dispatch_vkCmdSetCullMode(UNUSED struct vn_dispatch_context *dispatch,
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);
cmd->device->proc_table.CmdSetCullMode(args->commandBuffer, args->cullMode);
}
static void
@ -693,7 +701,7 @@ vkr_dispatch_vkCmdSetDepthBoundsTestEnable(
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,
cmd->device->proc_table.CmdSetDepthBoundsTestEnable(args->commandBuffer,
args->depthBoundsTestEnable);
}
@ -702,9 +710,10 @@ 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);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetDepthCompareOp_args_handle(args);
cmd->device->cmd_set_depth_compare_op(args->commandBuffer, args->depthCompareOp);
vk->CmdSetDepthCompareOp(args->commandBuffer, args->depthCompareOp);
}
static void
@ -712,9 +721,10 @@ 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);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetDepthTestEnable_args_handle(args);
cmd->device->cmd_set_depth_test_enable(args->commandBuffer, args->depthTestEnable);
vk->CmdSetDepthTestEnable(args->commandBuffer, args->depthTestEnable);
}
static void
@ -722,9 +732,10 @@ vkr_dispatch_vkCmdSetDepthWriteEnable(UNUSED struct vn_dispatch_context *dispatc
struct vn_command_vkCmdSetDepthWriteEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetDepthWriteEnable_args_handle(args);
cmd->device->cmd_set_depth_write_enable(args->commandBuffer, args->depthWriteEnable);
vk->CmdSetDepthWriteEnable(args->commandBuffer, args->depthWriteEnable);
}
static void
@ -732,9 +743,10 @@ 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);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetFrontFace_args_handle(args);
cmd->device->cmd_set_front_face(args->commandBuffer, args->frontFace);
vk->CmdSetFrontFace(args->commandBuffer, args->frontFace);
}
static void
@ -742,9 +754,10 @@ vkr_dispatch_vkCmdSetPrimitiveTopology(UNUSED struct vn_dispatch_context *dispat
struct vn_command_vkCmdSetPrimitiveTopology *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetPrimitiveTopology_args_handle(args);
cmd->device->cmd_set_primitive_topology(args->commandBuffer, args->primitiveTopology);
vk->CmdSetPrimitiveTopology(args->commandBuffer, args->primitiveTopology);
}
static void
@ -752,10 +765,10 @@ vkr_dispatch_vkCmdSetScissorWithCount(UNUSED struct vn_dispatch_context *dispatc
struct vn_command_vkCmdSetScissorWithCount *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetScissorWithCount_args_handle(args);
cmd->device->cmd_set_scissor_with_count(args->commandBuffer, args->scissorCount,
args->pScissors);
vk->CmdSetScissorWithCount(args->commandBuffer, args->scissorCount, args->pScissors);
}
static void
@ -763,10 +776,11 @@ 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);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetStencilOp_args_handle(args);
cmd->device->cmd_set_stencil_op(args->commandBuffer, args->faceMask, args->failOp,
args->passOp, args->depthFailOp, args->compareOp);
vk->CmdSetStencilOp(args->commandBuffer, args->faceMask, args->failOp, args->passOp,
args->depthFailOp, args->compareOp);
}
static void
@ -774,9 +788,10 @@ vkr_dispatch_vkCmdSetStencilTestEnable(UNUSED struct vn_dispatch_context *dispat
struct vn_command_vkCmdSetStencilTestEnable *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetStencilTestEnable_args_handle(args);
cmd->device->cmd_set_stencil_test_enable(args->commandBuffer, args->stencilTestEnable);
vk->CmdSetStencilTestEnable(args->commandBuffer, args->stencilTestEnable);
}
static void
@ -784,9 +799,10 @@ vkr_dispatch_vkCmdSetViewportWithCount(UNUSED struct vn_dispatch_context *dispat
struct vn_command_vkCmdSetViewportWithCount *args)
{
struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
struct vn_device_proc_table *vk = &cmd->device->proc_table;
vn_replace_vkCmdSetViewportWithCount_args_handle(args);
cmd->device->cmd_set_viewport_with_count(args->commandBuffer, args->viewportCount,
vk->CmdSetViewportWithCount(args->commandBuffer, args->viewportCount,
args->pViewports);
}

@ -61,164 +61,6 @@ vkr_device_create_queues(struct vkr_context *ctx,
return VK_SUCCESS;
}
static void
vkr_device_init_entry_points(struct vkr_device *dev, uint32_t api_version)
{
VkDevice handle = dev->base.handle.device;
if (api_version >= VK_API_VERSION_1_2) {
dev->GetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue)vkGetDeviceProcAddr(
handle, "vkGetSemaphoreCounterValue");
dev->WaitSemaphores =
(PFN_vkWaitSemaphores)vkGetDeviceProcAddr(handle, "vkWaitSemaphores");
dev->SignalSemaphore =
(PFN_vkSignalSemaphore)vkGetDeviceProcAddr(handle, "vkSignalSemaphore");
dev->GetDeviceMemoryOpaqueCaptureAddress =
(PFN_vkGetDeviceMemoryOpaqueCaptureAddress)vkGetDeviceProcAddr(
handle, "vkGetDeviceMemoryOpaqueCaptureAddress");
dev->GetBufferOpaqueCaptureAddress =
(PFN_vkGetBufferOpaqueCaptureAddress)vkGetDeviceProcAddr(
handle, "vkGetBufferOpaqueCaptureAddress");
dev->GetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress)vkGetDeviceProcAddr(
handle, "vkGetBufferDeviceAddress");
dev->ResetQueryPool =
(PFN_vkResetQueryPool)vkGetDeviceProcAddr(handle, "vkResetQueryPool");
dev->CreateRenderPass2 =
(PFN_vkCreateRenderPass2)vkGetDeviceProcAddr(handle, "vkCreateRenderPass2");
dev->CmdBeginRenderPass2 =
(PFN_vkCmdBeginRenderPass2)vkGetDeviceProcAddr(handle, "vkCmdBeginRenderPass2");
dev->CmdNextSubpass2 =
(PFN_vkCmdNextSubpass2)vkGetDeviceProcAddr(handle, "vkCmdNextSubpass2");
dev->CmdEndRenderPass2 =
(PFN_vkCmdEndRenderPass2)vkGetDeviceProcAddr(handle, "vkCmdEndRenderPass2");
dev->CmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)vkGetDeviceProcAddr(
handle, "vkCmdDrawIndirectCount");
dev->CmdDrawIndexedIndirectCount =
(PFN_vkCmdDrawIndexedIndirectCount)vkGetDeviceProcAddr(
handle, "vkCmdDrawIndexedIndirectCount");
} else {
dev->GetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue)vkGetDeviceProcAddr(
handle, "vkGetSemaphoreCounterValueKHR");
dev->WaitSemaphores =
(PFN_vkWaitSemaphores)vkGetDeviceProcAddr(handle, "vkWaitSemaphoresKHR");
dev->SignalSemaphore =
(PFN_vkSignalSemaphore)vkGetDeviceProcAddr(handle, "vkSignalSemaphoreKHR");
dev->GetDeviceMemoryOpaqueCaptureAddress =
(PFN_vkGetDeviceMemoryOpaqueCaptureAddress)vkGetDeviceProcAddr(
handle, "vkGetDeviceMemoryOpaqueCaptureAddressKHR");
dev->GetBufferOpaqueCaptureAddress =
(PFN_vkGetBufferOpaqueCaptureAddress)vkGetDeviceProcAddr(
handle, "vkGetBufferOpaqueCaptureAddressKHR");
dev->GetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress)vkGetDeviceProcAddr(
handle, "vkGetBufferDeviceAddressKHR");
dev->ResetQueryPool =
(PFN_vkResetQueryPool)vkGetDeviceProcAddr(handle, "vkResetQueryPoolEXT");
dev->CreateRenderPass2 =
(PFN_vkCreateRenderPass2)vkGetDeviceProcAddr(handle, "vkCreateRenderPass2KHR");
dev->CmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2)vkGetDeviceProcAddr(
handle, "vkCmdBeginRenderPass2KHR");
dev->CmdNextSubpass2 =
(PFN_vkCmdNextSubpass2)vkGetDeviceProcAddr(handle, "vkCmdNextSubpass2KHR");
dev->CmdEndRenderPass2 =
(PFN_vkCmdEndRenderPass2)vkGetDeviceProcAddr(handle, "vkCmdEndRenderPass2KHR");
dev->CmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)vkGetDeviceProcAddr(
handle, "vkCmdDrawIndirectCountKHR");
dev->CmdDrawIndexedIndirectCount =
(PFN_vkCmdDrawIndexedIndirectCount)vkGetDeviceProcAddr(
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_set_line_stipple =
(PFN_vkCmdSetLineStippleEXT)vkGetDeviceProcAddr(handle, "vkCmdSetLineStippleEXT");
dev->cmd_bind_transform_feedback_buffers =
(PFN_vkCmdBindTransformFeedbackBuffersEXT)vkGetDeviceProcAddr(
handle, "vkCmdBindTransformFeedbackBuffersEXT");
dev->cmd_begin_transform_feedback =
(PFN_vkCmdBeginTransformFeedbackEXT)vkGetDeviceProcAddr(
handle, "vkCmdBeginTransformFeedbackEXT");
dev->cmd_end_transform_feedback =
(PFN_vkCmdEndTransformFeedbackEXT)vkGetDeviceProcAddr(
handle, "vkCmdEndTransformFeedbackEXT");
dev->cmd_begin_query_indexed = (PFN_vkCmdBeginQueryIndexedEXT)vkGetDeviceProcAddr(
handle, "vkCmdBeginQueryIndexedEXT");
dev->cmd_end_query_indexed =
(PFN_vkCmdEndQueryIndexedEXT)vkGetDeviceProcAddr(handle, "vkCmdEndQueryIndexedEXT");
dev->cmd_draw_indirect_byte_count =
(PFN_vkCmdDrawIndirectByteCountEXT)vkGetDeviceProcAddr(
handle, "vkCmdDrawIndirectByteCountEXT");
dev->get_image_drm_format_modifier_properties =
(PFN_vkGetImageDrmFormatModifierPropertiesEXT)vkGetDeviceProcAddr(
handle, "vkGetImageDrmFormatModifierPropertiesEXT");
dev->get_fence_fd =
(PFN_vkGetFenceFdKHR)vkGetDeviceProcAddr(handle, "vkGetFenceFdKHR");
dev->get_memory_fd =
(PFN_vkGetMemoryFdKHR)vkGetDeviceProcAddr(handle, "vkGetMemoryFdKHR");
dev->get_memory_fd_properties = (PFN_vkGetMemoryFdPropertiesKHR)vkGetDeviceProcAddr(
handle, "vkGetMemoryFdPropertiesKHR");
}
static void
vkr_device_init_proc_table(struct vkr_device *dev,
uint32_t api_version,
@ -299,8 +141,6 @@ vkr_dispatch_vkCreateDevice(struct vn_dispatch_context *dispatch,
return;
}
vkr_device_init_entry_points(dev, physical_dev->api_version);
mtx_init(&dev->free_sync_mutex, mtx_plain);
list_inithead(&dev->free_syncs);

@ -18,50 +18,6 @@ struct vkr_device {
struct vn_device_proc_table proc_table;
/* Vulkan 1.2 */
PFN_vkGetSemaphoreCounterValue GetSemaphoreCounterValue;
PFN_vkWaitSemaphores WaitSemaphores;
PFN_vkSignalSemaphore SignalSemaphore;
PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress;
PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress;
PFN_vkGetBufferDeviceAddress GetBufferDeviceAddress;
PFN_vkResetQueryPool ResetQueryPool;
PFN_vkCreateRenderPass2 CreateRenderPass2;
PFN_vkCmdBeginRenderPass2 CmdBeginRenderPass2;
PFN_vkCmdNextSubpass2 CmdNextSubpass2;
PFN_vkCmdEndRenderPass2 CmdEndRenderPass2;
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_vkCmdSetLineStippleEXT cmd_set_line_stipple;
PFN_vkCmdBindTransformFeedbackBuffersEXT cmd_bind_transform_feedback_buffers;
PFN_vkCmdBeginTransformFeedbackEXT cmd_begin_transform_feedback;
PFN_vkCmdEndTransformFeedbackEXT cmd_end_transform_feedback;
PFN_vkCmdBeginQueryIndexedEXT cmd_begin_query_indexed;
PFN_vkCmdEndQueryIndexedEXT cmd_end_query_indexed;
PFN_vkCmdDrawIndirectByteCountEXT cmd_draw_indirect_byte_count;
PFN_vkGetImageDrmFormatModifierPropertiesEXT get_image_drm_format_modifier_properties;
PFN_vkGetFenceFdKHR get_fence_fd;
PFN_vkGetMemoryFdKHR get_memory_fd;
PFN_vkGetMemoryFdPropertiesKHR get_memory_fd_properties;
struct list_head queues;
mtx_t free_sync_mutex;

@ -256,9 +256,10 @@ vkr_dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(
struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(args);
args->ret = dev->GetDeviceMemoryOpaqueCaptureAddress(args->device, args->pInfo);
args->ret = vk->GetDeviceMemoryOpaqueCaptureAddress(args->device, args->pInfo);
}
static void
@ -268,6 +269,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA(
{
struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
struct vkr_resource_attachment *att = vkr_context_get_resource(ctx, args->resourceId);
if (!att) {
@ -293,8 +295,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA(
.memoryTypeBits = 0,
};
vn_replace_vkGetMemoryResourcePropertiesMESA_args_handle(args);
args->ret =
dev->get_memory_fd_properties(args->device, handle_type, fd, &mem_fd_props);
args->ret = vk->GetMemoryFdPropertiesKHR(args->device, handle_type, fd, &mem_fd_props);
if (args->ret != VK_SUCCESS) {
close(fd);
return;
@ -343,6 +344,7 @@ vkr_device_memory_export_fd(struct vkr_device_memory *mem,
VkExternalMemoryHandleTypeFlagBits handle_type,
int *out_fd)
{
struct vn_device_proc_table *vk = &mem->device->proc_table;
int fd = -1;
if (mem->gbm_bo) {
@ -362,7 +364,7 @@ vkr_device_memory_export_fd(struct vkr_device_memory *mem,
.memory = mem_handle,
.handleType = handle_type,
};
VkResult result = mem->device->get_memory_fd(dev_handle, &fd_info, &fd);
VkResult result = vk->GetMemoryFdKHR(dev_handle, &fd_info, &fd);
if (result != VK_SUCCESS)
return result == VK_ERROR_TOO_MANY_OBJECTS ? -EMFILE : -ENOMEM;
}

@ -114,9 +114,10 @@ vkr_dispatch_vkGetImageDrmFormatModifierPropertiesEXT(
struct vn_command_vkGetImageDrmFormatModifierPropertiesEXT *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkGetImageDrmFormatModifierPropertiesEXT_args_handle(args);
args->ret = dev->get_image_drm_format_modifier_properties(args->device, args->image,
args->ret = vk->GetImageDrmFormatModifierPropertiesEXT(args->device, args->image,
args->pProperties);
}

@ -36,9 +36,10 @@ vkr_dispatch_vkResetQueryPool(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkResetQueryPool *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkResetQueryPool_args_handle(args);
dev->ResetQueryPool(args->device, args->queryPool, args->firstQuery, args->queryCount);
vk->ResetQueryPool(args->device, args->queryPool, args->firstQuery, args->queryCount);
}
void

@ -459,9 +459,10 @@ vkr_dispatch_vkGetSemaphoreCounterValue(UNUSED struct vn_dispatch_context *dispa
struct vn_command_vkGetSemaphoreCounterValue *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkGetSemaphoreCounterValue_args_handle(args);
args->ret = dev->GetSemaphoreCounterValue(args->device, args->semaphore, args->pValue);
args->ret = vk->GetSemaphoreCounterValue(args->device, args->semaphore, args->pValue);
}
static void
@ -470,6 +471,7 @@ vkr_dispatch_vkWaitSemaphores(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
/* no blocking call */
if (args->timeout) {
@ -478,7 +480,7 @@ vkr_dispatch_vkWaitSemaphores(struct vn_dispatch_context *dispatch,
}
vn_replace_vkWaitSemaphores_args_handle(args);
args->ret = dev->WaitSemaphores(args->device, args->pWaitInfo, args->timeout);
args->ret = vk->WaitSemaphores(args->device, args->pWaitInfo, args->timeout);
}
static void
@ -486,9 +488,10 @@ vkr_dispatch_vkSignalSemaphore(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkSignalSemaphore *args)
{
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
vn_replace_vkSignalSemaphore_args_handle(args);
args->ret = dev->SignalSemaphore(args->device, args->pSignalInfo);
args->ret = vk->SignalSemaphore(args->device, args->pSignalInfo);
}
static void

@ -20,6 +20,7 @@ vkr_dispatch_vkCreateRenderPass2(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vn_device_proc_table *vk = &dev->proc_table;
struct vkr_render_pass *pass = vkr_context_alloc_object(
ctx, sizeof(*pass), VK_OBJECT_TYPE_RENDER_PASS, args->pRenderPass);
@ -29,7 +30,7 @@ vkr_dispatch_vkCreateRenderPass2(struct vn_dispatch_context *dispatch,
}
vn_replace_vkCreateRenderPass2_args_handle(args);
args->ret = dev->CreateRenderPass2(args->device, args->pCreateInfo, NULL,
args->ret = vk->CreateRenderPass2(args->device, args->pCreateInfo, NULL,
&pass->base.handle.render_pass);
if (args->ret != VK_SUCCESS) {
free(pass);

Loading…
Cancel
Save