vkr: remove manual object type validation

It is covered by vkr_cs_decoder_lookup_object.

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 df558bba34
commit e8b4029d0e
  1. 11
      src/venus/vkr_common.h
  2. 2
      src/venus/vkr_descriptor_set.c
  3. 5
      src/venus/vkr_device_memory.c

@ -74,11 +74,8 @@
#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; \
if (!obj || obj->base.type != VK_OBJECT_TYPE_##vk_obj) { \
if (obj) \
vkr_cs_decoder_set_fatal(&ctx->decoder); \
if (!obj) \
return; \
} \
\
vn_replace_##vk_cmd##_args_handle(args); \
vk_cmd(args->device, args->vk_arg, NULL); \
@ -92,7 +89,7 @@
\
struct vkr_##vkr_pool_type *pool = \
(struct vkr_##vkr_pool_type *)(uintptr_t)args->pAllocateInfo->arg_pool; \
if (!pool || pool->base.type != VK_OBJECT_TYPE_##vk_pool_type) { \
if (!pool) { \
vkr_cs_decoder_set_fatal(&ctx->decoder); \
return; \
} \
@ -137,10 +134,6 @@
struct vkr_##vkr_type *obj = (struct vkr_##vkr_type *)args->arg_obj[i]; \
if (!obj) \
continue; \
if (obj->base.type != VK_OBJECT_TYPE_##vk_type) { \
vkr_cs_decoder_set_fatal(&ctx->decoder); \
return; \
} \
\
list_del(&obj->base.track_head); \
list_addtail(&obj->base.track_head, &free_list); \

@ -83,7 +83,7 @@ vkr_dispatch_vkResetDescriptorPool(struct vn_dispatch_context *dispatch,
struct vkr_descriptor_pool *pool =
(struct vkr_descriptor_pool *)(uintptr_t)args->descriptorPool;
if (!pool || pool->base.type != VK_OBJECT_TYPE_DESCRIPTOR_POOL) {
if (!pool) {
vkr_cs_decoder_set_fatal(&ctx->decoder);
return;
}

@ -160,11 +160,8 @@ vkr_dispatch_vkFreeMemory(struct vn_dispatch_context *dispatch,
struct vkr_context *ctx = dispatch->data;
struct vkr_device_memory *mem = (struct vkr_device_memory *)(uintptr_t)args->memory;
if (!mem || mem->base.type != VK_OBJECT_TYPE_DEVICE_MEMORY) {
if (mem)
vkr_cs_decoder_set_fatal(&ctx->decoder);
if (!mem)
return;
}
vn_replace_vkFreeMemory_args_handle(args);
vkFreeMemory(args->device, args->memory, NULL);

Loading…
Cancel
Save