vkr: use the cast functions

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Chia-I Wu 3 years ago
parent ab431feabe
commit c4060e32f7
  1. 6
      src/venus/vkr_buffer.c
  2. 22
      src/venus/vkr_command_buffer.c
  3. 8
      src/venus/vkr_common.h
  4. 2
      src/venus/vkr_descriptor_set.c
  5. 4
      src/venus/vkr_device.c
  6. 8
      src/venus/vkr_device_memory.c
  7. 3
      src/venus/vkr_device_object.py
  8. 4
      src/venus/vkr_image.c
  9. 2
      src/venus/vkr_instance.c
  10. 10
      src/venus/vkr_physical_device.c
  11. 4
      src/venus/vkr_pipeline.c
  12. 2
      src/venus/vkr_query_pool.c
  13. 10
      src/venus/vkr_queue.c
  14. 2
      src/venus/vkr_render_pass.c

@ -14,7 +14,7 @@ vkr_dispatch_vkCreateBuffer(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
#ifdef FORCE_ENABLE_DMABUF #ifdef FORCE_ENABLE_DMABUF
VkExternalMemoryBufferCreateInfo local_external_info; VkExternalMemoryBufferCreateInfo local_external_info;
@ -90,7 +90,7 @@ vkr_dispatch_vkGetBufferOpaqueCaptureAddress(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkGetBufferOpaqueCaptureAddress *args) struct vn_command_vkGetBufferOpaqueCaptureAddress *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkGetBufferOpaqueCaptureAddress_args_handle(args); vn_replace_vkGetBufferOpaqueCaptureAddress_args_handle(args);
args->ret = dev->GetBufferOpaqueCaptureAddress(args->device, args->pInfo); args->ret = dev->GetBufferOpaqueCaptureAddress(args->device, args->pInfo);
@ -100,7 +100,7 @@ static void
vkr_dispatch_vkGetBufferDeviceAddress(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkGetBufferDeviceAddress(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkGetBufferDeviceAddress *args) struct vn_command_vkGetBufferDeviceAddress *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkGetBufferDeviceAddress_args_handle(args); vn_replace_vkGetBufferDeviceAddress_args_handle(args);
args->ret = dev->GetBufferDeviceAddress(args->device, args->pInfo); args->ret = dev->GetBufferDeviceAddress(args->device, args->pInfo);

@ -508,7 +508,7 @@ static void
vkr_dispatch_vkCmdBeginRenderPass2(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdBeginRenderPass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBeginRenderPass2 *args) struct vn_command_vkCmdBeginRenderPass2 *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBeginRenderPass2_args_handle(args); vn_replace_vkCmdBeginRenderPass2_args_handle(args);
cmd->device->CmdBeginRenderPass2(args->commandBuffer, args->pRenderPassBegin, cmd->device->CmdBeginRenderPass2(args->commandBuffer, args->pRenderPassBegin,
@ -519,7 +519,7 @@ static void
vkr_dispatch_vkCmdNextSubpass2(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdNextSubpass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdNextSubpass2 *args) struct vn_command_vkCmdNextSubpass2 *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdNextSubpass2_args_handle(args); vn_replace_vkCmdNextSubpass2_args_handle(args);
cmd->device->CmdNextSubpass2(args->commandBuffer, args->pSubpassBeginInfo, cmd->device->CmdNextSubpass2(args->commandBuffer, args->pSubpassBeginInfo,
@ -530,7 +530,7 @@ static void
vkr_dispatch_vkCmdEndRenderPass2(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdEndRenderPass2(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdEndRenderPass2 *args) struct vn_command_vkCmdEndRenderPass2 *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdEndRenderPass2_args_handle(args); vn_replace_vkCmdEndRenderPass2_args_handle(args);
cmd->device->CmdEndRenderPass2(args->commandBuffer, args->pSubpassEndInfo); cmd->device->CmdEndRenderPass2(args->commandBuffer, args->pSubpassEndInfo);
@ -540,7 +540,7 @@ static void
vkr_dispatch_vkCmdDrawIndirectCount(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdDrawIndirectCount(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdDrawIndirectCount *args) struct vn_command_vkCmdDrawIndirectCount *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdDrawIndirectCount_args_handle(args); vn_replace_vkCmdDrawIndirectCount_args_handle(args);
cmd->device->CmdDrawIndirectCount(args->commandBuffer, args->buffer, args->offset, cmd->device->CmdDrawIndirectCount(args->commandBuffer, args->buffer, args->offset,
@ -553,7 +553,7 @@ vkr_dispatch_vkCmdDrawIndexedIndirectCount(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdDrawIndexedIndirectCount *args) struct vn_command_vkCmdDrawIndexedIndirectCount *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdDrawIndexedIndirectCount_args_handle(args); vn_replace_vkCmdDrawIndexedIndirectCount_args_handle(args);
cmd->device->CmdDrawIndexedIndirectCount( cmd->device->CmdDrawIndexedIndirectCount(
@ -566,7 +566,7 @@ vkr_dispatch_vkCmdBindTransformFeedbackBuffersEXT(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBindTransformFeedbackBuffersEXT *args) struct vn_command_vkCmdBindTransformFeedbackBuffersEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBindTransformFeedbackBuffersEXT_args_handle(args); vn_replace_vkCmdBindTransformFeedbackBuffersEXT_args_handle(args);
cmd->device->cmd_bind_transform_feedback_buffers( cmd->device->cmd_bind_transform_feedback_buffers(
@ -579,7 +579,7 @@ vkr_dispatch_vkCmdBeginTransformFeedbackEXT(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBeginTransformFeedbackEXT *args) struct vn_command_vkCmdBeginTransformFeedbackEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBeginTransformFeedbackEXT_args_handle(args); vn_replace_vkCmdBeginTransformFeedbackEXT_args_handle(args);
cmd->device->cmd_begin_transform_feedback( cmd->device->cmd_begin_transform_feedback(
@ -592,7 +592,7 @@ vkr_dispatch_vkCmdEndTransformFeedbackEXT(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdEndTransformFeedbackEXT *args) struct vn_command_vkCmdEndTransformFeedbackEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdEndTransformFeedbackEXT_args_handle(args); vn_replace_vkCmdEndTransformFeedbackEXT_args_handle(args);
cmd->device->cmd_end_transform_feedback( cmd->device->cmd_end_transform_feedback(
@ -604,7 +604,7 @@ static void
vkr_dispatch_vkCmdBeginQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdBeginQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdBeginQueryIndexedEXT *args) struct vn_command_vkCmdBeginQueryIndexedEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdBeginQueryIndexedEXT_args_handle(args); vn_replace_vkCmdBeginQueryIndexedEXT_args_handle(args);
cmd->device->cmd_begin_query_indexed(args->commandBuffer, args->queryPool, args->query, cmd->device->cmd_begin_query_indexed(args->commandBuffer, args->queryPool, args->query,
@ -615,7 +615,7 @@ static void
vkr_dispatch_vkCmdEndQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkCmdEndQueryIndexedEXT(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdEndQueryIndexedEXT *args) struct vn_command_vkCmdEndQueryIndexedEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdEndQueryIndexedEXT_args_handle(args); vn_replace_vkCmdEndQueryIndexedEXT_args_handle(args);
cmd->device->cmd_end_query_indexed(args->commandBuffer, args->queryPool, args->query, cmd->device->cmd_end_query_indexed(args->commandBuffer, args->queryPool, args->query,
@ -627,7 +627,7 @@ vkr_dispatch_vkCmdDrawIndirectByteCountEXT(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkCmdDrawIndirectByteCountEXT *args) struct vn_command_vkCmdDrawIndirectByteCountEXT *args)
{ {
struct vkr_command_buffer *cmd = (struct vkr_command_buffer *)args->commandBuffer; struct vkr_command_buffer *cmd = vkr_command_buffer_from_handle(args->commandBuffer);
vn_replace_vkCmdDrawIndirectByteCountEXT_args_handle(args); vn_replace_vkCmdDrawIndirectByteCountEXT_args_handle(args);
cmd->device->cmd_draw_indirect_byte_count( cmd->device->cmd_draw_indirect_byte_count(

@ -66,7 +66,7 @@
* These macros may shadow your variables. Use with care. * These macros may shadow your variables. Use with care.
*/ */
#define CREATE_OBJECT(obj, vkr_type, vk_obj, vk_cmd, vk_arg) \ #define CREATE_OBJECT(obj, vkr_type, vk_obj, vk_cmd, vk_arg) \
struct vkr_device *_dev = (struct vkr_device *)args->device; \ struct vkr_device *_dev = vkr_device_from_handle(args->device); \
\ \
struct vkr_##vkr_type *obj = vkr_##vkr_type##_create(ctx, args); \ struct vkr_##vkr_type *obj = vkr_##vkr_type##_create(ctx, args); \
if (!obj) \ if (!obj) \
@ -75,7 +75,7 @@
list_add(&obj->base.track_head, &_dev->objects) list_add(&obj->base.track_head, &_dev->objects)
#define DESTROY_OBJECT(obj, vkr_type, vk_obj, vk_cmd, vk_arg) \ #define DESTROY_OBJECT(obj, vkr_type, vk_obj, vk_cmd, vk_arg) \
struct vkr_##vkr_type *obj = (struct vkr_##vkr_type *)(uintptr_t)args->vk_arg; \ struct vkr_##vkr_type *obj = vkr_##vkr_type##_from_handle(args->vk_arg); \
if (!obj) \ if (!obj) \
return; \ return; \
\ \
@ -86,10 +86,10 @@
#define ALLOCATE_POOL_OBJECTS(vkr_type, vk_type, vk_obj, vk_cmd, arg_count, arg_pool, \ #define ALLOCATE_POOL_OBJECTS(vkr_type, vk_type, vk_obj, vk_cmd, arg_count, arg_pool, \
vkr_pool_type, vk_pool_type) \ vkr_pool_type, vk_pool_type) \
do { \ do { \
struct vkr_device *dev = (struct vkr_device *)args->device; \ struct vkr_device *dev = vkr_device_from_handle(args->device); \
\ \
struct vkr_##vkr_pool_type *pool = \ struct vkr_##vkr_pool_type *pool = \
(struct vkr_##vkr_pool_type *)(uintptr_t)args->pAllocateInfo->arg_pool; \ vkr_##vkr_pool_type##_from_handle(args->pAllocateInfo->arg_pool); \
if (!pool) { \ if (!pool) { \
vkr_cs_decoder_set_fatal(&ctx->decoder); \ vkr_cs_decoder_set_fatal(&ctx->decoder); \
return; \ return; \

@ -76,7 +76,7 @@ vkr_dispatch_vkResetDescriptorPool(struct vn_dispatch_context *dispatch,
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_descriptor_pool *pool = struct vkr_descriptor_pool *pool =
(struct vkr_descriptor_pool *)(uintptr_t)args->descriptorPool; vkr_descriptor_pool_from_handle(args->descriptorPool);
if (!pool) { if (!pool) {
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;

@ -150,7 +150,7 @@ vkr_dispatch_vkCreateDevice(struct vn_dispatch_context *dispatch,
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_physical_device *physical_dev = struct vkr_physical_device *physical_dev =
(struct vkr_physical_device *)args->physicalDevice; vkr_physical_device_from_handle(args->physicalDevice);
/* append extensions for our own use */ /* append extensions for our own use */
const char **exts = NULL; const char **exts = NULL;
@ -365,7 +365,7 @@ vkr_dispatch_vkDestroyDevice(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
/* this never happens */ /* this never happens */
if (!dev) if (!dev)
return; return;

@ -43,7 +43,7 @@ vkr_dispatch_vkAllocateMemory(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
#ifdef FORCE_ENABLE_DMABUF #ifdef FORCE_ENABLE_DMABUF
VkExportMemoryAllocateInfo local_export_info; VkExportMemoryAllocateInfo local_export_info;
@ -155,7 +155,7 @@ vkr_dispatch_vkFreeMemory(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device_memory *mem = (struct vkr_device_memory *)(uintptr_t)args->memory; struct vkr_device_memory *mem = vkr_device_memory_from_handle(args->memory);
if (!mem) if (!mem)
return; return;
@ -182,7 +182,7 @@ vkr_dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args) struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(args); vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(args);
args->ret = dev->GetDeviceMemoryOpaqueCaptureAddress(args->device, args->pInfo); args->ret = dev->GetDeviceMemoryOpaqueCaptureAddress(args->device, args->pInfo);
@ -194,7 +194,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA(
struct vn_command_vkGetMemoryResourcePropertiesMESA *args) struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vkr_resource_attachment *att = struct vkr_resource_attachment *att =
util_hash_table_get(ctx->resource_table, uintptr_to_pointer(args->resourceId)); util_hash_table_get(ctx->resource_table, uintptr_to_pointer(args->resourceId));

@ -81,7 +81,8 @@ vkr_{destroy_func_name}_destroy_driver_handles(
{{ {{
list_inithead(free_list); list_inithead(free_list);
for (uint32_t i = 0; i < args->{destroy_count}; i++) {{ for (uint32_t i = 0; i < args->{destroy_count}; i++) {{
struct vkr_{vkr_type} *obj = (struct vkr_{vkr_type} *)args->{destroy_objs}[i]; struct vkr_{vkr_type} *obj =
vkr_{vkr_type}_from_handle(args->{destroy_objs}[i]);
if (!obj) if (!obj)
continue; continue;

@ -14,7 +14,7 @@ vkr_dispatch_vkCreateImage(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
#ifdef FORCE_ENABLE_DMABUF #ifdef FORCE_ENABLE_DMABUF
/* Do not chain VkExternalMemoryImageCreateInfo with optimal tiling, so that /* Do not chain VkExternalMemoryImageCreateInfo with optimal tiling, so that
@ -126,7 +126,7 @@ vkr_dispatch_vkGetImageDrmFormatModifierPropertiesEXT(
UNUSED struct vn_dispatch_context *dispatch, UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkGetImageDrmFormatModifierPropertiesEXT *args) struct vn_command_vkGetImageDrmFormatModifierPropertiesEXT *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkGetImageDrmFormatModifierPropertiesEXT_args_handle(args); vn_replace_vkGetImageDrmFormatModifierPropertiesEXT_args_handle(args);
args->ret = dev->get_image_drm_format_modifier_properties(args->device, args->image, args->ret = dev->get_image_drm_format_modifier_properties(args->device, args->image,

@ -252,7 +252,7 @@ vkr_dispatch_vkDestroyInstance(struct vn_dispatch_context *dispatch,
struct vn_command_vkDestroyInstance *args) struct vn_command_vkDestroyInstance *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_instance *instance = (struct vkr_instance *)args->instance; struct vkr_instance *instance = vkr_instance_from_handle(args->instance);
if (ctx->instance != instance) { if (ctx->instance != instance) {
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);

@ -158,7 +158,7 @@ vkr_dispatch_vkEnumeratePhysicalDevices(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_instance *instance = (struct vkr_instance *)args->instance; struct vkr_instance *instance = vkr_instance_from_handle(args->instance);
if (instance != ctx->instance) { if (instance != ctx->instance) {
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;
@ -238,7 +238,7 @@ vkr_dispatch_vkEnumeratePhysicalDeviceGroups(
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_instance *instance = (struct vkr_instance *)args->instance; struct vkr_instance *instance = vkr_instance_from_handle(args->instance);
if (instance != ctx->instance) { if (instance != ctx->instance) {
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;
@ -297,7 +297,7 @@ vkr_dispatch_vkEnumerateDeviceExtensionProperties(
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_physical_device *physical_dev = struct vkr_physical_device *physical_dev =
(struct vkr_physical_device *)args->physicalDevice; vkr_physical_device_from_handle(args->physicalDevice);
if (args->pLayerName) { if (args->pLayerName) {
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;
@ -337,7 +337,7 @@ vkr_dispatch_vkGetPhysicalDeviceProperties(
struct vn_command_vkGetPhysicalDeviceProperties *args) struct vn_command_vkGetPhysicalDeviceProperties *args)
{ {
struct vkr_physical_device *physical_dev = struct vkr_physical_device *physical_dev =
(struct vkr_physical_device *)args->physicalDevice; vkr_physical_device_from_handle(args->physicalDevice);
*args->pProperties = physical_dev->properties; *args->pProperties = physical_dev->properties;
} }
@ -410,7 +410,7 @@ vkr_dispatch_vkGetPhysicalDeviceProperties2(
struct vn_command_vkGetPhysicalDeviceProperties2 *args) struct vn_command_vkGetPhysicalDeviceProperties2 *args)
{ {
struct vkr_physical_device *physical_dev = struct vkr_physical_device *physical_dev =
(struct vkr_physical_device *)args->physicalDevice; vkr_physical_device_from_handle(args->physicalDevice);
vn_replace_vkGetPhysicalDeviceProperties2_args_handle(args); vn_replace_vkGetPhysicalDeviceProperties2_args_handle(args);
vkGetPhysicalDeviceProperties2(args->physicalDevice, args->pProperties); vkGetPhysicalDeviceProperties2(args->physicalDevice, args->pProperties);

@ -100,7 +100,7 @@ vkr_dispatch_vkCreateGraphicsPipelines(struct vn_dispatch_context *dispatch,
struct vn_command_vkCreateGraphicsPipelines *args) struct vn_command_vkCreateGraphicsPipelines *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct object_array arr; struct object_array arr;
if (vkr_graphics_pipeline_create_array(ctx, args, &arr) != VK_SUCCESS) if (vkr_graphics_pipeline_create_array(ctx, args, &arr) != VK_SUCCESS)
@ -114,7 +114,7 @@ vkr_dispatch_vkCreateComputePipelines(struct vn_dispatch_context *dispatch,
struct vn_command_vkCreateComputePipelines *args) struct vn_command_vkCreateComputePipelines *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct object_array arr; struct object_array arr;
if (vkr_compute_pipeline_create_array(ctx, args, &arr) != VK_SUCCESS) if (vkr_compute_pipeline_create_array(ctx, args, &arr) != VK_SUCCESS)

@ -43,7 +43,7 @@ static void
vkr_dispatch_vkResetQueryPool(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkResetQueryPool(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkResetQueryPool *args) struct vn_command_vkResetQueryPool *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkResetQueryPool_args_handle(args); vn_replace_vkResetQueryPool_args_handle(args);
dev->ResetQueryPool(args->device, args->queryPool, args->firstQuery, args->queryCount); dev->ResetQueryPool(args->device, args->queryPool, args->firstQuery, args->queryCount);

@ -318,7 +318,7 @@ vkr_dispatch_vkGetDeviceQueue(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vkr_queue *queue = vkr_device_lookup_queue( struct vkr_queue *queue = vkr_device_lookup_queue(
dev, 0 /* flags */, args->queueFamilyIndex, args->queueIndex); dev, 0 /* flags */, args->queueFamilyIndex, args->queueIndex);
@ -338,7 +338,7 @@ vkr_dispatch_vkGetDeviceQueue2(struct vn_dispatch_context *dispatch,
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vkr_queue *queue = vkr_device_lookup_queue(dev, args->pQueueInfo->flags, struct vkr_queue *queue = vkr_device_lookup_queue(dev, args->pQueueInfo->flags,
args->pQueueInfo->queueFamilyIndex, args->pQueueInfo->queueFamilyIndex,
@ -464,7 +464,7 @@ static void
vkr_dispatch_vkGetSemaphoreCounterValue(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkGetSemaphoreCounterValue(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkGetSemaphoreCounterValue *args) struct vn_command_vkGetSemaphoreCounterValue *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkGetSemaphoreCounterValue_args_handle(args); vn_replace_vkGetSemaphoreCounterValue_args_handle(args);
args->ret = dev->GetSemaphoreCounterValue(args->device, args->semaphore, args->pValue); args->ret = dev->GetSemaphoreCounterValue(args->device, args->semaphore, args->pValue);
@ -475,7 +475,7 @@ vkr_dispatch_vkWaitSemaphores(struct vn_dispatch_context *dispatch,
struct vn_command_vkWaitSemaphores *args) struct vn_command_vkWaitSemaphores *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
/* no blocking call */ /* no blocking call */
if (args->timeout) { if (args->timeout) {
@ -491,7 +491,7 @@ static void
vkr_dispatch_vkSignalSemaphore(UNUSED struct vn_dispatch_context *dispatch, vkr_dispatch_vkSignalSemaphore(UNUSED struct vn_dispatch_context *dispatch,
struct vn_command_vkSignalSemaphore *args) struct vn_command_vkSignalSemaphore *args)
{ {
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
vn_replace_vkSignalSemaphore_args_handle(args); vn_replace_vkSignalSemaphore_args_handle(args);
args->ret = dev->SignalSemaphore(args->device, args->pSignalInfo); args->ret = dev->SignalSemaphore(args->device, args->pSignalInfo);

@ -23,7 +23,7 @@ vkr_dispatch_vkCreateRenderPass2(struct vn_dispatch_context *dispatch,
struct vn_command_vkCreateRenderPass2 *args) struct vn_command_vkCreateRenderPass2 *args)
{ {
struct vkr_context *ctx = dispatch->data; struct vkr_context *ctx = dispatch->data;
struct vkr_device *dev = (struct vkr_device *)args->device; struct vkr_device *dev = vkr_device_from_handle(args->device);
struct vkr_render_pass *pass = vkr_context_alloc_object( struct vkr_render_pass *pass = vkr_context_alloc_object(
ctx, sizeof(*pass), VK_OBJECT_TYPE_RENDER_PASS, args->pRenderPass); ctx, sizeof(*pass), VK_OBJECT_TYPE_RENDER_PASS, args->pRenderPass);

Loading…
Cancel
Save