vkr: update venus-protocol headers

Add support for external memory fd properties query and import
- vkGetMemoryResourcePropertiesMESA
- VkImportMemoryResourceInfoMESA
- VkMemoryResourcePropertiesMESA

This is a huge commit because it also includes the change which splits
the headers by handle types.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 4 years ago committed by Chia-I Wu
parent 523fdbdce9
commit 9aa596875b
  1. 32
      src/venus-protocol/vn_protocol_renderer.h
  2. 1040
      src/venus-protocol/vn_protocol_renderer_buffer.h
  3. 200
      src/venus-protocol/vn_protocol_renderer_buffer_view.h
  4. 4689
      src/venus-protocol/vn_protocol_renderer_command_buffer.h
  5. 292
      src/venus-protocol/vn_protocol_renderer_command_pool.h
  6. 6655
      src/venus-protocol/vn_protocol_renderer_commands.h
  7. 2
      src/venus-protocol/vn_protocol_renderer_cs.h
  8. 42
      src/venus-protocol/vn_protocol_renderer_defines.h
  9. 280
      src/venus-protocol/vn_protocol_renderer_descriptor_pool.h
  10. 609
      src/venus-protocol/vn_protocol_renderer_descriptor_set.h
  11. 532
      src/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h
  12. 242
      src/venus-protocol/vn_protocol_renderer_descriptor_update_template.h
  13. 8978
      src/venus-protocol/vn_protocol_renderer_device.h
  14. 920
      src/venus-protocol/vn_protocol_renderer_device_memory.h
  15. 4587
      src/venus-protocol/vn_protocol_renderer_dispatches.h
  16. 345
      src/venus-protocol/vn_protocol_renderer_event.h
  17. 460
      src/venus-protocol/vn_protocol_renderer_fence.h
  18. 385
      src/venus-protocol/vn_protocol_renderer_framebuffer.h
  19. 2
      src/venus-protocol/vn_protocol_renderer_handles.h
  20. 1684
      src/venus-protocol/vn_protocol_renderer_image.h
  21. 292
      src/venus-protocol/vn_protocol_renderer_image_view.h
  22. 2
      src/venus-protocol/vn_protocol_renderer_info.h
  23. 526
      src/venus-protocol/vn_protocol_renderer_instance.h
  24. 1534
      src/venus-protocol/vn_protocol_renderer_pipeline.h
  25. 349
      src/venus-protocol/vn_protocol_renderer_pipeline_cache.h
  26. 242
      src/venus-protocol/vn_protocol_renderer_pipeline_layout.h
  27. 326
      src/venus-protocol/vn_protocol_renderer_query_pool.h
  28. 943
      src/venus-protocol/vn_protocol_renderer_queue.h
  29. 1428
      src/venus-protocol/vn_protocol_renderer_render_pass.h
  30. 312
      src/venus-protocol/vn_protocol_renderer_sampler.h
  31. 206
      src/venus-protocol/vn_protocol_renderer_sampler_ycbcr_conversion.h
  32. 625
      src/venus-protocol/vn_protocol_renderer_semaphore.h
  33. 204
      src/venus-protocol/vn_protocol_renderer_shader_module.h
  34. 17237
      src/venus-protocol/vn_protocol_renderer_structs.h
  35. 581
      src/venus-protocol/vn_protocol_renderer_transport.h
  36. 2
      src/venus-protocol/vn_protocol_renderer_types.h

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC
@ -18,9 +18,35 @@
#include "vn_protocol_renderer_info.h" #include "vn_protocol_renderer_info.h"
#include "vn_protocol_renderer_types.h" #include "vn_protocol_renderer_types.h"
#include "vn_protocol_renderer_handles.h" #include "vn_protocol_renderer_handles.h"
#include "vn_protocol_renderer_structs.h"
#include "vn_protocol_renderer_commands.h"
#include "vn_protocol_renderer_dispatches.h" #include "vn_protocol_renderer_dispatches.h"
#include "vn_protocol_renderer_structs.h"
#include "vn_protocol_renderer_transport.h"
#include "vn_protocol_renderer_instance.h"
#include "vn_protocol_renderer_device.h"
#include "vn_protocol_renderer_queue.h"
#include "vn_protocol_renderer_fence.h"
#include "vn_protocol_renderer_semaphore.h"
#include "vn_protocol_renderer_event.h"
#include "vn_protocol_renderer_device_memory.h"
#include "vn_protocol_renderer_image.h"
#include "vn_protocol_renderer_image_view.h"
#include "vn_protocol_renderer_sampler.h"
#include "vn_protocol_renderer_sampler_ycbcr_conversion.h"
#include "vn_protocol_renderer_buffer.h"
#include "vn_protocol_renderer_buffer_view.h"
#include "vn_protocol_renderer_descriptor_pool.h"
#include "vn_protocol_renderer_descriptor_set.h"
#include "vn_protocol_renderer_descriptor_set_layout.h"
#include "vn_protocol_renderer_descriptor_update_template.h"
#include "vn_protocol_renderer_render_pass.h"
#include "vn_protocol_renderer_framebuffer.h"
#include "vn_protocol_renderer_query_pool.h"
#include "vn_protocol_renderer_shader_module.h"
#include "vn_protocol_renderer_pipeline.h"
#include "vn_protocol_renderer_pipeline_layout.h"
#include "vn_protocol_renderer_pipeline_cache.h"
#include "vn_protocol_renderer_command_pool.h"
#include "vn_protocol_renderer_command_buffer.h"
#pragma GCC diagnostic pop #pragma GCC diagnostic pop

File diff suppressed because it is too large Load Diff

@ -0,0 +1,200 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_BUFFER_VIEW_H
#define VN_PROTOCOL_RENDERER_BUFFER_VIEW_H
#include "vn_protocol_renderer_structs.h"
/* struct VkBufferViewCreateInfo chain */
static inline void *
vn_decode_VkBufferViewCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkBufferViewCreateInfo_self_temp(struct vn_cs_decoder *dec, VkBufferViewCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkBuffer_lookup(dec, &val->buffer);
vn_decode_VkFormat(dec, &val->format);
vn_decode_VkDeviceSize(dec, &val->offset);
vn_decode_VkDeviceSize(dec, &val->range);
}
static inline void
vn_decode_VkBufferViewCreateInfo_temp(struct vn_cs_decoder *dec, VkBufferViewCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkBufferViewCreateInfo_pnext_temp(dec);
vn_decode_VkBufferViewCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkBufferViewCreateInfo_handle_self(VkBufferViewCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
vn_replace_VkBuffer_handle(&val->buffer);
/* skip val->format */
/* skip val->offset */
/* skip val->range */
}
static inline void
vn_replace_VkBufferViewCreateInfo_handle(VkBufferViewCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO:
vn_replace_VkBufferViewCreateInfo_handle_self((VkBufferViewCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateBufferView_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateBufferView *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkBufferViewCreateInfo_temp(dec, (VkBufferViewCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pView = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pView));
if (!args->pView) return;
vn_decode_VkBufferView(dec, args->pView);
} else {
args->pView = NULL;
}
}
static inline void vn_replace_vkCreateBufferView_args_handle(struct vn_command_vkCreateBufferView *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkBufferViewCreateInfo_handle((VkBufferViewCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pView */
}
static inline void vn_encode_vkCreateBufferView_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateBufferView *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateBufferView_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pView))
vn_encode_VkBufferView(enc, args->pView);
}
static inline void vn_decode_vkDestroyBufferView_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyBufferView *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkBufferView_lookup(dec, &args->bufferView);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyBufferView_args_handle(struct vn_command_vkDestroyBufferView *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkBufferView_handle(&args->bufferView);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyBufferView_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyBufferView *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyBufferView_EXT});
/* skip args->device */
/* skip args->bufferView */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateBufferView(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateBufferView args;
if (!ctx->dispatch_vkCreateBufferView) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateBufferView_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateBufferView(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateBufferView returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateBufferView_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyBufferView(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyBufferView args;
if (!ctx->dispatch_vkDestroyBufferView) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyBufferView_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyBufferView(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyBufferView_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_BUFFER_VIEW_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,292 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_COMMAND_POOL_H
#define VN_PROTOCOL_RENDERER_COMMAND_POOL_H
#include "vn_protocol_renderer_structs.h"
/* struct VkCommandPoolCreateInfo chain */
static inline void *
vn_decode_VkCommandPoolCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkCommandPoolCreateInfo_self_temp(struct vn_cs_decoder *dec, VkCommandPoolCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->queueFamilyIndex);
}
static inline void
vn_decode_VkCommandPoolCreateInfo_temp(struct vn_cs_decoder *dec, VkCommandPoolCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkCommandPoolCreateInfo_pnext_temp(dec);
vn_decode_VkCommandPoolCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkCommandPoolCreateInfo_handle_self(VkCommandPoolCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->queueFamilyIndex */
}
static inline void
vn_replace_VkCommandPoolCreateInfo_handle(VkCommandPoolCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO:
vn_replace_VkCommandPoolCreateInfo_handle_self((VkCommandPoolCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateCommandPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateCommandPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkCommandPoolCreateInfo_temp(dec, (VkCommandPoolCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pCommandPool = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCommandPool));
if (!args->pCommandPool) return;
vn_decode_VkCommandPool(dec, args->pCommandPool);
} else {
args->pCommandPool = NULL;
}
}
static inline void vn_replace_vkCreateCommandPool_args_handle(struct vn_command_vkCreateCommandPool *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkCommandPoolCreateInfo_handle((VkCommandPoolCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pCommandPool */
}
static inline void vn_encode_vkCreateCommandPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateCommandPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateCommandPool_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pCommandPool))
vn_encode_VkCommandPool(enc, args->pCommandPool);
}
static inline void vn_decode_vkDestroyCommandPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyCommandPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkCommandPool_lookup(dec, &args->commandPool);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyCommandPool_args_handle(struct vn_command_vkDestroyCommandPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkCommandPool_handle(&args->commandPool);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyCommandPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyCommandPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyCommandPool_EXT});
/* skip args->device */
/* skip args->commandPool */
/* skip args->pAllocator */
}
static inline void vn_decode_vkResetCommandPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkResetCommandPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkCommandPool_lookup(dec, &args->commandPool);
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkResetCommandPool_args_handle(struct vn_command_vkResetCommandPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkCommandPool_handle(&args->commandPool);
/* skip args->flags */
}
static inline void vn_encode_vkResetCommandPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkResetCommandPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkResetCommandPool_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->commandPool */
/* skip args->flags */
}
static inline void vn_decode_vkTrimCommandPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkTrimCommandPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkCommandPool_lookup(dec, &args->commandPool);
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkTrimCommandPool_args_handle(struct vn_command_vkTrimCommandPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkCommandPool_handle(&args->commandPool);
/* skip args->flags */
}
static inline void vn_encode_vkTrimCommandPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkTrimCommandPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkTrimCommandPool_EXT});
/* skip args->device */
/* skip args->commandPool */
/* skip args->flags */
}
static inline void vn_dispatch_vkCreateCommandPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateCommandPool args;
if (!ctx->dispatch_vkCreateCommandPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateCommandPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateCommandPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateCommandPool returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateCommandPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyCommandPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyCommandPool args;
if (!ctx->dispatch_vkDestroyCommandPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyCommandPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyCommandPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyCommandPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkResetCommandPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkResetCommandPool args;
if (!ctx->dispatch_vkResetCommandPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkResetCommandPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkResetCommandPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkResetCommandPool returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkResetCommandPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkTrimCommandPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkTrimCommandPool args;
if (!ctx->dispatch_vkTrimCommandPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkTrimCommandPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkTrimCommandPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkTrimCommandPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_COMMAND_POOL_H */

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC
@ -8,8 +8,10 @@
#ifndef VN_PROTOCOL_RENDERER_DEFINES_H #ifndef VN_PROTOCOL_RENDERER_DEFINES_H
#define VN_PROTOCOL_RENDERER_DEFINES_H #define VN_PROTOCOL_RENDERER_DEFINES_H
#include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include "vulkan.h" #include "vulkan.h"
@ -17,6 +19,8 @@
/* VkStructureType */ /* VkStructureType */
#define VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA ((VkStructureType)1000384000) #define VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA ((VkStructureType)1000384000)
#define VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA ((VkStructureType)1000384001)
#define VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA ((VkStructureType)1000384002)
typedef enum VkCommandTypeEXT { typedef enum VkCommandTypeEXT {
VK_COMMAND_TYPE_vkCreateInstance_EXT = 0, VK_COMMAND_TYPE_vkCreateInstance_EXT = 0,
@ -253,6 +257,7 @@ typedef enum VkCommandTypeEXT {
VK_COMMAND_TYPE_vkDestroyRingMESA_EXT = 189, VK_COMMAND_TYPE_vkDestroyRingMESA_EXT = 189,
VK_COMMAND_TYPE_vkNotifyRingMESA_EXT = 190, VK_COMMAND_TYPE_vkNotifyRingMESA_EXT = 190,
VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT = 191, VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT = 191,
VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT = 192,
} VkCommandTypeEXT; } VkCommandTypeEXT;
typedef enum VkCommandFlagBitsEXT { typedef enum VkCommandFlagBitsEXT {
@ -295,6 +300,18 @@ typedef struct VkRingCreateInfoMESA {
size_t extraSize; size_t extraSize;
} VkRingCreateInfoMESA; } VkRingCreateInfoMESA;
typedef struct VkMemoryResourcePropertiesMESA {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryResourcePropertiesMESA;
typedef struct VkImportMemoryResourceInfoMESA {
VkStructureType sType;
const void* pNext;
uint32_t resourceId;
} VkImportMemoryResourceInfoMESA;
struct vn_command_vkCreateInstance { struct vn_command_vkCreateInstance {
const VkInstanceCreateInfo* pCreateInfo; const VkInstanceCreateInfo* pCreateInfo;
const VkAllocationCallbacks* pAllocator; const VkAllocationCallbacks* pAllocator;
@ -1721,6 +1738,14 @@ struct vn_command_vkWriteRingExtraMESA {
uint32_t value; uint32_t value;
}; };
struct vn_command_vkGetMemoryResourcePropertiesMESA {
VkDevice device;
uint32_t resourceId;
VkMemoryResourcePropertiesMESA* pMemoryResourceProperties;
VkResult ret;
};
struct vn_dispatch_context { struct vn_dispatch_context {
void *data; void *data;
void (*debug_log)(struct vn_dispatch_context *ctx, const char *msg); void (*debug_log)(struct vn_dispatch_context *ctx, const char *msg);
@ -1920,6 +1945,21 @@ struct vn_dispatch_context {
void (*dispatch_vkDestroyRingMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkDestroyRingMESA *args); void (*dispatch_vkDestroyRingMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkDestroyRingMESA *args);
void (*dispatch_vkNotifyRingMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkNotifyRingMESA *args); void (*dispatch_vkNotifyRingMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkNotifyRingMESA *args);
void (*dispatch_vkWriteRingExtraMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkWriteRingExtraMESA *args); void (*dispatch_vkWriteRingExtraMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkWriteRingExtraMESA *args);
void (*dispatch_vkGetMemoryResourcePropertiesMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkGetMemoryResourcePropertiesMESA *args);
}; };
static inline void vn_dispatch_debug_log(struct vn_dispatch_context *ctx, const char *format, ...)
{
char msg[256];
va_list va;
if (!ctx->debug_log)
return;
va_start(va, format);
vsnprintf(msg, sizeof(msg), format, va);
ctx->debug_log(ctx, msg);
va_end(va);
}
#endif /* VN_PROTOCOL_RENDERER_DEFINES_H */ #endif /* VN_PROTOCOL_RENDERER_DEFINES_H */

@ -0,0 +1,280 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_DESCRIPTOR_POOL_H
#define VN_PROTOCOL_RENDERER_DESCRIPTOR_POOL_H
#include "vn_protocol_renderer_structs.h"
/* struct VkDescriptorPoolSize */
static inline void
vn_decode_VkDescriptorPoolSize_temp(struct vn_cs_decoder *dec, VkDescriptorPoolSize *val)
{
vn_decode_VkDescriptorType(dec, &val->type);
vn_decode_uint32_t(dec, &val->descriptorCount);
}
static inline void
vn_replace_VkDescriptorPoolSize_handle(VkDescriptorPoolSize *val)
{
/* skip val->type */
/* skip val->descriptorCount */
}
/* struct VkDescriptorPoolCreateInfo chain */
static inline void *
vn_decode_VkDescriptorPoolCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDescriptorPoolCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorPoolCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->maxSets);
vn_decode_uint32_t(dec, &val->poolSizeCount);
if (vn_peek_array_size(dec)) {
val->pPoolSizes = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pPoolSizes) * val->poolSizeCount);
if (!val->pPoolSizes) return;
vn_decode_array_size(dec, val->poolSizeCount);
for (uint32_t i = 0; i < val->poolSizeCount; i++)
vn_decode_VkDescriptorPoolSize_temp(dec, &((VkDescriptorPoolSize *)val->pPoolSizes)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pPoolSizes = NULL;
}
}
static inline void
vn_decode_VkDescriptorPoolCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorPoolCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorPoolCreateInfo_pnext_temp(dec);
vn_decode_VkDescriptorPoolCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorPoolCreateInfo_handle_self(VkDescriptorPoolCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->maxSets */
/* skip val->poolSizeCount */
if (val->pPoolSizes) {
for (uint32_t i = 0; i < val->poolSizeCount; i++)
vn_replace_VkDescriptorPoolSize_handle(&((VkDescriptorPoolSize *)val->pPoolSizes)[i]);
}
}
static inline void
vn_replace_VkDescriptorPoolCreateInfo_handle(VkDescriptorPoolCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO:
vn_replace_VkDescriptorPoolCreateInfo_handle_self((VkDescriptorPoolCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateDescriptorPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateDescriptorPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkDescriptorPoolCreateInfo_temp(dec, (VkDescriptorPoolCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pDescriptorPool = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorPool));
if (!args->pDescriptorPool) return;
vn_decode_VkDescriptorPool(dec, args->pDescriptorPool);
} else {
args->pDescriptorPool = NULL;
}
}
static inline void vn_replace_vkCreateDescriptorPool_args_handle(struct vn_command_vkCreateDescriptorPool *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkDescriptorPoolCreateInfo_handle((VkDescriptorPoolCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pDescriptorPool */
}
static inline void vn_encode_vkCreateDescriptorPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateDescriptorPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateDescriptorPool_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pDescriptorPool))
vn_encode_VkDescriptorPool(enc, args->pDescriptorPool);
}
static inline void vn_decode_vkDestroyDescriptorPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyDescriptorPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDescriptorPool_lookup(dec, &args->descriptorPool);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyDescriptorPool_args_handle(struct vn_command_vkDestroyDescriptorPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDescriptorPool_handle(&args->descriptorPool);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyDescriptorPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyDescriptorPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyDescriptorPool_EXT});
/* skip args->device */
/* skip args->descriptorPool */
/* skip args->pAllocator */
}
static inline void vn_decode_vkResetDescriptorPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkResetDescriptorPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDescriptorPool_lookup(dec, &args->descriptorPool);
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkResetDescriptorPool_args_handle(struct vn_command_vkResetDescriptorPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDescriptorPool_handle(&args->descriptorPool);
/* skip args->flags */
}
static inline void vn_encode_vkResetDescriptorPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkResetDescriptorPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkResetDescriptorPool_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->descriptorPool */
/* skip args->flags */
}
static inline void vn_dispatch_vkCreateDescriptorPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateDescriptorPool args;
if (!ctx->dispatch_vkCreateDescriptorPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateDescriptorPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateDescriptorPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateDescriptorPool returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateDescriptorPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyDescriptorPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyDescriptorPool args;
if (!ctx->dispatch_vkDestroyDescriptorPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyDescriptorPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyDescriptorPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyDescriptorPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkResetDescriptorPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkResetDescriptorPool args;
if (!ctx->dispatch_vkResetDescriptorPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkResetDescriptorPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkResetDescriptorPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkResetDescriptorPool returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkResetDescriptorPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_POOL_H */

@ -0,0 +1,609 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_H
#define VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_H
#include "vn_protocol_renderer_structs.h"
/*
* These structs/unions/commands are not included
*
* vkUpdateDescriptorSetWithTemplate
*/
/* struct VkDescriptorSetVariableDescriptorCountAllocateInfo chain */
static inline void *
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->descriptorSetCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->descriptorSetCount);
val->pDescriptorCounts = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pDescriptorCounts) * array_size);
if (!val->pDescriptorCounts) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pDescriptorCounts, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pDescriptorCounts = NULL;
}
}
static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self(VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->descriptorSetCount */
/* skip val->pDescriptorCounts */
}
static inline void
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle(VkDescriptorSetVariableDescriptorCountAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self((VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkDescriptorSetAllocateInfo chain */
static inline void *
vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetVariableDescriptorCountAllocateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(dec, (VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkDescriptorSetAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDescriptorPool_lookup(dec, &val->descriptorPool);
vn_decode_uint32_t(dec, &val->descriptorSetCount);
if (vn_peek_array_size(dec)) {
val->pSetLayouts = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSetLayouts) * val->descriptorSetCount);
if (!val->pSetLayouts) return;
vn_decode_array_size(dec, val->descriptorSetCount);
for (uint32_t i = 0; i < val->descriptorSetCount; i++)
vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pSetLayouts = NULL;
}
}
static inline void
vn_decode_VkDescriptorSetAllocateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetAllocateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorSetAllocateInfo_handle_self(VkDescriptorSetAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkDescriptorPool_handle(&val->descriptorPool);
/* skip val->descriptorSetCount */
if (val->pSetLayouts) {
for (uint32_t i = 0; i < val->descriptorSetCount; i++)
vn_replace_VkDescriptorSetLayout_handle(&((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
}
}
static inline void
vn_replace_VkDescriptorSetAllocateInfo_handle(VkDescriptorSetAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO:
vn_replace_VkDescriptorSetAllocateInfo_handle_self((VkDescriptorSetAllocateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
vn_replace_VkDescriptorSetVariableDescriptorCountAllocateInfo_handle_self((VkDescriptorSetVariableDescriptorCountAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkDescriptorImageInfo */
static inline void
vn_decode_VkDescriptorImageInfo_temp(struct vn_cs_decoder *dec, VkDescriptorImageInfo *val)
{
vn_decode_VkSampler_lookup(dec, &val->sampler);
vn_decode_VkImageView_lookup(dec, &val->imageView);
vn_decode_VkImageLayout(dec, &val->imageLayout);
}
static inline void
vn_replace_VkDescriptorImageInfo_handle(VkDescriptorImageInfo *val)
{
vn_replace_VkSampler_handle(&val->sampler);
vn_replace_VkImageView_handle(&val->imageView);
/* skip val->imageLayout */
}
/* struct VkDescriptorBufferInfo */
static inline void
vn_decode_VkDescriptorBufferInfo_temp(struct vn_cs_decoder *dec, VkDescriptorBufferInfo *val)
{
vn_decode_VkBuffer_lookup(dec, &val->buffer);
vn_decode_VkDeviceSize(dec, &val->offset);
vn_decode_VkDeviceSize(dec, &val->range);
}
static inline void
vn_replace_VkDescriptorBufferInfo_handle(VkDescriptorBufferInfo *val)
{
vn_replace_VkBuffer_handle(&val->buffer);
/* skip val->offset */
/* skip val->range */
}
/* struct VkWriteDescriptorSet chain */
static inline void *
vn_decode_VkWriteDescriptorSet_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkWriteDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkWriteDescriptorSet *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDescriptorSet_lookup(dec, &val->dstSet);
vn_decode_uint32_t(dec, &val->dstBinding);
vn_decode_uint32_t(dec, &val->dstArrayElement);
vn_decode_uint32_t(dec, &val->descriptorCount);
vn_decode_VkDescriptorType(dec, &val->descriptorType);
if (vn_peek_array_size(dec)) {
val->pImageInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pImageInfo) * val->descriptorCount);
if (!val->pImageInfo) return;
vn_decode_array_size(dec, val->descriptorCount);
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_decode_VkDescriptorImageInfo_temp(dec, &((VkDescriptorImageInfo *)val->pImageInfo)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pImageInfo = NULL;
}
if (vn_peek_array_size(dec)) {
val->pBufferInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBufferInfo) * val->descriptorCount);
if (!val->pBufferInfo) return;
vn_decode_array_size(dec, val->descriptorCount);
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_decode_VkDescriptorBufferInfo_temp(dec, &((VkDescriptorBufferInfo *)val->pBufferInfo)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBufferInfo = NULL;
}
if (vn_peek_array_size(dec)) {
val->pTexelBufferView = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pTexelBufferView) * val->descriptorCount);
if (!val->pTexelBufferView) return;
vn_decode_array_size(dec, val->descriptorCount);
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_decode_VkBufferView_lookup(dec, &((VkBufferView *)val->pTexelBufferView)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pTexelBufferView = NULL;
}
}
static inline void
vn_decode_VkWriteDescriptorSet_temp(struct vn_cs_decoder *dec, VkWriteDescriptorSet *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET);
val->sType = stype;
val->pNext = vn_decode_VkWriteDescriptorSet_pnext_temp(dec);
vn_decode_VkWriteDescriptorSet_self_temp(dec, val);
}
static inline void
vn_replace_VkWriteDescriptorSet_handle_self(VkWriteDescriptorSet *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkDescriptorSet_handle(&val->dstSet);
/* skip val->dstBinding */
/* skip val->dstArrayElement */
/* skip val->descriptorCount */
/* skip val->descriptorType */
if (val->pImageInfo) {
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_replace_VkDescriptorImageInfo_handle(&((VkDescriptorImageInfo *)val->pImageInfo)[i]);
}
if (val->pBufferInfo) {
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_replace_VkDescriptorBufferInfo_handle(&((VkDescriptorBufferInfo *)val->pBufferInfo)[i]);
}
if (val->pTexelBufferView) {
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_replace_VkBufferView_handle(&((VkBufferView *)val->pTexelBufferView)[i]);
}
}
static inline void
vn_replace_VkWriteDescriptorSet_handle(VkWriteDescriptorSet *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
vn_replace_VkWriteDescriptorSet_handle_self((VkWriteDescriptorSet *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkCopyDescriptorSet chain */
static inline void *
vn_decode_VkCopyDescriptorSet_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkCopyDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkCopyDescriptorSet *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDescriptorSet_lookup(dec, &val->srcSet);
vn_decode_uint32_t(dec, &val->srcBinding);
vn_decode_uint32_t(dec, &val->srcArrayElement);
vn_decode_VkDescriptorSet_lookup(dec, &val->dstSet);
vn_decode_uint32_t(dec, &val->dstBinding);
vn_decode_uint32_t(dec, &val->dstArrayElement);
vn_decode_uint32_t(dec, &val->descriptorCount);
}
static inline void
vn_decode_VkCopyDescriptorSet_temp(struct vn_cs_decoder *dec, VkCopyDescriptorSet *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET);
val->sType = stype;
val->pNext = vn_decode_VkCopyDescriptorSet_pnext_temp(dec);
vn_decode_VkCopyDescriptorSet_self_temp(dec, val);
}
static inline void
vn_replace_VkCopyDescriptorSet_handle_self(VkCopyDescriptorSet *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkDescriptorSet_handle(&val->srcSet);
/* skip val->srcBinding */
/* skip val->srcArrayElement */
vn_replace_VkDescriptorSet_handle(&val->dstSet);
/* skip val->dstBinding */
/* skip val->dstArrayElement */
/* skip val->descriptorCount */
}
static inline void
vn_replace_VkCopyDescriptorSet_handle(VkCopyDescriptorSet *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
vn_replace_VkCopyDescriptorSet_handle_self((VkCopyDescriptorSet *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkAllocateDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkAllocateDescriptorSets *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pAllocateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pAllocateInfo));
if (!args->pAllocateInfo) return;
vn_decode_VkDescriptorSetAllocateInfo_temp(dec, (VkDescriptorSetAllocateInfo *)args->pAllocateInfo);
} else {
args->pAllocateInfo = NULL;
}
if (vn_peek_array_size(dec)) {
args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * args->pAllocateInfo->descriptorSetCount);
if (!args->pDescriptorSets) return;
vn_decode_array_size(dec, args->pAllocateInfo->descriptorSetCount);
for (uint32_t i = 0; i < args->pAllocateInfo->descriptorSetCount; i++)
vn_decode_VkDescriptorSet(dec, &args->pDescriptorSets[i]);
} else {
vn_decode_array_size(dec, 0);
args->pDescriptorSets = NULL;
}
}
static inline void vn_replace_vkAllocateDescriptorSets_args_handle(struct vn_command_vkAllocateDescriptorSets *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pAllocateInfo)
vn_replace_VkDescriptorSetAllocateInfo_handle((VkDescriptorSetAllocateInfo *)args->pAllocateInfo);
/* skip args->pDescriptorSets */
}
static inline void vn_encode_vkAllocateDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkAllocateDescriptorSets *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkAllocateDescriptorSets_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pAllocateInfo */
if (args->pDescriptorSets) {
vn_encode_array_size(enc, args->pAllocateInfo->descriptorSetCount);
for (uint32_t i = 0; i < args->pAllocateInfo->descriptorSetCount; i++)
vn_encode_VkDescriptorSet(enc, &args->pDescriptorSets[i]);
} else {
vn_encode_array_size(enc, 0);
}
}
static inline void vn_decode_vkFreeDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFreeDescriptorSets *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDescriptorPool_lookup(dec, &args->descriptorPool);
vn_decode_uint32_t(dec, &args->descriptorSetCount);
if (vn_peek_array_size(dec)) {
args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * args->descriptorSetCount);
if (!args->pDescriptorSets) return;
vn_decode_array_size(dec, args->descriptorSetCount);
for (uint32_t i = 0; i < args->descriptorSetCount; i++)
vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pDescriptorSets = NULL;
}
}
static inline void vn_replace_vkFreeDescriptorSets_args_handle(struct vn_command_vkFreeDescriptorSets *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDescriptorPool_handle(&args->descriptorPool);
/* skip args->descriptorSetCount */
if (args->pDescriptorSets) {
for (uint32_t i = 0; i < args->descriptorSetCount; i++)
vn_replace_VkDescriptorSet_handle(&((VkDescriptorSet *)args->pDescriptorSets)[i]);
}
}
static inline void vn_encode_vkFreeDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFreeDescriptorSets *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFreeDescriptorSets_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->descriptorPool */
/* skip args->descriptorSetCount */
/* skip args->pDescriptorSets */
}
static inline void vn_decode_vkUpdateDescriptorSets_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkUpdateDescriptorSets *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->descriptorWriteCount);
if (vn_peek_array_size(dec)) {
args->pDescriptorWrites = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorWrites) * args->descriptorWriteCount);
if (!args->pDescriptorWrites) return;
vn_decode_array_size(dec, args->descriptorWriteCount);
for (uint32_t i = 0; i < args->descriptorWriteCount; i++)
vn_decode_VkWriteDescriptorSet_temp(dec, &((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pDescriptorWrites = NULL;
}
vn_decode_uint32_t(dec, &args->descriptorCopyCount);
if (vn_peek_array_size(dec)) {
args->pDescriptorCopies = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorCopies) * args->descriptorCopyCount);
if (!args->pDescriptorCopies) return;
vn_decode_array_size(dec, args->descriptorCopyCount);
for (uint32_t i = 0; i < args->descriptorCopyCount; i++)
vn_decode_VkCopyDescriptorSet_temp(dec, &((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pDescriptorCopies = NULL;
}
}
static inline void vn_replace_vkUpdateDescriptorSets_args_handle(struct vn_command_vkUpdateDescriptorSets *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->descriptorWriteCount */
if (args->pDescriptorWrites) {
for (uint32_t i = 0; i < args->descriptorWriteCount; i++)
vn_replace_VkWriteDescriptorSet_handle(&((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]);
}
/* skip args->descriptorCopyCount */
if (args->pDescriptorCopies) {
for (uint32_t i = 0; i < args->descriptorCopyCount; i++)
vn_replace_VkCopyDescriptorSet_handle(&((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]);
}
}
static inline void vn_encode_vkUpdateDescriptorSets_reply(struct vn_cs_encoder *enc, const struct vn_command_vkUpdateDescriptorSets *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkUpdateDescriptorSets_EXT});
/* skip args->device */
/* skip args->descriptorWriteCount */
/* skip args->pDescriptorWrites */
/* skip args->descriptorCopyCount */
/* skip args->pDescriptorCopies */
}
static inline void vn_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkAllocateDescriptorSets args;
if (!ctx->dispatch_vkAllocateDescriptorSets) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkAllocateDescriptorSets_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkAllocateDescriptorSets(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkAllocateDescriptorSets returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkAllocateDescriptorSets_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkFreeDescriptorSets args;
if (!ctx->dispatch_vkFreeDescriptorSets) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkFreeDescriptorSets_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkFreeDescriptorSets(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkFreeDescriptorSets returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkFreeDescriptorSets_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkUpdateDescriptorSets(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkUpdateDescriptorSets args;
if (!ctx->dispatch_vkUpdateDescriptorSets) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkUpdateDescriptorSets_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkUpdateDescriptorSets(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkUpdateDescriptorSets_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_H */

@ -0,0 +1,532 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_LAYOUT_H
#define VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_LAYOUT_H
#include "vn_protocol_renderer_structs.h"
/* struct VkDescriptorSetLayoutBinding */
static inline void
vn_decode_VkDescriptorSetLayoutBinding_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBinding *val)
{
vn_decode_uint32_t(dec, &val->binding);
vn_decode_VkDescriptorType(dec, &val->descriptorType);
vn_decode_uint32_t(dec, &val->descriptorCount);
vn_decode_VkFlags(dec, &val->stageFlags);
if (vn_peek_array_size(dec)) {
val->pImmutableSamplers = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pImmutableSamplers) * val->descriptorCount);
if (!val->pImmutableSamplers) return;
vn_decode_array_size(dec, val->descriptorCount);
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_decode_VkSampler_lookup(dec, &((VkSampler *)val->pImmutableSamplers)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pImmutableSamplers = NULL;
}
}
static inline void
vn_replace_VkDescriptorSetLayoutBinding_handle(VkDescriptorSetLayoutBinding *val)
{
/* skip val->binding */
/* skip val->descriptorType */
/* skip val->descriptorCount */
/* skip val->stageFlags */
if (val->pImmutableSamplers) {
for (uint32_t i = 0; i < val->descriptorCount; i++)
vn_replace_VkSampler_handle(&((VkSampler *)val->pImmutableSamplers)[i]);
}
}
/* struct VkDescriptorSetLayoutBindingFlagsCreateInfo chain */
static inline void *
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->bindingCount);
if (vn_peek_array_size(dec)) {
val->pBindingFlags = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBindingFlags) * val->bindingCount);
if (!val->pBindingFlags) return;
vn_decode_array_size(dec, val->bindingCount);
for (uint32_t i = 0; i < val->bindingCount; i++)
vn_decode_VkFlags(dec, &((VkDescriptorBindingFlags *)val->pBindingFlags)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBindingFlags = NULL;
}
}
static inline void
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self(VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->bindingCount */
/* skip val->pBindingFlags */
}
static inline void
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle(VkDescriptorSetLayoutBindingFlagsCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self((VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkDescriptorSetLayoutCreateInfo chain */
static inline void *
vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetLayoutBindingFlagsCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(dec, (VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->bindingCount);
if (vn_peek_array_size(dec)) {
val->pBindings = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBindings) * val->bindingCount);
if (!val->pBindings) return;
vn_decode_array_size(dec, val->bindingCount);
for (uint32_t i = 0; i < val->bindingCount; i++)
vn_decode_VkDescriptorSetLayoutBinding_temp(dec, &((VkDescriptorSetLayoutBinding *)val->pBindings)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBindings = NULL;
}
}
static inline void
vn_decode_VkDescriptorSetLayoutCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetLayoutCreateInfo_pnext_temp(dec);
vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorSetLayoutCreateInfo_handle_self(VkDescriptorSetLayoutCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->bindingCount */
if (val->pBindings) {
for (uint32_t i = 0; i < val->bindingCount; i++)
vn_replace_VkDescriptorSetLayoutBinding_handle(&((VkDescriptorSetLayoutBinding *)val->pBindings)[i]);
}
}
static inline void
vn_replace_VkDescriptorSetLayoutCreateInfo_handle(VkDescriptorSetLayoutCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO:
vn_replace_VkDescriptorSetLayoutCreateInfo_handle_self((VkDescriptorSetLayoutCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
vn_replace_VkDescriptorSetLayoutBindingFlagsCreateInfo_handle_self((VkDescriptorSetLayoutBindingFlagsCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkDescriptorSetVariableDescriptorCountLayoutSupport chain */
static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext(struct vn_cs_encoder *enc, const void *val)
{
/* no known/supported struct */
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
{
/* skip val->{sType,pNext} */
vn_encode_uint32_t(enc, &val->maxVariableDescriptorCount);
}
static inline void
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport(struct vn_cs_encoder *enc, const VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT });
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext(enc, val->pNext);
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(enc, val);
}
static inline void *
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext_partial_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
{
/* skip val->{sType,pNext} */
/* skip val->maxVariableDescriptorCount */
}
static inline void
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetVariableDescriptorCountLayoutSupport *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_pnext_partial_temp(dec);
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(dec, val);
}
/* struct VkDescriptorSetLayoutSupport chain */
static inline void
vn_encode_VkDescriptorSetLayoutSupport_pnext(struct vn_cs_encoder *enc, const void *val)
{
const VkBaseInStructure *pnext = val;
while (pnext) {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT:
vn_encode_simple_pointer(enc, pnext);
vn_encode_VkStructureType(enc, &pnext->sType);
vn_encode_VkDescriptorSetLayoutSupport_pnext(enc, pnext->pNext);
vn_encode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self(enc, (const VkDescriptorSetVariableDescriptorCountLayoutSupport *)pnext);
return;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
}
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkDescriptorSetLayoutSupport_self(struct vn_cs_encoder *enc, const VkDescriptorSetLayoutSupport *val)
{
/* skip val->{sType,pNext} */
vn_encode_VkBool32(enc, &val->supported);
}
static inline void
vn_encode_VkDescriptorSetLayoutSupport(struct vn_cs_encoder *enc, const VkDescriptorSetLayoutSupport *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT });
vn_encode_VkDescriptorSetLayoutSupport_pnext(enc, val->pNext);
vn_encode_VkDescriptorSetLayoutSupport_self(enc, val);
}
static inline void *
vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDescriptorSetVariableDescriptorCountLayoutSupport));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(dec);
vn_decode_VkDescriptorSetVariableDescriptorCountLayoutSupport_self_partial_temp(dec, (VkDescriptorSetVariableDescriptorCountLayoutSupport *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkDescriptorSetLayoutSupport_self_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutSupport *val)
{
/* skip val->{sType,pNext} */
/* skip val->supported */
}
static inline void
vn_decode_VkDescriptorSetLayoutSupport_partial_temp(struct vn_cs_decoder *dec, VkDescriptorSetLayoutSupport *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorSetLayoutSupport_pnext_partial_temp(dec);
vn_decode_VkDescriptorSetLayoutSupport_self_partial_temp(dec, val);
}
static inline void vn_decode_vkCreateDescriptorSetLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateDescriptorSetLayout *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkDescriptorSetLayoutCreateInfo_temp(dec, (VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pSetLayout = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSetLayout));
if (!args->pSetLayout) return;
vn_decode_VkDescriptorSetLayout(dec, args->pSetLayout);
} else {
args->pSetLayout = NULL;
}
}
static inline void vn_replace_vkCreateDescriptorSetLayout_args_handle(struct vn_command_vkCreateDescriptorSetLayout *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkDescriptorSetLayoutCreateInfo_handle((VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pSetLayout */
}
static inline void vn_encode_vkCreateDescriptorSetLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateDescriptorSetLayout *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateDescriptorSetLayout_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pSetLayout))
vn_encode_VkDescriptorSetLayout(enc, args->pSetLayout);
}
static inline void vn_decode_vkDestroyDescriptorSetLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyDescriptorSetLayout *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDescriptorSetLayout_lookup(dec, &args->descriptorSetLayout);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyDescriptorSetLayout_args_handle(struct vn_command_vkDestroyDescriptorSetLayout *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDescriptorSetLayout_handle(&args->descriptorSetLayout);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyDescriptorSetLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyDescriptorSetLayout *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyDescriptorSetLayout_EXT});
/* skip args->device */
/* skip args->descriptorSetLayout */
/* skip args->pAllocator */
}
static inline void vn_decode_vkGetDescriptorSetLayoutSupport_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDescriptorSetLayoutSupport *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkDescriptorSetLayoutCreateInfo_temp(dec, (VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pSupport = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSupport));
if (!args->pSupport) return;
vn_decode_VkDescriptorSetLayoutSupport_partial_temp(dec, args->pSupport);
} else {
args->pSupport = NULL;
}
}
static inline void vn_replace_vkGetDescriptorSetLayoutSupport_args_handle(struct vn_command_vkGetDescriptorSetLayoutSupport *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkDescriptorSetLayoutCreateInfo_handle((VkDescriptorSetLayoutCreateInfo *)args->pCreateInfo);
/* skip args->pSupport */
}
static inline void vn_encode_vkGetDescriptorSetLayoutSupport_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDescriptorSetLayoutSupport *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDescriptorSetLayoutSupport_EXT});
/* skip args->device */
/* skip args->pCreateInfo */
if (vn_encode_simple_pointer(enc, args->pSupport))
vn_encode_VkDescriptorSetLayoutSupport(enc, args->pSupport);
}
static inline void vn_dispatch_vkCreateDescriptorSetLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateDescriptorSetLayout args;
if (!ctx->dispatch_vkCreateDescriptorSetLayout) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateDescriptorSetLayout_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateDescriptorSetLayout(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateDescriptorSetLayout returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateDescriptorSetLayout_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyDescriptorSetLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyDescriptorSetLayout args;
if (!ctx->dispatch_vkDestroyDescriptorSetLayout) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyDescriptorSetLayout_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyDescriptorSetLayout(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyDescriptorSetLayout_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetDescriptorSetLayoutSupport(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetDescriptorSetLayoutSupport args;
if (!ctx->dispatch_vkGetDescriptorSetLayoutSupport) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetDescriptorSetLayoutSupport_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetDescriptorSetLayoutSupport(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetDescriptorSetLayoutSupport_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_SET_LAYOUT_H */

@ -0,0 +1,242 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_DESCRIPTOR_UPDATE_TEMPLATE_H
#define VN_PROTOCOL_RENDERER_DESCRIPTOR_UPDATE_TEMPLATE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkDescriptorUpdateTemplateEntry */
static inline void
vn_decode_VkDescriptorUpdateTemplateEntry_temp(struct vn_cs_decoder *dec, VkDescriptorUpdateTemplateEntry *val)
{
vn_decode_uint32_t(dec, &val->dstBinding);
vn_decode_uint32_t(dec, &val->dstArrayElement);
vn_decode_uint32_t(dec, &val->descriptorCount);
vn_decode_VkDescriptorType(dec, &val->descriptorType);
vn_decode_size_t(dec, &val->offset);
vn_decode_size_t(dec, &val->stride);
}
static inline void
vn_replace_VkDescriptorUpdateTemplateEntry_handle(VkDescriptorUpdateTemplateEntry *val)
{
/* skip val->dstBinding */
/* skip val->dstArrayElement */
/* skip val->descriptorCount */
/* skip val->descriptorType */
/* skip val->offset */
/* skip val->stride */
}
/* struct VkDescriptorUpdateTemplateCreateInfo chain */
static inline void *
vn_decode_VkDescriptorUpdateTemplateCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDescriptorUpdateTemplateCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDescriptorUpdateTemplateCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->descriptorUpdateEntryCount);
if (vn_peek_array_size(dec)) {
val->pDescriptorUpdateEntries = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pDescriptorUpdateEntries) * val->descriptorUpdateEntryCount);
if (!val->pDescriptorUpdateEntries) return;
vn_decode_array_size(dec, val->descriptorUpdateEntryCount);
for (uint32_t i = 0; i < val->descriptorUpdateEntryCount; i++)
vn_decode_VkDescriptorUpdateTemplateEntry_temp(dec, &((VkDescriptorUpdateTemplateEntry *)val->pDescriptorUpdateEntries)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pDescriptorUpdateEntries = NULL;
}
vn_decode_VkDescriptorUpdateTemplateType(dec, &val->templateType);
vn_decode_VkDescriptorSetLayout_lookup(dec, &val->descriptorSetLayout);
vn_decode_VkPipelineBindPoint(dec, &val->pipelineBindPoint);
vn_decode_VkPipelineLayout_lookup(dec, &val->pipelineLayout);
vn_decode_uint32_t(dec, &val->set);
}
static inline void
vn_decode_VkDescriptorUpdateTemplateCreateInfo_temp(struct vn_cs_decoder *dec, VkDescriptorUpdateTemplateCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDescriptorUpdateTemplateCreateInfo_pnext_temp(dec);
vn_decode_VkDescriptorUpdateTemplateCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDescriptorUpdateTemplateCreateInfo_handle_self(VkDescriptorUpdateTemplateCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->descriptorUpdateEntryCount */
if (val->pDescriptorUpdateEntries) {
for (uint32_t i = 0; i < val->descriptorUpdateEntryCount; i++)
vn_replace_VkDescriptorUpdateTemplateEntry_handle(&((VkDescriptorUpdateTemplateEntry *)val->pDescriptorUpdateEntries)[i]);
}
/* skip val->templateType */
vn_replace_VkDescriptorSetLayout_handle(&val->descriptorSetLayout);
/* skip val->pipelineBindPoint */
vn_replace_VkPipelineLayout_handle(&val->pipelineLayout);
/* skip val->set */
}
static inline void
vn_replace_VkDescriptorUpdateTemplateCreateInfo_handle(VkDescriptorUpdateTemplateCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO:
vn_replace_VkDescriptorUpdateTemplateCreateInfo_handle_self((VkDescriptorUpdateTemplateCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateDescriptorUpdateTemplate_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateDescriptorUpdateTemplate *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkDescriptorUpdateTemplateCreateInfo_temp(dec, (VkDescriptorUpdateTemplateCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pDescriptorUpdateTemplate = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorUpdateTemplate));
if (!args->pDescriptorUpdateTemplate) return;
vn_decode_VkDescriptorUpdateTemplate(dec, args->pDescriptorUpdateTemplate);
} else {
args->pDescriptorUpdateTemplate = NULL;
}
}
static inline void vn_replace_vkCreateDescriptorUpdateTemplate_args_handle(struct vn_command_vkCreateDescriptorUpdateTemplate *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkDescriptorUpdateTemplateCreateInfo_handle((VkDescriptorUpdateTemplateCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pDescriptorUpdateTemplate */
}
static inline void vn_encode_vkCreateDescriptorUpdateTemplate_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateDescriptorUpdateTemplate *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateDescriptorUpdateTemplate_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pDescriptorUpdateTemplate))
vn_encode_VkDescriptorUpdateTemplate(enc, args->pDescriptorUpdateTemplate);
}
static inline void vn_decode_vkDestroyDescriptorUpdateTemplate_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyDescriptorUpdateTemplate *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDescriptorUpdateTemplate_lookup(dec, &args->descriptorUpdateTemplate);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyDescriptorUpdateTemplate_args_handle(struct vn_command_vkDestroyDescriptorUpdateTemplate *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDescriptorUpdateTemplate_handle(&args->descriptorUpdateTemplate);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyDescriptorUpdateTemplate_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyDescriptorUpdateTemplate *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyDescriptorUpdateTemplate_EXT});
/* skip args->device */
/* skip args->descriptorUpdateTemplate */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateDescriptorUpdateTemplate(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateDescriptorUpdateTemplate args;
if (!ctx->dispatch_vkCreateDescriptorUpdateTemplate) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateDescriptorUpdateTemplate_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateDescriptorUpdateTemplate(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateDescriptorUpdateTemplate returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateDescriptorUpdateTemplate_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyDescriptorUpdateTemplate(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyDescriptorUpdateTemplate args;
if (!ctx->dispatch_vkDestroyDescriptorUpdateTemplate) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyDescriptorUpdateTemplate_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyDescriptorUpdateTemplate(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyDescriptorUpdateTemplate_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_DESCRIPTOR_UPDATE_TEMPLATE_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,920 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H
#define VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H
#include "vn_protocol_renderer_structs.h"
/*
* These structs/unions/commands are not included
*
* vkMapMemory
*/
/* struct VkExportMemoryAllocateInfo chain */
static inline void *
vn_decode_VkExportMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkExportMemoryAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkExportMemoryAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->handleTypes);
}
static inline void
vn_decode_VkExportMemoryAllocateInfo_temp(struct vn_cs_decoder *dec, VkExportMemoryAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkExportMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkExportMemoryAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkExportMemoryAllocateInfo_handle_self(VkExportMemoryAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->handleTypes */
}
static inline void
vn_replace_VkExportMemoryAllocateInfo_handle(VkExportMemoryAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
vn_replace_VkExportMemoryAllocateInfo_handle_self((VkExportMemoryAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMemoryAllocateFlagsInfo chain */
static inline void *
vn_decode_VkMemoryAllocateFlagsInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkMemoryAllocateFlagsInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryAllocateFlagsInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->deviceMask);
}
static inline void
vn_decode_VkMemoryAllocateFlagsInfo_temp(struct vn_cs_decoder *dec, VkMemoryAllocateFlagsInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO);
val->sType = stype;
val->pNext = vn_decode_VkMemoryAllocateFlagsInfo_pnext_temp(dec);
vn_decode_VkMemoryAllocateFlagsInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkMemoryAllocateFlagsInfo_handle_self(VkMemoryAllocateFlagsInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->deviceMask */
}
static inline void
vn_replace_VkMemoryAllocateFlagsInfo_handle(VkMemoryAllocateFlagsInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
vn_replace_VkMemoryAllocateFlagsInfo_handle_self((VkMemoryAllocateFlagsInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMemoryDedicatedAllocateInfo chain */
static inline void *
vn_decode_VkMemoryDedicatedAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryDedicatedAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkImage_lookup(dec, &val->image);
vn_decode_VkBuffer_lookup(dec, &val->buffer);
}
static inline void
vn_decode_VkMemoryDedicatedAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryDedicatedAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkMemoryDedicatedAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkMemoryDedicatedAllocateInfo_handle_self(VkMemoryDedicatedAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkImage_handle(&val->image);
vn_replace_VkBuffer_handle(&val->buffer);
}
static inline void
vn_replace_VkMemoryDedicatedAllocateInfo_handle(VkMemoryDedicatedAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
vn_replace_VkMemoryDedicatedAllocateInfo_handle_self((VkMemoryDedicatedAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMemoryOpaqueCaptureAddressAllocateInfo chain */
static inline void *
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryOpaqueCaptureAddressAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint64_t(dec, &val->opaqueCaptureAddress);
}
static inline void
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryOpaqueCaptureAddressAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self(VkMemoryOpaqueCaptureAddressAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->opaqueCaptureAddress */
}
static inline void
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle(VkMemoryOpaqueCaptureAddressAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self((VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMemoryAllocateInfo chain */
static inline void *
vn_decode_VkMemoryAllocateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkExportMemoryAllocateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkExportMemoryAllocateInfo_self_temp(dec, (VkExportMemoryAllocateInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryAllocateFlagsInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryAllocateFlagsInfo_self_temp(dec, (VkMemoryAllocateFlagsInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryDedicatedAllocateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryDedicatedAllocateInfo_self_temp(dec, (VkMemoryDedicatedAllocateInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryOpaqueCaptureAddressAllocateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryOpaqueCaptureAddressAllocateInfo_self_temp(dec, (VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkMemoryAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkMemoryAllocateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDeviceSize(dec, &val->allocationSize);
vn_decode_uint32_t(dec, &val->memoryTypeIndex);
}
static inline void
vn_decode_VkMemoryAllocateInfo_temp(struct vn_cs_decoder *dec, VkMemoryAllocateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkMemoryAllocateInfo_pnext_temp(dec);
vn_decode_VkMemoryAllocateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkMemoryAllocateInfo_handle_self(VkMemoryAllocateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->allocationSize */
/* skip val->memoryTypeIndex */
}
static inline void
vn_replace_VkMemoryAllocateInfo_handle(VkMemoryAllocateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO:
vn_replace_VkMemoryAllocateInfo_handle_self((VkMemoryAllocateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
vn_replace_VkExportMemoryAllocateInfo_handle_self((VkExportMemoryAllocateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
vn_replace_VkMemoryAllocateFlagsInfo_handle_self((VkMemoryAllocateFlagsInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
vn_replace_VkMemoryDedicatedAllocateInfo_handle_self((VkMemoryDedicatedAllocateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
vn_replace_VkMemoryOpaqueCaptureAddressAllocateInfo_handle_self((VkMemoryOpaqueCaptureAddressAllocateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMappedMemoryRange chain */
static inline void
vn_encode_VkMappedMemoryRange_pnext(struct vn_cs_encoder *enc, const void *val)
{
/* no known/supported struct */
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkMappedMemoryRange_self(struct vn_cs_encoder *enc, const VkMappedMemoryRange *val)
{
/* skip val->{sType,pNext} */
vn_encode_VkDeviceMemory(enc, &val->memory);
vn_encode_VkDeviceSize(enc, &val->offset);
vn_encode_VkDeviceSize(enc, &val->size);
}
static inline void
vn_encode_VkMappedMemoryRange(struct vn_cs_encoder *enc, const VkMappedMemoryRange *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE });
vn_encode_VkMappedMemoryRange_pnext(enc, val->pNext);
vn_encode_VkMappedMemoryRange_self(enc, val);
}
static inline void *
vn_decode_VkMappedMemoryRange_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkMappedMemoryRange_self_temp(struct vn_cs_decoder *dec, VkMappedMemoryRange *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
vn_decode_VkDeviceSize(dec, &val->offset);
vn_decode_VkDeviceSize(dec, &val->size);
}
static inline void
vn_decode_VkMappedMemoryRange_temp(struct vn_cs_decoder *dec, VkMappedMemoryRange *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE);
val->sType = stype;
val->pNext = vn_decode_VkMappedMemoryRange_pnext_temp(dec);
vn_decode_VkMappedMemoryRange_self_temp(dec, val);
}
static inline void
vn_replace_VkMappedMemoryRange_handle_self(VkMappedMemoryRange *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkDeviceMemory_handle(&val->memory);
/* skip val->offset */
/* skip val->size */
}
static inline void
vn_replace_VkMappedMemoryRange_handle(VkMappedMemoryRange *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE:
vn_replace_VkMappedMemoryRange_handle_self((VkMappedMemoryRange *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkDeviceMemoryOpaqueCaptureAddressInfo chain */
static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext(struct vn_cs_encoder *enc, const void *val)
{
/* no known/supported struct */
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_self(struct vn_cs_encoder *enc, const VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
/* skip val->{sType,pNext} */
vn_encode_VkDeviceMemory(enc, &val->memory);
}
static inline void
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo(struct vn_cs_encoder *enc, const VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO });
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext(enc, val->pNext);
vn_encode_VkDeviceMemoryOpaqueCaptureAddressInfo_self(enc, val);
}
static inline void *
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
}
static inline void
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_temp(struct vn_cs_decoder *dec, VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_pnext_temp(dec);
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle_self(VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkDeviceMemory_handle(&val->memory);
}
static inline void
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle(VkDeviceMemoryOpaqueCaptureAddressInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO:
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle_self((VkDeviceMemoryOpaqueCaptureAddressInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkAllocateMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkAllocateMemory *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pAllocateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pAllocateInfo));
if (!args->pAllocateInfo) return;
vn_decode_VkMemoryAllocateInfo_temp(dec, (VkMemoryAllocateInfo *)args->pAllocateInfo);
} else {
args->pAllocateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pMemory = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemory));
if (!args->pMemory) return;
vn_decode_VkDeviceMemory(dec, args->pMemory);
} else {
args->pMemory = NULL;
}
}
static inline void vn_replace_vkAllocateMemory_args_handle(struct vn_command_vkAllocateMemory *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pAllocateInfo)
vn_replace_VkMemoryAllocateInfo_handle((VkMemoryAllocateInfo *)args->pAllocateInfo);
/* skip args->pAllocator */
/* skip args->pMemory */
}
static inline void vn_encode_vkAllocateMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkAllocateMemory *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkAllocateMemory_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pAllocateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pMemory))
vn_encode_VkDeviceMemory(enc, args->pMemory);
}
static inline void vn_decode_vkFreeMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFreeMemory *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkFreeMemory_args_handle(struct vn_command_vkFreeMemory *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDeviceMemory_handle(&args->memory);
/* skip args->pAllocator */
}
static inline void vn_encode_vkFreeMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFreeMemory *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFreeMemory_EXT});
/* skip args->device */
/* skip args->memory */
/* skip args->pAllocator */
}
static inline void vn_decode_vkUnmapMemory_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkUnmapMemory *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
}
static inline void vn_replace_vkUnmapMemory_args_handle(struct vn_command_vkUnmapMemory *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDeviceMemory_handle(&args->memory);
}
static inline void vn_encode_vkUnmapMemory_reply(struct vn_cs_encoder *enc, const struct vn_command_vkUnmapMemory *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkUnmapMemory_EXT});
/* skip args->device */
/* skip args->memory */
}
static inline void vn_decode_vkFlushMappedMemoryRanges_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkFlushMappedMemoryRanges *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->memoryRangeCount);
if (vn_peek_array_size(dec)) {
args->pMemoryRanges = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryRanges) * args->memoryRangeCount);
if (!args->pMemoryRanges) return;
vn_decode_array_size(dec, args->memoryRangeCount);
for (uint32_t i = 0; i < args->memoryRangeCount; i++)
vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pMemoryRanges = NULL;
}
}
static inline void vn_replace_vkFlushMappedMemoryRanges_args_handle(struct vn_command_vkFlushMappedMemoryRanges *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->memoryRangeCount */
if (args->pMemoryRanges) {
for (uint32_t i = 0; i < args->memoryRangeCount; i++)
vn_replace_VkMappedMemoryRange_handle(&((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
}
}
static inline void vn_encode_vkFlushMappedMemoryRanges_reply(struct vn_cs_encoder *enc, const struct vn_command_vkFlushMappedMemoryRanges *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkFlushMappedMemoryRanges_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->memoryRangeCount */
/* skip args->pMemoryRanges */
}
static inline void vn_decode_vkInvalidateMappedMemoryRanges_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkInvalidateMappedMemoryRanges *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->memoryRangeCount);
if (vn_peek_array_size(dec)) {
args->pMemoryRanges = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryRanges) * args->memoryRangeCount);
if (!args->pMemoryRanges) return;
vn_decode_array_size(dec, args->memoryRangeCount);
for (uint32_t i = 0; i < args->memoryRangeCount; i++)
vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pMemoryRanges = NULL;
}
}
static inline void vn_replace_vkInvalidateMappedMemoryRanges_args_handle(struct vn_command_vkInvalidateMappedMemoryRanges *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->memoryRangeCount */
if (args->pMemoryRanges) {
for (uint32_t i = 0; i < args->memoryRangeCount; i++)
vn_replace_VkMappedMemoryRange_handle(&((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
}
}
static inline void vn_encode_vkInvalidateMappedMemoryRanges_reply(struct vn_cs_encoder *enc, const struct vn_command_vkInvalidateMappedMemoryRanges *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkInvalidateMappedMemoryRanges_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->memoryRangeCount */
/* skip args->pMemoryRanges */
}
static inline void vn_decode_vkGetDeviceMemoryCommitment_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDeviceMemoryCommitment *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkDeviceMemory_lookup(dec, &args->memory);
if (vn_decode_simple_pointer(dec)) {
args->pCommittedMemoryInBytes = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCommittedMemoryInBytes));
if (!args->pCommittedMemoryInBytes) return;
} else {
args->pCommittedMemoryInBytes = NULL;
}
}
static inline void vn_replace_vkGetDeviceMemoryCommitment_args_handle(struct vn_command_vkGetDeviceMemoryCommitment *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkDeviceMemory_handle(&args->memory);
/* skip args->pCommittedMemoryInBytes */
}
static inline void vn_encode_vkGetDeviceMemoryCommitment_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDeviceMemoryCommitment *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDeviceMemoryCommitment_EXT});
/* skip args->device */
/* skip args->memory */
if (vn_encode_simple_pointer(enc, args->pCommittedMemoryInBytes))
vn_encode_VkDeviceSize(enc, args->pCommittedMemoryInBytes);
}
static inline void vn_decode_vkGetDeviceMemoryOpaqueCaptureAddress_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pInfo));
if (!args->pInfo) return;
vn_decode_VkDeviceMemoryOpaqueCaptureAddressInfo_temp(dec, (VkDeviceMemoryOpaqueCaptureAddressInfo *)args->pInfo);
} else {
args->pInfo = NULL;
}
}
static inline void vn_replace_vkGetDeviceMemoryOpaqueCaptureAddress_args_handle(struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pInfo)
vn_replace_VkDeviceMemoryOpaqueCaptureAddressInfo_handle((VkDeviceMemoryOpaqueCaptureAddressInfo *)args->pInfo);
}
static inline void vn_encode_vkGetDeviceMemoryOpaqueCaptureAddress_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetDeviceMemoryOpaqueCaptureAddress_EXT});
vn_encode_uint64_t(enc, &args->ret);
/* skip args->device */
/* skip args->pInfo */
}
static inline void vn_dispatch_vkAllocateMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkAllocateMemory args;
if (!ctx->dispatch_vkAllocateMemory) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkAllocateMemory_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkAllocateMemory(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkAllocateMemory returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkAllocateMemory_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkFreeMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkFreeMemory args;
if (!ctx->dispatch_vkFreeMemory) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkFreeMemory_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkFreeMemory(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkFreeMemory_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkUnmapMemory(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkUnmapMemory args;
if (!ctx->dispatch_vkUnmapMemory) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkUnmapMemory_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkUnmapMemory(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkUnmapMemory_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkFlushMappedMemoryRanges(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkFlushMappedMemoryRanges args;
if (!ctx->dispatch_vkFlushMappedMemoryRanges) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkFlushMappedMemoryRanges_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkFlushMappedMemoryRanges(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkFlushMappedMemoryRanges returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkFlushMappedMemoryRanges_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkInvalidateMappedMemoryRanges(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkInvalidateMappedMemoryRanges args;
if (!ctx->dispatch_vkInvalidateMappedMemoryRanges) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkInvalidateMappedMemoryRanges_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkInvalidateMappedMemoryRanges(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkInvalidateMappedMemoryRanges returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkInvalidateMappedMemoryRanges_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetDeviceMemoryCommitment(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetDeviceMemoryCommitment args;
if (!ctx->dispatch_vkGetDeviceMemoryCommitment) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetDeviceMemoryCommitment_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetDeviceMemoryCommitment(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetDeviceMemoryCommitment_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetDeviceMemoryOpaqueCaptureAddress args;
if (!ctx->dispatch_vkGetDeviceMemoryOpaqueCaptureAddress) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetDeviceMemoryOpaqueCaptureAddress_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetDeviceMemoryOpaqueCaptureAddress(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetDeviceMemoryOpaqueCaptureAddress_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_DEVICE_MEMORY_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,345 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_EVENT_H
#define VN_PROTOCOL_RENDERER_EVENT_H
#include "vn_protocol_renderer_structs.h"
/* struct VkEventCreateInfo chain */
static inline void *
vn_decode_VkEventCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkEventCreateInfo_self_temp(struct vn_cs_decoder *dec, VkEventCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
}
static inline void
vn_decode_VkEventCreateInfo_temp(struct vn_cs_decoder *dec, VkEventCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkEventCreateInfo_pnext_temp(dec);
vn_decode_VkEventCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkEventCreateInfo_handle_self(VkEventCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
}
static inline void
vn_replace_VkEventCreateInfo_handle(VkEventCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_EVENT_CREATE_INFO:
vn_replace_VkEventCreateInfo_handle_self((VkEventCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateEvent_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateEvent *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkEventCreateInfo_temp(dec, (VkEventCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pEvent = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pEvent));
if (!args->pEvent) return;
vn_decode_VkEvent(dec, args->pEvent);
} else {
args->pEvent = NULL;
}
}
static inline void vn_replace_vkCreateEvent_args_handle(struct vn_command_vkCreateEvent *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkEventCreateInfo_handle((VkEventCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pEvent */
}
static inline void vn_encode_vkCreateEvent_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateEvent *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateEvent_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pEvent))
vn_encode_VkEvent(enc, args->pEvent);
}
static inline void vn_decode_vkDestroyEvent_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyEvent *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkEvent_lookup(dec, &args->event);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyEvent_args_handle(struct vn_command_vkDestroyEvent *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkEvent_handle(&args->event);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyEvent_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyEvent *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyEvent_EXT});
/* skip args->device */
/* skip args->event */
/* skip args->pAllocator */
}
static inline void vn_decode_vkGetEventStatus_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetEventStatus *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkEvent_lookup(dec, &args->event);
}
static inline void vn_replace_vkGetEventStatus_args_handle(struct vn_command_vkGetEventStatus *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkEvent_handle(&args->event);
}
static inline void vn_encode_vkGetEventStatus_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetEventStatus *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetEventStatus_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->event */
}
static inline void vn_decode_vkSetEvent_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSetEvent *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkEvent_lookup(dec, &args->event);
}
static inline void vn_replace_vkSetEvent_args_handle(struct vn_command_vkSetEvent *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkEvent_handle(&args->event);
}
static inline void vn_encode_vkSetEvent_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSetEvent *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSetEvent_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->event */
}
static inline void vn_decode_vkResetEvent_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkResetEvent *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkEvent_lookup(dec, &args->event);
}
static inline void vn_replace_vkResetEvent_args_handle(struct vn_command_vkResetEvent *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkEvent_handle(&args->event);
}
static inline void vn_encode_vkResetEvent_reply(struct vn_cs_encoder *enc, const struct vn_command_vkResetEvent *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkResetEvent_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->event */
}
static inline void vn_dispatch_vkCreateEvent(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateEvent args;
if (!ctx->dispatch_vkCreateEvent) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateEvent_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateEvent(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateEvent returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateEvent_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyEvent(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyEvent args;
if (!ctx->dispatch_vkDestroyEvent) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyEvent_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyEvent(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyEvent_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetEventStatus(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetEventStatus args;
if (!ctx->dispatch_vkGetEventStatus) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetEventStatus_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetEventStatus(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetEventStatus returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetEventStatus_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkSetEvent(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkSetEvent args;
if (!ctx->dispatch_vkSetEvent) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkSetEvent_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkSetEvent(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkSetEvent returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkSetEvent_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkResetEvent(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkResetEvent args;
if (!ctx->dispatch_vkResetEvent) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkResetEvent_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkResetEvent(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkResetEvent returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkResetEvent_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_EVENT_H */

@ -0,0 +1,460 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_FENCE_H
#define VN_PROTOCOL_RENDERER_FENCE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkExportFenceCreateInfo chain */
static inline void *
vn_decode_VkExportFenceCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkExportFenceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkExportFenceCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->handleTypes);
}
static inline void
vn_decode_VkExportFenceCreateInfo_temp(struct vn_cs_decoder *dec, VkExportFenceCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkExportFenceCreateInfo_pnext_temp(dec);
vn_decode_VkExportFenceCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkExportFenceCreateInfo_handle_self(VkExportFenceCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->handleTypes */
}
static inline void
vn_replace_VkExportFenceCreateInfo_handle(VkExportFenceCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO:
vn_replace_VkExportFenceCreateInfo_handle_self((VkExportFenceCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkFenceCreateInfo chain */
static inline void *
vn_decode_VkFenceCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkExportFenceCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkFenceCreateInfo_pnext_temp(dec);
vn_decode_VkExportFenceCreateInfo_self_temp(dec, (VkExportFenceCreateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkFenceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkFenceCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
}
static inline void
vn_decode_VkFenceCreateInfo_temp(struct vn_cs_decoder *dec, VkFenceCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkFenceCreateInfo_pnext_temp(dec);
vn_decode_VkFenceCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkFenceCreateInfo_handle_self(VkFenceCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
}
static inline void
vn_replace_VkFenceCreateInfo_handle(VkFenceCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_FENCE_CREATE_INFO:
vn_replace_VkFenceCreateInfo_handle_self((VkFenceCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO:
vn_replace_VkExportFenceCreateInfo_handle_self((VkExportFenceCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateFence_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateFence *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkFenceCreateInfo_temp(dec, (VkFenceCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pFence = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pFence));
if (!args->pFence) return;
vn_decode_VkFence(dec, args->pFence);
} else {
args->pFence = NULL;
}
}
static inline void vn_replace_vkCreateFence_args_handle(struct vn_command_vkCreateFence *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkFenceCreateInfo_handle((VkFenceCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pFence */
}
static inline void vn_encode_vkCreateFence_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateFence *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateFence_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pFence))
vn_encode_VkFence(enc, args->pFence);
}
static inline void vn_decode_vkDestroyFence_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyFence *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkFence_lookup(dec, &args->fence);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyFence_args_handle(struct vn_command_vkDestroyFence *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkFence_handle(&args->fence);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyFence_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyFence *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyFence_EXT});
/* skip args->device */
/* skip args->fence */
/* skip args->pAllocator */
}
static inline void vn_decode_vkResetFences_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkResetFences *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->fenceCount);
if (vn_peek_array_size(dec)) {
args->pFences = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pFences) * args->fenceCount);
if (!args->pFences) return;
vn_decode_array_size(dec, args->fenceCount);
for (uint32_t i = 0; i < args->fenceCount; i++)
vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pFences = NULL;
}
}
static inline void vn_replace_vkResetFences_args_handle(struct vn_command_vkResetFences *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->fenceCount */
if (args->pFences) {
for (uint32_t i = 0; i < args->fenceCount; i++)
vn_replace_VkFence_handle(&((VkFence *)args->pFences)[i]);
}
}
static inline void vn_encode_vkResetFences_reply(struct vn_cs_encoder *enc, const struct vn_command_vkResetFences *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkResetFences_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->fenceCount */
/* skip args->pFences */
}
static inline void vn_decode_vkGetFenceStatus_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetFenceStatus *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkFence_lookup(dec, &args->fence);
}
static inline void vn_replace_vkGetFenceStatus_args_handle(struct vn_command_vkGetFenceStatus *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkFence_handle(&args->fence);
}
static inline void vn_encode_vkGetFenceStatus_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetFenceStatus *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetFenceStatus_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->fence */
}
static inline void vn_decode_vkWaitForFences_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkWaitForFences *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->fenceCount);
if (vn_peek_array_size(dec)) {
args->pFences = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pFences) * args->fenceCount);
if (!args->pFences) return;
vn_decode_array_size(dec, args->fenceCount);
for (uint32_t i = 0; i < args->fenceCount; i++)
vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pFences = NULL;
}
vn_decode_VkBool32(dec, &args->waitAll);
vn_decode_uint64_t(dec, &args->timeout);
}
static inline void vn_replace_vkWaitForFences_args_handle(struct vn_command_vkWaitForFences *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->fenceCount */
if (args->pFences) {
for (uint32_t i = 0; i < args->fenceCount; i++)
vn_replace_VkFence_handle(&((VkFence *)args->pFences)[i]);
}
/* skip args->waitAll */
/* skip args->timeout */
}
static inline void vn_encode_vkWaitForFences_reply(struct vn_cs_encoder *enc, const struct vn_command_vkWaitForFences *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkWaitForFences_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->fenceCount */
/* skip args->pFences */
/* skip args->waitAll */
/* skip args->timeout */
}
static inline void vn_dispatch_vkCreateFence(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateFence args;
if (!ctx->dispatch_vkCreateFence) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateFence_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateFence(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateFence returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateFence_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyFence(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyFence args;
if (!ctx->dispatch_vkDestroyFence) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyFence_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyFence(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyFence_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkResetFences(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkResetFences args;
if (!ctx->dispatch_vkResetFences) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkResetFences_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkResetFences(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkResetFences returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkResetFences_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetFenceStatus(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetFenceStatus args;
if (!ctx->dispatch_vkGetFenceStatus) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetFenceStatus_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetFenceStatus(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetFenceStatus returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetFenceStatus_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkWaitForFences(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkWaitForFences args;
if (!ctx->dispatch_vkWaitForFences) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkWaitForFences_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkWaitForFences(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkWaitForFences returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkWaitForFences_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_FENCE_H */

@ -0,0 +1,385 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_FRAMEBUFFER_H
#define VN_PROTOCOL_RENDERER_FRAMEBUFFER_H
#include "vn_protocol_renderer_structs.h"
/* struct VkFramebufferAttachmentImageInfo chain */
static inline void *
vn_decode_VkFramebufferAttachmentImageInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkFramebufferAttachmentImageInfo_self_temp(struct vn_cs_decoder *dec, VkFramebufferAttachmentImageInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkFlags(dec, &val->usage);
vn_decode_uint32_t(dec, &val->width);
vn_decode_uint32_t(dec, &val->height);
vn_decode_uint32_t(dec, &val->layerCount);
vn_decode_uint32_t(dec, &val->viewFormatCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->viewFormatCount);
val->pViewFormats = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pViewFormats) * array_size);
if (!val->pViewFormats) return;
vn_decode_VkFormat_array(dec, (VkFormat *)val->pViewFormats, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pViewFormats = NULL;
}
}
static inline void
vn_decode_VkFramebufferAttachmentImageInfo_temp(struct vn_cs_decoder *dec, VkFramebufferAttachmentImageInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkFramebufferAttachmentImageInfo_pnext_temp(dec);
vn_decode_VkFramebufferAttachmentImageInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkFramebufferAttachmentImageInfo_handle_self(VkFramebufferAttachmentImageInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->usage */
/* skip val->width */
/* skip val->height */
/* skip val->layerCount */
/* skip val->viewFormatCount */
/* skip val->pViewFormats */
}
static inline void
vn_replace_VkFramebufferAttachmentImageInfo_handle(VkFramebufferAttachmentImageInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO:
vn_replace_VkFramebufferAttachmentImageInfo_handle_self((VkFramebufferAttachmentImageInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkFramebufferAttachmentsCreateInfo chain */
static inline void *
vn_decode_VkFramebufferAttachmentsCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkFramebufferAttachmentsCreateInfo_self_temp(struct vn_cs_decoder *dec, VkFramebufferAttachmentsCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->attachmentImageInfoCount);
if (vn_peek_array_size(dec)) {
val->pAttachmentImageInfos = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pAttachmentImageInfos) * val->attachmentImageInfoCount);
if (!val->pAttachmentImageInfos) return;
vn_decode_array_size(dec, val->attachmentImageInfoCount);
for (uint32_t i = 0; i < val->attachmentImageInfoCount; i++)
vn_decode_VkFramebufferAttachmentImageInfo_temp(dec, &((VkFramebufferAttachmentImageInfo *)val->pAttachmentImageInfos)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pAttachmentImageInfos = NULL;
}
}
static inline void
vn_decode_VkFramebufferAttachmentsCreateInfo_temp(struct vn_cs_decoder *dec, VkFramebufferAttachmentsCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkFramebufferAttachmentsCreateInfo_pnext_temp(dec);
vn_decode_VkFramebufferAttachmentsCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkFramebufferAttachmentsCreateInfo_handle_self(VkFramebufferAttachmentsCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->attachmentImageInfoCount */
if (val->pAttachmentImageInfos) {
for (uint32_t i = 0; i < val->attachmentImageInfoCount; i++)
vn_replace_VkFramebufferAttachmentImageInfo_handle(&((VkFramebufferAttachmentImageInfo *)val->pAttachmentImageInfos)[i]);
}
}
static inline void
vn_replace_VkFramebufferAttachmentsCreateInfo_handle(VkFramebufferAttachmentsCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO:
vn_replace_VkFramebufferAttachmentsCreateInfo_handle_self((VkFramebufferAttachmentsCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkFramebufferCreateInfo chain */
static inline void *
vn_decode_VkFramebufferCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkFramebufferAttachmentsCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkFramebufferCreateInfo_pnext_temp(dec);
vn_decode_VkFramebufferAttachmentsCreateInfo_self_temp(dec, (VkFramebufferAttachmentsCreateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkFramebufferCreateInfo_self_temp(struct vn_cs_decoder *dec, VkFramebufferCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkRenderPass_lookup(dec, &val->renderPass);
vn_decode_uint32_t(dec, &val->attachmentCount);
if (vn_peek_array_size(dec)) {
val->pAttachments = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pAttachments) * val->attachmentCount);
if (!val->pAttachments) return;
vn_decode_array_size(dec, val->attachmentCount);
for (uint32_t i = 0; i < val->attachmentCount; i++)
vn_decode_VkImageView_lookup(dec, &((VkImageView *)val->pAttachments)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pAttachments = NULL;
}
vn_decode_uint32_t(dec, &val->width);
vn_decode_uint32_t(dec, &val->height);
vn_decode_uint32_t(dec, &val->layers);
}
static inline void
vn_decode_VkFramebufferCreateInfo_temp(struct vn_cs_decoder *dec, VkFramebufferCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkFramebufferCreateInfo_pnext_temp(dec);
vn_decode_VkFramebufferCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkFramebufferCreateInfo_handle_self(VkFramebufferCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
vn_replace_VkRenderPass_handle(&val->renderPass);
/* skip val->attachmentCount */
if (val->pAttachments) {
for (uint32_t i = 0; i < val->attachmentCount; i++)
vn_replace_VkImageView_handle(&((VkImageView *)val->pAttachments)[i]);
}
/* skip val->width */
/* skip val->height */
/* skip val->layers */
}
static inline void
vn_replace_VkFramebufferCreateInfo_handle(VkFramebufferCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO:
vn_replace_VkFramebufferCreateInfo_handle_self((VkFramebufferCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO:
vn_replace_VkFramebufferAttachmentsCreateInfo_handle_self((VkFramebufferAttachmentsCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateFramebuffer_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateFramebuffer *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkFramebufferCreateInfo_temp(dec, (VkFramebufferCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pFramebuffer = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pFramebuffer));
if (!args->pFramebuffer) return;
vn_decode_VkFramebuffer(dec, args->pFramebuffer);
} else {
args->pFramebuffer = NULL;
}
}
static inline void vn_replace_vkCreateFramebuffer_args_handle(struct vn_command_vkCreateFramebuffer *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkFramebufferCreateInfo_handle((VkFramebufferCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pFramebuffer */
}
static inline void vn_encode_vkCreateFramebuffer_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateFramebuffer *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateFramebuffer_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pFramebuffer))
vn_encode_VkFramebuffer(enc, args->pFramebuffer);
}
static inline void vn_decode_vkDestroyFramebuffer_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyFramebuffer *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkFramebuffer_lookup(dec, &args->framebuffer);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyFramebuffer_args_handle(struct vn_command_vkDestroyFramebuffer *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkFramebuffer_handle(&args->framebuffer);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyFramebuffer_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyFramebuffer *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyFramebuffer_EXT});
/* skip args->device */
/* skip args->framebuffer */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateFramebuffer(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateFramebuffer args;
if (!ctx->dispatch_vkCreateFramebuffer) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateFramebuffer_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateFramebuffer(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateFramebuffer returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateFramebuffer_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyFramebuffer(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyFramebuffer args;
if (!ctx->dispatch_vkDestroyFramebuffer) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyFramebuffer_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyFramebuffer(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyFramebuffer_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_FRAMEBUFFER_H */

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC

File diff suppressed because it is too large Load Diff

@ -0,0 +1,292 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_IMAGE_VIEW_H
#define VN_PROTOCOL_RENDERER_IMAGE_VIEW_H
#include "vn_protocol_renderer_structs.h"
/* struct VkImageViewUsageCreateInfo chain */
static inline void *
vn_decode_VkImageViewUsageCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkImageViewUsageCreateInfo_self_temp(struct vn_cs_decoder *dec, VkImageViewUsageCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->usage);
}
static inline void
vn_decode_VkImageViewUsageCreateInfo_temp(struct vn_cs_decoder *dec, VkImageViewUsageCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkImageViewUsageCreateInfo_pnext_temp(dec);
vn_decode_VkImageViewUsageCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkImageViewUsageCreateInfo_handle_self(VkImageViewUsageCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->usage */
}
static inline void
vn_replace_VkImageViewUsageCreateInfo_handle(VkImageViewUsageCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
vn_replace_VkImageViewUsageCreateInfo_handle_self((VkImageViewUsageCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkImageViewCreateInfo chain */
static inline void *
vn_decode_VkImageViewCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkImageViewUsageCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkImageViewCreateInfo_pnext_temp(dec);
vn_decode_VkImageViewUsageCreateInfo_self_temp(dec, (VkImageViewUsageCreateInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkSamplerYcbcrConversionInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkImageViewCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerYcbcrConversionInfo_self_temp(dec, (VkSamplerYcbcrConversionInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkImageViewCreateInfo_self_temp(struct vn_cs_decoder *dec, VkImageViewCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkImage_lookup(dec, &val->image);
vn_decode_VkImageViewType(dec, &val->viewType);
vn_decode_VkFormat(dec, &val->format);
vn_decode_VkComponentMapping_temp(dec, &val->components);
vn_decode_VkImageSubresourceRange_temp(dec, &val->subresourceRange);
}
static inline void
vn_decode_VkImageViewCreateInfo_temp(struct vn_cs_decoder *dec, VkImageViewCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkImageViewCreateInfo_pnext_temp(dec);
vn_decode_VkImageViewCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkImageViewCreateInfo_handle_self(VkImageViewCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
vn_replace_VkImage_handle(&val->image);
/* skip val->viewType */
/* skip val->format */
vn_replace_VkComponentMapping_handle(&val->components);
vn_replace_VkImageSubresourceRange_handle(&val->subresourceRange);
}
static inline void
vn_replace_VkImageViewCreateInfo_handle(VkImageViewCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO:
vn_replace_VkImageViewCreateInfo_handle_self((VkImageViewCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
vn_replace_VkImageViewUsageCreateInfo_handle_self((VkImageViewUsageCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
vn_replace_VkSamplerYcbcrConversionInfo_handle_self((VkSamplerYcbcrConversionInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateImageView_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateImageView *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkImageViewCreateInfo_temp(dec, (VkImageViewCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pView = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pView));
if (!args->pView) return;
vn_decode_VkImageView(dec, args->pView);
} else {
args->pView = NULL;
}
}
static inline void vn_replace_vkCreateImageView_args_handle(struct vn_command_vkCreateImageView *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkImageViewCreateInfo_handle((VkImageViewCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pView */
}
static inline void vn_encode_vkCreateImageView_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateImageView *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateImageView_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pView))
vn_encode_VkImageView(enc, args->pView);
}
static inline void vn_decode_vkDestroyImageView_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyImageView *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkImageView_lookup(dec, &args->imageView);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyImageView_args_handle(struct vn_command_vkDestroyImageView *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkImageView_handle(&args->imageView);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyImageView_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyImageView *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyImageView_EXT});
/* skip args->device */
/* skip args->imageView */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateImageView(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateImageView args;
if (!ctx->dispatch_vkCreateImageView) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateImageView_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateImageView(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateImageView returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateImageView_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyImageView(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyImageView args;
if (!ctx->dispatch_vkDestroyImageView) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyImageView_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyImageView(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyImageView_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_IMAGE_VIEW_H */

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC

@ -0,0 +1,526 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_INSTANCE_H
#define VN_PROTOCOL_RENDERER_INSTANCE_H
#include "vn_protocol_renderer_structs.h"
/*
* These structs/unions/commands are not included
*
* vkGetInstanceProcAddr
*/
/* struct VkApplicationInfo chain */
static inline void *
vn_decode_VkApplicationInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkApplicationInfo_self_temp(struct vn_cs_decoder *dec, VkApplicationInfo *val)
{
/* skip val->{sType,pNext} */
if (vn_peek_array_size(dec)) {
const size_t string_size = vn_decode_array_size(dec, UINT64_MAX);
val->pApplicationName = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pApplicationName) * string_size);
if (!val->pApplicationName) return;
vn_decode_blob_array(dec, (char *)val->pApplicationName, string_size);
} else {
vn_decode_array_size(dec, 0);
val->pApplicationName = NULL;
}
vn_decode_uint32_t(dec, &val->applicationVersion);
if (vn_peek_array_size(dec)) {
const size_t string_size = vn_decode_array_size(dec, UINT64_MAX);
val->pEngineName = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pEngineName) * string_size);
if (!val->pEngineName) return;
vn_decode_blob_array(dec, (char *)val->pEngineName, string_size);
} else {
vn_decode_array_size(dec, 0);
val->pEngineName = NULL;
}
vn_decode_uint32_t(dec, &val->engineVersion);
vn_decode_uint32_t(dec, &val->apiVersion);
}
static inline void
vn_decode_VkApplicationInfo_temp(struct vn_cs_decoder *dec, VkApplicationInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_APPLICATION_INFO);
val->sType = stype;
val->pNext = vn_decode_VkApplicationInfo_pnext_temp(dec);
vn_decode_VkApplicationInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkApplicationInfo_handle_self(VkApplicationInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->pApplicationName */
/* skip val->applicationVersion */
/* skip val->pEngineName */
/* skip val->engineVersion */
/* skip val->apiVersion */
}
static inline void
vn_replace_VkApplicationInfo_handle(VkApplicationInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_APPLICATION_INFO:
vn_replace_VkApplicationInfo_handle_self((VkApplicationInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkInstanceCreateInfo chain */
static inline void *
vn_decode_VkInstanceCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkInstanceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkInstanceCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
if (vn_decode_simple_pointer(dec)) {
val->pApplicationInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pApplicationInfo));
if (!val->pApplicationInfo) return;
vn_decode_VkApplicationInfo_temp(dec, (VkApplicationInfo *)val->pApplicationInfo);
} else {
val->pApplicationInfo = NULL;
}
vn_decode_uint32_t(dec, &val->enabledLayerCount);
if (vn_peek_array_size(dec)) {
val->ppEnabledLayerNames = vn_cs_decoder_alloc_temp(dec, sizeof(*val->ppEnabledLayerNames) * val->enabledLayerCount);
if (!val->ppEnabledLayerNames) return;
vn_decode_array_size(dec, val->enabledLayerCount);
for (uint32_t i = 0; i < val->enabledLayerCount; i++) {
const size_t string_size = vn_decode_array_size(dec, UINT64_MAX);
((char **)val->ppEnabledLayerNames)[i] = vn_cs_decoder_alloc_temp(dec, sizeof(*val->ppEnabledLayerNames[i]) * string_size);
if (!val->ppEnabledLayerNames[i]) return;
vn_decode_blob_array(dec, ((char **)val->ppEnabledLayerNames)[i], string_size);
}
} else {
vn_decode_array_size(dec, 0);
val->ppEnabledLayerNames = NULL;
}
vn_decode_uint32_t(dec, &val->enabledExtensionCount);
if (vn_peek_array_size(dec)) {
val->ppEnabledExtensionNames = vn_cs_decoder_alloc_temp(dec, sizeof(*val->ppEnabledExtensionNames) * val->enabledExtensionCount);
if (!val->ppEnabledExtensionNames) return;
vn_decode_array_size(dec, val->enabledExtensionCount);
for (uint32_t i = 0; i < val->enabledExtensionCount; i++) {
const size_t string_size = vn_decode_array_size(dec, UINT64_MAX);
((char **)val->ppEnabledExtensionNames)[i] = vn_cs_decoder_alloc_temp(dec, sizeof(*val->ppEnabledExtensionNames[i]) * string_size);
if (!val->ppEnabledExtensionNames[i]) return;
vn_decode_blob_array(dec, ((char **)val->ppEnabledExtensionNames)[i], string_size);
}
} else {
vn_decode_array_size(dec, 0);
val->ppEnabledExtensionNames = NULL;
}
}
static inline void
vn_decode_VkInstanceCreateInfo_temp(struct vn_cs_decoder *dec, VkInstanceCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkInstanceCreateInfo_pnext_temp(dec);
vn_decode_VkInstanceCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkInstanceCreateInfo_handle_self(VkInstanceCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
if (val->pApplicationInfo)
vn_replace_VkApplicationInfo_handle((VkApplicationInfo *)val->pApplicationInfo);
/* skip val->enabledLayerCount */
/* skip val->ppEnabledLayerNames */
/* skip val->enabledExtensionCount */
/* skip val->ppEnabledExtensionNames */
}
static inline void
vn_replace_VkInstanceCreateInfo_handle(VkInstanceCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO:
vn_replace_VkInstanceCreateInfo_handle_self((VkInstanceCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateInstance_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateInstance *args)
{
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkInstanceCreateInfo_temp(dec, (VkInstanceCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pInstance = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pInstance));
if (!args->pInstance) return;
vn_decode_VkInstance_temp(dec, args->pInstance);
} else {
args->pInstance = NULL;
}
}
static inline void vn_replace_vkCreateInstance_args_handle(struct vn_command_vkCreateInstance *args)
{
if (args->pCreateInfo)
vn_replace_VkInstanceCreateInfo_handle((VkInstanceCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pInstance */
}
static inline void vn_encode_vkCreateInstance_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateInstance *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateInstance_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pInstance))
vn_encode_VkInstance(enc, args->pInstance);
}
static inline void vn_decode_vkDestroyInstance_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyInstance *args)
{
vn_decode_VkInstance_lookup(dec, &args->instance);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyInstance_args_handle(struct vn_command_vkDestroyInstance *args)
{
vn_replace_VkInstance_handle(&args->instance);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyInstance_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyInstance *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyInstance_EXT});
/* skip args->instance */
/* skip args->pAllocator */
}
static inline void vn_decode_vkEnumerateInstanceVersion_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkEnumerateInstanceVersion *args)
{
if (vn_decode_simple_pointer(dec)) {
args->pApiVersion = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pApiVersion));
if (!args->pApiVersion) return;
} else {
args->pApiVersion = NULL;
}
}
static inline void vn_replace_vkEnumerateInstanceVersion_args_handle(struct vn_command_vkEnumerateInstanceVersion *args)
{
/* skip args->pApiVersion */
}
static inline void vn_encode_vkEnumerateInstanceVersion_reply(struct vn_cs_encoder *enc, const struct vn_command_vkEnumerateInstanceVersion *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkEnumerateInstanceVersion_EXT});
vn_encode_VkResult(enc, &args->ret);
if (vn_encode_simple_pointer(enc, args->pApiVersion))
vn_encode_uint32_t(enc, args->pApiVersion);
}
static inline void vn_decode_vkEnumerateInstanceLayerProperties_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkEnumerateInstanceLayerProperties *args)
{
if (vn_decode_simple_pointer(dec)) {
args->pPropertyCount = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPropertyCount));
if (!args->pPropertyCount) return;
vn_decode_uint32_t(dec, args->pPropertyCount);
} else {
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
args->pProperties = NULL;
}
}
static inline void vn_replace_vkEnumerateInstanceLayerProperties_args_handle(struct vn_command_vkEnumerateInstanceLayerProperties *args)
{
/* skip args->pPropertyCount */
/* skip args->pProperties */
}
static inline void vn_encode_vkEnumerateInstanceLayerProperties_reply(struct vn_cs_encoder *enc, const struct vn_command_vkEnumerateInstanceLayerProperties *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkEnumerateInstanceLayerProperties_EXT});
vn_encode_VkResult(enc, &args->ret);
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_VkLayerProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
}
}
static inline void vn_decode_vkEnumerateInstanceExtensionProperties_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkEnumerateInstanceExtensionProperties *args)
{
if (vn_peek_array_size(dec)) {
const size_t string_size = vn_decode_array_size(dec, UINT64_MAX);
args->pLayerName = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pLayerName) * string_size);
if (!args->pLayerName) return;
vn_decode_blob_array(dec, (char *)args->pLayerName, string_size);
} else {
vn_decode_array_size(dec, 0);
args->pLayerName = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pPropertyCount = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPropertyCount));
if (!args->pPropertyCount) return;
vn_decode_uint32_t(dec, args->pPropertyCount);
} else {
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
args->pProperties = NULL;
}
}
static inline void vn_replace_vkEnumerateInstanceExtensionProperties_args_handle(struct vn_command_vkEnumerateInstanceExtensionProperties *args)
{
/* skip args->pLayerName */
/* skip args->pPropertyCount */
/* skip args->pProperties */
}
static inline void vn_encode_vkEnumerateInstanceExtensionProperties_reply(struct vn_cs_encoder *enc, const struct vn_command_vkEnumerateInstanceExtensionProperties *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkEnumerateInstanceExtensionProperties_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->pLayerName */
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_VkExtensionProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
}
}
static inline void vn_dispatch_vkCreateInstance(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateInstance args;
if (!ctx->dispatch_vkCreateInstance) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateInstance_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateInstance(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateInstance returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateInstance_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyInstance(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyInstance args;
if (!ctx->dispatch_vkDestroyInstance) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyInstance_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyInstance(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyInstance_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkEnumerateInstanceVersion(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkEnumerateInstanceVersion args;
if (!ctx->dispatch_vkEnumerateInstanceVersion) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkEnumerateInstanceVersion_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkEnumerateInstanceVersion(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkEnumerateInstanceVersion returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkEnumerateInstanceVersion_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkEnumerateInstanceLayerProperties(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkEnumerateInstanceLayerProperties args;
if (!ctx->dispatch_vkEnumerateInstanceLayerProperties) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkEnumerateInstanceLayerProperties_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkEnumerateInstanceLayerProperties(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkEnumerateInstanceLayerProperties returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkEnumerateInstanceLayerProperties_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkEnumerateInstanceExtensionProperties(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkEnumerateInstanceExtensionProperties args;
if (!ctx->dispatch_vkEnumerateInstanceExtensionProperties) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkEnumerateInstanceExtensionProperties_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkEnumerateInstanceExtensionProperties(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkEnumerateInstanceExtensionProperties returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkEnumerateInstanceExtensionProperties_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_INSTANCE_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,349 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_PIPELINE_CACHE_H
#define VN_PROTOCOL_RENDERER_PIPELINE_CACHE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkPipelineCacheCreateInfo chain */
static inline void *
vn_decode_VkPipelineCacheCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkPipelineCacheCreateInfo_self_temp(struct vn_cs_decoder *dec, VkPipelineCacheCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_size_t(dec, &val->initialDataSize);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->initialDataSize);
val->pInitialData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!val->pInitialData) return;
vn_decode_blob_array(dec, (void *)val->pInitialData, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pInitialData = NULL;
}
}
static inline void
vn_decode_VkPipelineCacheCreateInfo_temp(struct vn_cs_decoder *dec, VkPipelineCacheCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkPipelineCacheCreateInfo_pnext_temp(dec);
vn_decode_VkPipelineCacheCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkPipelineCacheCreateInfo_handle_self(VkPipelineCacheCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->initialDataSize */
/* skip val->pInitialData */
}
static inline void
vn_replace_VkPipelineCacheCreateInfo_handle(VkPipelineCacheCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO:
vn_replace_VkPipelineCacheCreateInfo_handle_self((VkPipelineCacheCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreatePipelineCache_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreatePipelineCache *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkPipelineCacheCreateInfo_temp(dec, (VkPipelineCacheCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pPipelineCache = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPipelineCache));
if (!args->pPipelineCache) return;
vn_decode_VkPipelineCache(dec, args->pPipelineCache);
} else {
args->pPipelineCache = NULL;
}
}
static inline void vn_replace_vkCreatePipelineCache_args_handle(struct vn_command_vkCreatePipelineCache *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkPipelineCacheCreateInfo_handle((VkPipelineCacheCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pPipelineCache */
}
static inline void vn_encode_vkCreatePipelineCache_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreatePipelineCache *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreatePipelineCache_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pPipelineCache))
vn_encode_VkPipelineCache(enc, args->pPipelineCache);
}
static inline void vn_decode_vkDestroyPipelineCache_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyPipelineCache *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkPipelineCache_lookup(dec, &args->pipelineCache);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyPipelineCache_args_handle(struct vn_command_vkDestroyPipelineCache *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkPipelineCache_handle(&args->pipelineCache);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyPipelineCache_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyPipelineCache *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyPipelineCache_EXT});
/* skip args->device */
/* skip args->pipelineCache */
/* skip args->pAllocator */
}
static inline void vn_decode_vkGetPipelineCacheData_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetPipelineCacheData *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkPipelineCache_lookup(dec, &args->pipelineCache);
if (vn_decode_simple_pointer(dec)) {
args->pDataSize = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDataSize));
if (!args->pDataSize) return;
vn_decode_size_t(dec, args->pDataSize);
} else {
args->pDataSize = NULL;
}
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, *args->pDataSize);
args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return;
} else {
vn_decode_array_size(dec, 0);
args->pData = NULL;
}
}
static inline void vn_replace_vkGetPipelineCacheData_args_handle(struct vn_command_vkGetPipelineCacheData *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkPipelineCache_handle(&args->pipelineCache);
/* skip args->pDataSize */
/* skip args->pData */
}
static inline void vn_encode_vkGetPipelineCacheData_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetPipelineCacheData *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetPipelineCacheData_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pipelineCache */
if (vn_encode_simple_pointer(enc, args->pDataSize))
vn_encode_size_t(enc, args->pDataSize);
if (args->pData) {
vn_encode_array_size(enc, *args->pDataSize);
vn_encode_blob_array(enc, args->pData, *args->pDataSize);
} else {
vn_encode_array_size(enc, 0);
}
}
static inline void vn_decode_vkMergePipelineCaches_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkMergePipelineCaches *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkPipelineCache_lookup(dec, &args->dstCache);
vn_decode_uint32_t(dec, &args->srcCacheCount);
if (vn_peek_array_size(dec)) {
args->pSrcCaches = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSrcCaches) * args->srcCacheCount);
if (!args->pSrcCaches) return;
vn_decode_array_size(dec, args->srcCacheCount);
for (uint32_t i = 0; i < args->srcCacheCount; i++)
vn_decode_VkPipelineCache_lookup(dec, &((VkPipelineCache *)args->pSrcCaches)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pSrcCaches = NULL;
}
}
static inline void vn_replace_vkMergePipelineCaches_args_handle(struct vn_command_vkMergePipelineCaches *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkPipelineCache_handle(&args->dstCache);
/* skip args->srcCacheCount */
if (args->pSrcCaches) {
for (uint32_t i = 0; i < args->srcCacheCount; i++)
vn_replace_VkPipelineCache_handle(&((VkPipelineCache *)args->pSrcCaches)[i]);
}
}
static inline void vn_encode_vkMergePipelineCaches_reply(struct vn_cs_encoder *enc, const struct vn_command_vkMergePipelineCaches *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkMergePipelineCaches_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->dstCache */
/* skip args->srcCacheCount */
/* skip args->pSrcCaches */
}
static inline void vn_dispatch_vkCreatePipelineCache(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreatePipelineCache args;
if (!ctx->dispatch_vkCreatePipelineCache) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreatePipelineCache_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreatePipelineCache(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreatePipelineCache returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreatePipelineCache_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyPipelineCache(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyPipelineCache args;
if (!ctx->dispatch_vkDestroyPipelineCache) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyPipelineCache_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyPipelineCache(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyPipelineCache_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetPipelineCacheData(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetPipelineCacheData args;
if (!ctx->dispatch_vkGetPipelineCacheData) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetPipelineCacheData_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetPipelineCacheData(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetPipelineCacheData returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetPipelineCacheData_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkMergePipelineCaches(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkMergePipelineCaches args;
if (!ctx->dispatch_vkMergePipelineCaches) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkMergePipelineCaches_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkMergePipelineCaches(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkMergePipelineCaches returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkMergePipelineCaches_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_PIPELINE_CACHE_H */

@ -0,0 +1,242 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_PIPELINE_LAYOUT_H
#define VN_PROTOCOL_RENDERER_PIPELINE_LAYOUT_H
#include "vn_protocol_renderer_structs.h"
/* struct VkPushConstantRange */
static inline void
vn_decode_VkPushConstantRange_temp(struct vn_cs_decoder *dec, VkPushConstantRange *val)
{
vn_decode_VkFlags(dec, &val->stageFlags);
vn_decode_uint32_t(dec, &val->offset);
vn_decode_uint32_t(dec, &val->size);
}
static inline void
vn_replace_VkPushConstantRange_handle(VkPushConstantRange *val)
{
/* skip val->stageFlags */
/* skip val->offset */
/* skip val->size */
}
/* struct VkPipelineLayoutCreateInfo chain */
static inline void *
vn_decode_VkPipelineLayoutCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkPipelineLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, VkPipelineLayoutCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->setLayoutCount);
if (vn_peek_array_size(dec)) {
val->pSetLayouts = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSetLayouts) * val->setLayoutCount);
if (!val->pSetLayouts) return;
vn_decode_array_size(dec, val->setLayoutCount);
for (uint32_t i = 0; i < val->setLayoutCount; i++)
vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pSetLayouts = NULL;
}
vn_decode_uint32_t(dec, &val->pushConstantRangeCount);
if (vn_peek_array_size(dec)) {
val->pPushConstantRanges = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pPushConstantRanges) * val->pushConstantRangeCount);
if (!val->pPushConstantRanges) return;
vn_decode_array_size(dec, val->pushConstantRangeCount);
for (uint32_t i = 0; i < val->pushConstantRangeCount; i++)
vn_decode_VkPushConstantRange_temp(dec, &((VkPushConstantRange *)val->pPushConstantRanges)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pPushConstantRanges = NULL;
}
}
static inline void
vn_decode_VkPipelineLayoutCreateInfo_temp(struct vn_cs_decoder *dec, VkPipelineLayoutCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkPipelineLayoutCreateInfo_pnext_temp(dec);
vn_decode_VkPipelineLayoutCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkPipelineLayoutCreateInfo_handle_self(VkPipelineLayoutCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->setLayoutCount */
if (val->pSetLayouts) {
for (uint32_t i = 0; i < val->setLayoutCount; i++)
vn_replace_VkDescriptorSetLayout_handle(&((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
}
/* skip val->pushConstantRangeCount */
if (val->pPushConstantRanges) {
for (uint32_t i = 0; i < val->pushConstantRangeCount; i++)
vn_replace_VkPushConstantRange_handle(&((VkPushConstantRange *)val->pPushConstantRanges)[i]);
}
}
static inline void
vn_replace_VkPipelineLayoutCreateInfo_handle(VkPipelineLayoutCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO:
vn_replace_VkPipelineLayoutCreateInfo_handle_self((VkPipelineLayoutCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreatePipelineLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreatePipelineLayout *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkPipelineLayoutCreateInfo_temp(dec, (VkPipelineLayoutCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pPipelineLayout = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPipelineLayout));
if (!args->pPipelineLayout) return;
vn_decode_VkPipelineLayout(dec, args->pPipelineLayout);
} else {
args->pPipelineLayout = NULL;
}
}
static inline void vn_replace_vkCreatePipelineLayout_args_handle(struct vn_command_vkCreatePipelineLayout *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkPipelineLayoutCreateInfo_handle((VkPipelineLayoutCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pPipelineLayout */
}
static inline void vn_encode_vkCreatePipelineLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreatePipelineLayout *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreatePipelineLayout_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pPipelineLayout))
vn_encode_VkPipelineLayout(enc, args->pPipelineLayout);
}
static inline void vn_decode_vkDestroyPipelineLayout_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyPipelineLayout *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkPipelineLayout_lookup(dec, &args->pipelineLayout);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyPipelineLayout_args_handle(struct vn_command_vkDestroyPipelineLayout *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkPipelineLayout_handle(&args->pipelineLayout);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyPipelineLayout_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyPipelineLayout *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyPipelineLayout_EXT});
/* skip args->device */
/* skip args->pipelineLayout */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreatePipelineLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreatePipelineLayout args;
if (!ctx->dispatch_vkCreatePipelineLayout) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreatePipelineLayout_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreatePipelineLayout(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreatePipelineLayout returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreatePipelineLayout_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyPipelineLayout(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyPipelineLayout args;
if (!ctx->dispatch_vkDestroyPipelineLayout) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyPipelineLayout_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyPipelineLayout(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyPipelineLayout_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_PIPELINE_LAYOUT_H */

@ -0,0 +1,326 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_QUERY_POOL_H
#define VN_PROTOCOL_RENDERER_QUERY_POOL_H
#include "vn_protocol_renderer_structs.h"
/* struct VkQueryPoolCreateInfo chain */
static inline void *
vn_decode_VkQueryPoolCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkQueryPoolCreateInfo_self_temp(struct vn_cs_decoder *dec, VkQueryPoolCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkQueryType(dec, &val->queryType);
vn_decode_uint32_t(dec, &val->queryCount);
vn_decode_VkFlags(dec, &val->pipelineStatistics);
}
static inline void
vn_decode_VkQueryPoolCreateInfo_temp(struct vn_cs_decoder *dec, VkQueryPoolCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkQueryPoolCreateInfo_pnext_temp(dec);
vn_decode_VkQueryPoolCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkQueryPoolCreateInfo_handle_self(VkQueryPoolCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->queryType */
/* skip val->queryCount */
/* skip val->pipelineStatistics */
}
static inline void
vn_replace_VkQueryPoolCreateInfo_handle(VkQueryPoolCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO:
vn_replace_VkQueryPoolCreateInfo_handle_self((VkQueryPoolCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateQueryPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateQueryPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkQueryPoolCreateInfo_temp(dec, (VkQueryPoolCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pQueryPool = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pQueryPool));
if (!args->pQueryPool) return;
vn_decode_VkQueryPool(dec, args->pQueryPool);
} else {
args->pQueryPool = NULL;
}
}
static inline void vn_replace_vkCreateQueryPool_args_handle(struct vn_command_vkCreateQueryPool *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkQueryPoolCreateInfo_handle((VkQueryPoolCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pQueryPool */
}
static inline void vn_encode_vkCreateQueryPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateQueryPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateQueryPool_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pQueryPool))
vn_encode_VkQueryPool(enc, args->pQueryPool);
}
static inline void vn_decode_vkDestroyQueryPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyQueryPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkQueryPool_lookup(dec, &args->queryPool);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyQueryPool_args_handle(struct vn_command_vkDestroyQueryPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkQueryPool_handle(&args->queryPool);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyQueryPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyQueryPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyQueryPool_EXT});
/* skip args->device */
/* skip args->queryPool */
/* skip args->pAllocator */
}
static inline void vn_decode_vkGetQueryPoolResults_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetQueryPoolResults *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkQueryPool_lookup(dec, &args->queryPool);
vn_decode_uint32_t(dec, &args->firstQuery);
vn_decode_uint32_t(dec, &args->queryCount);
vn_decode_size_t(dec, &args->dataSize);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, args->dataSize);
args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return;
} else {
vn_decode_array_size(dec, 0);
args->pData = NULL;
}
vn_decode_VkDeviceSize(dec, &args->stride);
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkGetQueryPoolResults_args_handle(struct vn_command_vkGetQueryPoolResults *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkQueryPool_handle(&args->queryPool);
/* skip args->firstQuery */
/* skip args->queryCount */
/* skip args->dataSize */
/* skip args->pData */
/* skip args->stride */
/* skip args->flags */
}
static inline void vn_encode_vkGetQueryPoolResults_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetQueryPoolResults *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetQueryPoolResults_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->queryPool */
/* skip args->firstQuery */
/* skip args->queryCount */
/* skip args->dataSize */
if (args->pData) {
vn_encode_array_size(enc, args->dataSize);
vn_encode_blob_array(enc, args->pData, args->dataSize);
} else {
vn_encode_array_size(enc, 0);
}
/* skip args->stride */
/* skip args->flags */
}
static inline void vn_decode_vkResetQueryPool_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkResetQueryPool *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkQueryPool_lookup(dec, &args->queryPool);
vn_decode_uint32_t(dec, &args->firstQuery);
vn_decode_uint32_t(dec, &args->queryCount);
}
static inline void vn_replace_vkResetQueryPool_args_handle(struct vn_command_vkResetQueryPool *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkQueryPool_handle(&args->queryPool);
/* skip args->firstQuery */
/* skip args->queryCount */
}
static inline void vn_encode_vkResetQueryPool_reply(struct vn_cs_encoder *enc, const struct vn_command_vkResetQueryPool *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkResetQueryPool_EXT});
/* skip args->device */
/* skip args->queryPool */
/* skip args->firstQuery */
/* skip args->queryCount */
}
static inline void vn_dispatch_vkCreateQueryPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateQueryPool args;
if (!ctx->dispatch_vkCreateQueryPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateQueryPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateQueryPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateQueryPool returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateQueryPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyQueryPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyQueryPool args;
if (!ctx->dispatch_vkDestroyQueryPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyQueryPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyQueryPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyQueryPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetQueryPoolResults(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetQueryPoolResults args;
if (!ctx->dispatch_vkGetQueryPoolResults) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetQueryPoolResults_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetQueryPoolResults(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetQueryPoolResults returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetQueryPoolResults_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkResetQueryPool(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkResetQueryPool args;
if (!ctx->dispatch_vkResetQueryPool) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkResetQueryPool_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkResetQueryPool(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkResetQueryPool_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_QUERY_POOL_H */

@ -0,0 +1,943 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_QUEUE_H
#define VN_PROTOCOL_RENDERER_QUEUE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkDeviceGroupSubmitInfo chain */
static inline void *
vn_decode_VkDeviceGroupSubmitInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDeviceGroupSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceGroupSubmitInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->waitSemaphoreCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->waitSemaphoreCount);
val->pWaitSemaphoreDeviceIndices = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pWaitSemaphoreDeviceIndices) * array_size);
if (!val->pWaitSemaphoreDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pWaitSemaphoreDeviceIndices, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pWaitSemaphoreDeviceIndices = NULL;
}
vn_decode_uint32_t(dec, &val->commandBufferCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->commandBufferCount);
val->pCommandBufferDeviceMasks = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pCommandBufferDeviceMasks) * array_size);
if (!val->pCommandBufferDeviceMasks) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCommandBufferDeviceMasks, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pCommandBufferDeviceMasks = NULL;
}
vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->signalSemaphoreCount);
val->pSignalSemaphoreDeviceIndices = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSignalSemaphoreDeviceIndices) * array_size);
if (!val->pSignalSemaphoreDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pSignalSemaphoreDeviceIndices, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pSignalSemaphoreDeviceIndices = NULL;
}
}
static inline void
vn_decode_VkDeviceGroupSubmitInfo_temp(struct vn_cs_decoder *dec, VkDeviceGroupSubmitInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDeviceGroupSubmitInfo_pnext_temp(dec);
vn_decode_VkDeviceGroupSubmitInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDeviceGroupSubmitInfo_handle_self(VkDeviceGroupSubmitInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->waitSemaphoreCount */
/* skip val->pWaitSemaphoreDeviceIndices */
/* skip val->commandBufferCount */
/* skip val->pCommandBufferDeviceMasks */
/* skip val->signalSemaphoreCount */
/* skip val->pSignalSemaphoreDeviceIndices */
}
static inline void
vn_replace_VkDeviceGroupSubmitInfo_handle(VkDeviceGroupSubmitInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO:
vn_replace_VkDeviceGroupSubmitInfo_handle_self((VkDeviceGroupSubmitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkProtectedSubmitInfo chain */
static inline void *
vn_decode_VkProtectedSubmitInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkProtectedSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkProtectedSubmitInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkBool32(dec, &val->protectedSubmit);
}
static inline void
vn_decode_VkProtectedSubmitInfo_temp(struct vn_cs_decoder *dec, VkProtectedSubmitInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO);
val->sType = stype;
val->pNext = vn_decode_VkProtectedSubmitInfo_pnext_temp(dec);
vn_decode_VkProtectedSubmitInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkProtectedSubmitInfo_handle_self(VkProtectedSubmitInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->protectedSubmit */
}
static inline void
vn_replace_VkProtectedSubmitInfo_handle(VkProtectedSubmitInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO:
vn_replace_VkProtectedSubmitInfo_handle_self((VkProtectedSubmitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkTimelineSemaphoreSubmitInfo chain */
static inline void *
vn_decode_VkTimelineSemaphoreSubmitInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkTimelineSemaphoreSubmitInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->waitSemaphoreValueCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->waitSemaphoreValueCount);
val->pWaitSemaphoreValues = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pWaitSemaphoreValues) * array_size);
if (!val->pWaitSemaphoreValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pWaitSemaphoreValues, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pWaitSemaphoreValues = NULL;
}
vn_decode_uint32_t(dec, &val->signalSemaphoreValueCount);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->signalSemaphoreValueCount);
val->pSignalSemaphoreValues = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSignalSemaphoreValues) * array_size);
if (!val->pSignalSemaphoreValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pSignalSemaphoreValues, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pSignalSemaphoreValues = NULL;
}
}
static inline void
vn_decode_VkTimelineSemaphoreSubmitInfo_temp(struct vn_cs_decoder *dec, VkTimelineSemaphoreSubmitInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO);
val->sType = stype;
val->pNext = vn_decode_VkTimelineSemaphoreSubmitInfo_pnext_temp(dec);
vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkTimelineSemaphoreSubmitInfo_handle_self(VkTimelineSemaphoreSubmitInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->waitSemaphoreValueCount */
/* skip val->pWaitSemaphoreValues */
/* skip val->signalSemaphoreValueCount */
/* skip val->pSignalSemaphoreValues */
}
static inline void
vn_replace_VkTimelineSemaphoreSubmitInfo_handle(VkTimelineSemaphoreSubmitInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
vn_replace_VkTimelineSemaphoreSubmitInfo_handle_self((VkTimelineSemaphoreSubmitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSubmitInfo chain */
static inline void *
vn_decode_VkSubmitInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDeviceGroupSubmitInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSubmitInfo_pnext_temp(dec);
vn_decode_VkDeviceGroupSubmitInfo_self_temp(dec, (VkDeviceGroupSubmitInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkProtectedSubmitInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSubmitInfo_pnext_temp(dec);
vn_decode_VkProtectedSubmitInfo_self_temp(dec, (VkProtectedSubmitInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkTimelineSemaphoreSubmitInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSubmitInfo_pnext_temp(dec);
vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(dec, (VkTimelineSemaphoreSubmitInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->waitSemaphoreCount);
if (vn_peek_array_size(dec)) {
val->pWaitSemaphores = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pWaitSemaphores) * val->waitSemaphoreCount);
if (!val->pWaitSemaphores) return;
vn_decode_array_size(dec, val->waitSemaphoreCount);
for (uint32_t i = 0; i < val->waitSemaphoreCount; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pWaitSemaphores = NULL;
}
if (vn_peek_array_size(dec)) {
val->pWaitDstStageMask = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pWaitDstStageMask) * val->waitSemaphoreCount);
if (!val->pWaitDstStageMask) return;
vn_decode_array_size(dec, val->waitSemaphoreCount);
for (uint32_t i = 0; i < val->waitSemaphoreCount; i++)
vn_decode_VkFlags(dec, &((VkPipelineStageFlags *)val->pWaitDstStageMask)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pWaitDstStageMask = NULL;
}
vn_decode_uint32_t(dec, &val->commandBufferCount);
if (vn_peek_array_size(dec)) {
val->pCommandBuffers = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pCommandBuffers) * val->commandBufferCount);
if (!val->pCommandBuffers) return;
vn_decode_array_size(dec, val->commandBufferCount);
for (uint32_t i = 0; i < val->commandBufferCount; i++)
vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)val->pCommandBuffers)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pCommandBuffers = NULL;
}
vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
if (vn_peek_array_size(dec)) {
val->pSignalSemaphores = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSignalSemaphores) * val->signalSemaphoreCount);
if (!val->pSignalSemaphores) return;
vn_decode_array_size(dec, val->signalSemaphoreCount);
for (uint32_t i = 0; i < val->signalSemaphoreCount; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pSignalSemaphores = NULL;
}
}
static inline void
vn_decode_VkSubmitInfo_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SUBMIT_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSubmitInfo_pnext_temp(dec);
vn_decode_VkSubmitInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSubmitInfo_handle_self(VkSubmitInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->waitSemaphoreCount */
if (val->pWaitSemaphores) {
for (uint32_t i = 0; i < val->waitSemaphoreCount; i++)
vn_replace_VkSemaphore_handle(&((VkSemaphore *)val->pWaitSemaphores)[i]);
}
/* skip val->pWaitDstStageMask */
/* skip val->commandBufferCount */
if (val->pCommandBuffers) {
for (uint32_t i = 0; i < val->commandBufferCount; i++)
vn_replace_VkCommandBuffer_handle(&((VkCommandBuffer *)val->pCommandBuffers)[i]);
}
/* skip val->signalSemaphoreCount */
if (val->pSignalSemaphores) {
for (uint32_t i = 0; i < val->signalSemaphoreCount; i++)
vn_replace_VkSemaphore_handle(&((VkSemaphore *)val->pSignalSemaphores)[i]);
}
}
static inline void
vn_replace_VkSubmitInfo_handle(VkSubmitInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SUBMIT_INFO:
vn_replace_VkSubmitInfo_handle_self((VkSubmitInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO:
vn_replace_VkDeviceGroupSubmitInfo_handle_self((VkDeviceGroupSubmitInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO:
vn_replace_VkProtectedSubmitInfo_handle_self((VkProtectedSubmitInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
vn_replace_VkTimelineSemaphoreSubmitInfo_handle_self((VkTimelineSemaphoreSubmitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSparseMemoryBind */
static inline void
vn_decode_VkSparseMemoryBind_temp(struct vn_cs_decoder *dec, VkSparseMemoryBind *val)
{
vn_decode_VkDeviceSize(dec, &val->resourceOffset);
vn_decode_VkDeviceSize(dec, &val->size);
vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
vn_decode_VkDeviceSize(dec, &val->memoryOffset);
vn_decode_VkFlags(dec, &val->flags);
}
static inline void
vn_replace_VkSparseMemoryBind_handle(VkSparseMemoryBind *val)
{
/* skip val->resourceOffset */
/* skip val->size */
vn_replace_VkDeviceMemory_handle(&val->memory);
/* skip val->memoryOffset */
/* skip val->flags */
}
/* struct VkSparseBufferMemoryBindInfo */
static inline void
vn_decode_VkSparseBufferMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSparseBufferMemoryBindInfo *val)
{
vn_decode_VkBuffer_lookup(dec, &val->buffer);
vn_decode_uint32_t(dec, &val->bindCount);
if (vn_peek_array_size(dec)) {
val->pBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBinds) * val->bindCount);
if (!val->pBinds) return;
vn_decode_array_size(dec, val->bindCount);
for (uint32_t i = 0; i < val->bindCount; i++)
vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBinds = NULL;
}
}
static inline void
vn_replace_VkSparseBufferMemoryBindInfo_handle(VkSparseBufferMemoryBindInfo *val)
{
vn_replace_VkBuffer_handle(&val->buffer);
/* skip val->bindCount */
if (val->pBinds) {
for (uint32_t i = 0; i < val->bindCount; i++)
vn_replace_VkSparseMemoryBind_handle(&((VkSparseMemoryBind *)val->pBinds)[i]);
}
}
/* struct VkSparseImageOpaqueMemoryBindInfo */
static inline void
vn_decode_VkSparseImageOpaqueMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSparseImageOpaqueMemoryBindInfo *val)
{
vn_decode_VkImage_lookup(dec, &val->image);
vn_decode_uint32_t(dec, &val->bindCount);
if (vn_peek_array_size(dec)) {
val->pBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBinds) * val->bindCount);
if (!val->pBinds) return;
vn_decode_array_size(dec, val->bindCount);
for (uint32_t i = 0; i < val->bindCount; i++)
vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBinds = NULL;
}
}
static inline void
vn_replace_VkSparseImageOpaqueMemoryBindInfo_handle(VkSparseImageOpaqueMemoryBindInfo *val)
{
vn_replace_VkImage_handle(&val->image);
/* skip val->bindCount */
if (val->pBinds) {
for (uint32_t i = 0; i < val->bindCount; i++)
vn_replace_VkSparseMemoryBind_handle(&((VkSparseMemoryBind *)val->pBinds)[i]);
}
}
/* struct VkSparseImageMemoryBind */
static inline void
vn_decode_VkSparseImageMemoryBind_temp(struct vn_cs_decoder *dec, VkSparseImageMemoryBind *val)
{
vn_decode_VkImageSubresource_temp(dec, &val->subresource);
vn_decode_VkOffset3D_temp(dec, &val->offset);
vn_decode_VkExtent3D_temp(dec, &val->extent);
vn_decode_VkDeviceMemory_lookup(dec, &val->memory);
vn_decode_VkDeviceSize(dec, &val->memoryOffset);
vn_decode_VkFlags(dec, &val->flags);
}
static inline void
vn_replace_VkSparseImageMemoryBind_handle(VkSparseImageMemoryBind *val)
{
vn_replace_VkImageSubresource_handle(&val->subresource);
vn_replace_VkOffset3D_handle(&val->offset);
vn_replace_VkExtent3D_handle(&val->extent);
vn_replace_VkDeviceMemory_handle(&val->memory);
/* skip val->memoryOffset */
/* skip val->flags */
}
/* struct VkSparseImageMemoryBindInfo */
static inline void
vn_decode_VkSparseImageMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSparseImageMemoryBindInfo *val)
{
vn_decode_VkImage_lookup(dec, &val->image);
vn_decode_uint32_t(dec, &val->bindCount);
if (vn_peek_array_size(dec)) {
val->pBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBinds) * val->bindCount);
if (!val->pBinds) return;
vn_decode_array_size(dec, val->bindCount);
for (uint32_t i = 0; i < val->bindCount; i++)
vn_decode_VkSparseImageMemoryBind_temp(dec, &((VkSparseImageMemoryBind *)val->pBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBinds = NULL;
}
}
static inline void
vn_replace_VkSparseImageMemoryBindInfo_handle(VkSparseImageMemoryBindInfo *val)
{
vn_replace_VkImage_handle(&val->image);
/* skip val->bindCount */
if (val->pBinds) {
for (uint32_t i = 0; i < val->bindCount; i++)
vn_replace_VkSparseImageMemoryBind_handle(&((VkSparseImageMemoryBind *)val->pBinds)[i]);
}
}
/* struct VkDeviceGroupBindSparseInfo chain */
static inline void *
vn_decode_VkDeviceGroupBindSparseInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkDeviceGroupBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceGroupBindSparseInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->resourceDeviceIndex);
vn_decode_uint32_t(dec, &val->memoryDeviceIndex);
}
static inline void
vn_decode_VkDeviceGroupBindSparseInfo_temp(struct vn_cs_decoder *dec, VkDeviceGroupBindSparseInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkDeviceGroupBindSparseInfo_pnext_temp(dec);
vn_decode_VkDeviceGroupBindSparseInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkDeviceGroupBindSparseInfo_handle_self(VkDeviceGroupBindSparseInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->resourceDeviceIndex */
/* skip val->memoryDeviceIndex */
}
static inline void
vn_replace_VkDeviceGroupBindSparseInfo_handle(VkDeviceGroupBindSparseInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO:
vn_replace_VkDeviceGroupBindSparseInfo_handle_self((VkDeviceGroupBindSparseInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkBindSparseInfo chain */
static inline void *
vn_decode_VkBindSparseInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkDeviceGroupBindSparseInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkBindSparseInfo_pnext_temp(dec);
vn_decode_VkDeviceGroupBindSparseInfo_self_temp(dec, (VkDeviceGroupBindSparseInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkTimelineSemaphoreSubmitInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkBindSparseInfo_pnext_temp(dec);
vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(dec, (VkTimelineSemaphoreSubmitInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_uint32_t(dec, &val->waitSemaphoreCount);
if (vn_peek_array_size(dec)) {
val->pWaitSemaphores = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pWaitSemaphores) * val->waitSemaphoreCount);
if (!val->pWaitSemaphores) return;
vn_decode_array_size(dec, val->waitSemaphoreCount);
for (uint32_t i = 0; i < val->waitSemaphoreCount; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pWaitSemaphores = NULL;
}
vn_decode_uint32_t(dec, &val->bufferBindCount);
if (vn_peek_array_size(dec)) {
val->pBufferBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pBufferBinds) * val->bufferBindCount);
if (!val->pBufferBinds) return;
vn_decode_array_size(dec, val->bufferBindCount);
for (uint32_t i = 0; i < val->bufferBindCount; i++)
vn_decode_VkSparseBufferMemoryBindInfo_temp(dec, &((VkSparseBufferMemoryBindInfo *)val->pBufferBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pBufferBinds = NULL;
}
vn_decode_uint32_t(dec, &val->imageOpaqueBindCount);
if (vn_peek_array_size(dec)) {
val->pImageOpaqueBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pImageOpaqueBinds) * val->imageOpaqueBindCount);
if (!val->pImageOpaqueBinds) return;
vn_decode_array_size(dec, val->imageOpaqueBindCount);
for (uint32_t i = 0; i < val->imageOpaqueBindCount; i++)
vn_decode_VkSparseImageOpaqueMemoryBindInfo_temp(dec, &((VkSparseImageOpaqueMemoryBindInfo *)val->pImageOpaqueBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pImageOpaqueBinds = NULL;
}
vn_decode_uint32_t(dec, &val->imageBindCount);
if (vn_peek_array_size(dec)) {
val->pImageBinds = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pImageBinds) * val->imageBindCount);
if (!val->pImageBinds) return;
vn_decode_array_size(dec, val->imageBindCount);
for (uint32_t i = 0; i < val->imageBindCount; i++)
vn_decode_VkSparseImageMemoryBindInfo_temp(dec, &((VkSparseImageMemoryBindInfo *)val->pImageBinds)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pImageBinds = NULL;
}
vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
if (vn_peek_array_size(dec)) {
val->pSignalSemaphores = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSignalSemaphores) * val->signalSemaphoreCount);
if (!val->pSignalSemaphores) return;
vn_decode_array_size(dec, val->signalSemaphoreCount);
for (uint32_t i = 0; i < val->signalSemaphoreCount; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pSignalSemaphores = NULL;
}
}
static inline void
vn_decode_VkBindSparseInfo_temp(struct vn_cs_decoder *dec, VkBindSparseInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_BIND_SPARSE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkBindSparseInfo_pnext_temp(dec);
vn_decode_VkBindSparseInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkBindSparseInfo_handle_self(VkBindSparseInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->waitSemaphoreCount */
if (val->pWaitSemaphores) {
for (uint32_t i = 0; i < val->waitSemaphoreCount; i++)
vn_replace_VkSemaphore_handle(&((VkSemaphore *)val->pWaitSemaphores)[i]);
}
/* skip val->bufferBindCount */
if (val->pBufferBinds) {
for (uint32_t i = 0; i < val->bufferBindCount; i++)
vn_replace_VkSparseBufferMemoryBindInfo_handle(&((VkSparseBufferMemoryBindInfo *)val->pBufferBinds)[i]);
}
/* skip val->imageOpaqueBindCount */
if (val->pImageOpaqueBinds) {
for (uint32_t i = 0; i < val->imageOpaqueBindCount; i++)
vn_replace_VkSparseImageOpaqueMemoryBindInfo_handle(&((VkSparseImageOpaqueMemoryBindInfo *)val->pImageOpaqueBinds)[i]);
}
/* skip val->imageBindCount */
if (val->pImageBinds) {
for (uint32_t i = 0; i < val->imageBindCount; i++)
vn_replace_VkSparseImageMemoryBindInfo_handle(&((VkSparseImageMemoryBindInfo *)val->pImageBinds)[i]);
}
/* skip val->signalSemaphoreCount */
if (val->pSignalSemaphores) {
for (uint32_t i = 0; i < val->signalSemaphoreCount; i++)
vn_replace_VkSemaphore_handle(&((VkSemaphore *)val->pSignalSemaphores)[i]);
}
}
static inline void
vn_replace_VkBindSparseInfo_handle(VkBindSparseInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_BIND_SPARSE_INFO:
vn_replace_VkBindSparseInfo_handle_self((VkBindSparseInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO:
vn_replace_VkDeviceGroupBindSparseInfo_handle_self((VkDeviceGroupBindSparseInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
vn_replace_VkTimelineSemaphoreSubmitInfo_handle_self((VkTimelineSemaphoreSubmitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkQueueSubmit_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkQueueSubmit *args)
{
vn_decode_VkQueue_lookup(dec, &args->queue);
vn_decode_uint32_t(dec, &args->submitCount);
if (vn_peek_array_size(dec)) {
args->pSubmits = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSubmits) * args->submitCount);
if (!args->pSubmits) return;
vn_decode_array_size(dec, args->submitCount);
for (uint32_t i = 0; i < args->submitCount; i++)
vn_decode_VkSubmitInfo_temp(dec, &((VkSubmitInfo *)args->pSubmits)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pSubmits = NULL;
}
vn_decode_VkFence_lookup(dec, &args->fence);
}
static inline void vn_replace_vkQueueSubmit_args_handle(struct vn_command_vkQueueSubmit *args)
{
vn_replace_VkQueue_handle(&args->queue);
/* skip args->submitCount */
if (args->pSubmits) {
for (uint32_t i = 0; i < args->submitCount; i++)
vn_replace_VkSubmitInfo_handle(&((VkSubmitInfo *)args->pSubmits)[i]);
}
vn_replace_VkFence_handle(&args->fence);
}
static inline void vn_encode_vkQueueSubmit_reply(struct vn_cs_encoder *enc, const struct vn_command_vkQueueSubmit *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkQueueSubmit_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->queue */
/* skip args->submitCount */
/* skip args->pSubmits */
/* skip args->fence */
}
static inline void vn_decode_vkQueueWaitIdle_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkQueueWaitIdle *args)
{
vn_decode_VkQueue_lookup(dec, &args->queue);
}
static inline void vn_replace_vkQueueWaitIdle_args_handle(struct vn_command_vkQueueWaitIdle *args)
{
vn_replace_VkQueue_handle(&args->queue);
}
static inline void vn_encode_vkQueueWaitIdle_reply(struct vn_cs_encoder *enc, const struct vn_command_vkQueueWaitIdle *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkQueueWaitIdle_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->queue */
}
static inline void vn_decode_vkQueueBindSparse_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkQueueBindSparse *args)
{
vn_decode_VkQueue_lookup(dec, &args->queue);
vn_decode_uint32_t(dec, &args->bindInfoCount);
if (vn_peek_array_size(dec)) {
args->pBindInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pBindInfo) * args->bindInfoCount);
if (!args->pBindInfo) return;
vn_decode_array_size(dec, args->bindInfoCount);
for (uint32_t i = 0; i < args->bindInfoCount; i++)
vn_decode_VkBindSparseInfo_temp(dec, &((VkBindSparseInfo *)args->pBindInfo)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pBindInfo = NULL;
}
vn_decode_VkFence_lookup(dec, &args->fence);
}
static inline void vn_replace_vkQueueBindSparse_args_handle(struct vn_command_vkQueueBindSparse *args)
{
vn_replace_VkQueue_handle(&args->queue);
/* skip args->bindInfoCount */
if (args->pBindInfo) {
for (uint32_t i = 0; i < args->bindInfoCount; i++)
vn_replace_VkBindSparseInfo_handle(&((VkBindSparseInfo *)args->pBindInfo)[i]);
}
vn_replace_VkFence_handle(&args->fence);
}
static inline void vn_encode_vkQueueBindSparse_reply(struct vn_cs_encoder *enc, const struct vn_command_vkQueueBindSparse *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkQueueBindSparse_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->queue */
/* skip args->bindInfoCount */
/* skip args->pBindInfo */
/* skip args->fence */
}
static inline void vn_dispatch_vkQueueSubmit(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkQueueSubmit args;
if (!ctx->dispatch_vkQueueSubmit) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkQueueSubmit_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkQueueSubmit(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkQueueSubmit returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkQueueSubmit_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkQueueWaitIdle(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkQueueWaitIdle args;
if (!ctx->dispatch_vkQueueWaitIdle) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkQueueWaitIdle_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkQueueWaitIdle(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkQueueWaitIdle returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkQueueWaitIdle_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkQueueBindSparse(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkQueueBindSparse args;
if (!ctx->dispatch_vkQueueBindSparse) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkQueueBindSparse_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkQueueBindSparse(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkQueueBindSparse returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkQueueBindSparse_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_QUEUE_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,312 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_SAMPLER_H
#define VN_PROTOCOL_RENDERER_SAMPLER_H
#include "vn_protocol_renderer_structs.h"
/* struct VkSamplerReductionModeCreateInfo chain */
static inline void *
vn_decode_VkSamplerReductionModeCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkSamplerReductionModeCreateInfo_self_temp(struct vn_cs_decoder *dec, VkSamplerReductionModeCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkSamplerReductionMode(dec, &val->reductionMode);
}
static inline void
vn_decode_VkSamplerReductionModeCreateInfo_temp(struct vn_cs_decoder *dec, VkSamplerReductionModeCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSamplerReductionModeCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerReductionModeCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSamplerReductionModeCreateInfo_handle_self(VkSamplerReductionModeCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->reductionMode */
}
static inline void
vn_replace_VkSamplerReductionModeCreateInfo_handle(VkSamplerReductionModeCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO:
vn_replace_VkSamplerReductionModeCreateInfo_handle_self((VkSamplerReductionModeCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSamplerCreateInfo chain */
static inline void *
vn_decode_VkSamplerCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkSamplerYcbcrConversionInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSamplerCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerYcbcrConversionInfo_self_temp(dec, (VkSamplerYcbcrConversionInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkSamplerReductionModeCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSamplerCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerReductionModeCreateInfo_self_temp(dec, (VkSamplerReductionModeCreateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkSamplerCreateInfo_self_temp(struct vn_cs_decoder *dec, VkSamplerCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_VkFilter(dec, &val->magFilter);
vn_decode_VkFilter(dec, &val->minFilter);
vn_decode_VkSamplerMipmapMode(dec, &val->mipmapMode);
vn_decode_VkSamplerAddressMode(dec, &val->addressModeU);
vn_decode_VkSamplerAddressMode(dec, &val->addressModeV);
vn_decode_VkSamplerAddressMode(dec, &val->addressModeW);
vn_decode_float(dec, &val->mipLodBias);
vn_decode_VkBool32(dec, &val->anisotropyEnable);
vn_decode_float(dec, &val->maxAnisotropy);
vn_decode_VkBool32(dec, &val->compareEnable);
vn_decode_VkCompareOp(dec, &val->compareOp);
vn_decode_float(dec, &val->minLod);
vn_decode_float(dec, &val->maxLod);
vn_decode_VkBorderColor(dec, &val->borderColor);
vn_decode_VkBool32(dec, &val->unnormalizedCoordinates);
}
static inline void
vn_decode_VkSamplerCreateInfo_temp(struct vn_cs_decoder *dec, VkSamplerCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSamplerCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSamplerCreateInfo_handle_self(VkSamplerCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->magFilter */
/* skip val->minFilter */
/* skip val->mipmapMode */
/* skip val->addressModeU */
/* skip val->addressModeV */
/* skip val->addressModeW */
/* skip val->mipLodBias */
/* skip val->anisotropyEnable */
/* skip val->maxAnisotropy */
/* skip val->compareEnable */
/* skip val->compareOp */
/* skip val->minLod */
/* skip val->maxLod */
/* skip val->borderColor */
/* skip val->unnormalizedCoordinates */
}
static inline void
vn_replace_VkSamplerCreateInfo_handle(VkSamplerCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO:
vn_replace_VkSamplerCreateInfo_handle_self((VkSamplerCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
vn_replace_VkSamplerYcbcrConversionInfo_handle_self((VkSamplerYcbcrConversionInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO:
vn_replace_VkSamplerReductionModeCreateInfo_handle_self((VkSamplerReductionModeCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateSampler_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateSampler *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkSamplerCreateInfo_temp(dec, (VkSamplerCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pSampler = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSampler));
if (!args->pSampler) return;
vn_decode_VkSampler(dec, args->pSampler);
} else {
args->pSampler = NULL;
}
}
static inline void vn_replace_vkCreateSampler_args_handle(struct vn_command_vkCreateSampler *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkSamplerCreateInfo_handle((VkSamplerCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pSampler */
}
static inline void vn_encode_vkCreateSampler_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateSampler *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateSampler_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pSampler))
vn_encode_VkSampler(enc, args->pSampler);
}
static inline void vn_decode_vkDestroySampler_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroySampler *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkSampler_lookup(dec, &args->sampler);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroySampler_args_handle(struct vn_command_vkDestroySampler *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkSampler_handle(&args->sampler);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroySampler_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroySampler *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroySampler_EXT});
/* skip args->device */
/* skip args->sampler */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateSampler(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateSampler args;
if (!ctx->dispatch_vkCreateSampler) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateSampler_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateSampler(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateSampler returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateSampler_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroySampler(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroySampler args;
if (!ctx->dispatch_vkDestroySampler) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroySampler_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroySampler(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroySampler_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_SAMPLER_H */

@ -0,0 +1,206 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_SAMPLER_YCBCR_CONVERSION_H
#define VN_PROTOCOL_RENDERER_SAMPLER_YCBCR_CONVERSION_H
#include "vn_protocol_renderer_structs.h"
/* struct VkSamplerYcbcrConversionCreateInfo chain */
static inline void *
vn_decode_VkSamplerYcbcrConversionCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkSamplerYcbcrConversionCreateInfo_self_temp(struct vn_cs_decoder *dec, VkSamplerYcbcrConversionCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFormat(dec, &val->format);
vn_decode_VkSamplerYcbcrModelConversion(dec, &val->ycbcrModel);
vn_decode_VkSamplerYcbcrRange(dec, &val->ycbcrRange);
vn_decode_VkComponentMapping_temp(dec, &val->components);
vn_decode_VkChromaLocation(dec, &val->xChromaOffset);
vn_decode_VkChromaLocation(dec, &val->yChromaOffset);
vn_decode_VkFilter(dec, &val->chromaFilter);
vn_decode_VkBool32(dec, &val->forceExplicitReconstruction);
}
static inline void
vn_decode_VkSamplerYcbcrConversionCreateInfo_temp(struct vn_cs_decoder *dec, VkSamplerYcbcrConversionCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSamplerYcbcrConversionCreateInfo_pnext_temp(dec);
vn_decode_VkSamplerYcbcrConversionCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSamplerYcbcrConversionCreateInfo_handle_self(VkSamplerYcbcrConversionCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->format */
/* skip val->ycbcrModel */
/* skip val->ycbcrRange */
vn_replace_VkComponentMapping_handle(&val->components);
/* skip val->xChromaOffset */
/* skip val->yChromaOffset */
/* skip val->chromaFilter */
/* skip val->forceExplicitReconstruction */
}
static inline void
vn_replace_VkSamplerYcbcrConversionCreateInfo_handle(VkSamplerYcbcrConversionCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO:
vn_replace_VkSamplerYcbcrConversionCreateInfo_handle_self((VkSamplerYcbcrConversionCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateSamplerYcbcrConversion_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateSamplerYcbcrConversion *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkSamplerYcbcrConversionCreateInfo_temp(dec, (VkSamplerYcbcrConversionCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pYcbcrConversion = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pYcbcrConversion));
if (!args->pYcbcrConversion) return;
vn_decode_VkSamplerYcbcrConversion(dec, args->pYcbcrConversion);
} else {
args->pYcbcrConversion = NULL;
}
}
static inline void vn_replace_vkCreateSamplerYcbcrConversion_args_handle(struct vn_command_vkCreateSamplerYcbcrConversion *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkSamplerYcbcrConversionCreateInfo_handle((VkSamplerYcbcrConversionCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pYcbcrConversion */
}
static inline void vn_encode_vkCreateSamplerYcbcrConversion_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateSamplerYcbcrConversion *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateSamplerYcbcrConversion_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pYcbcrConversion))
vn_encode_VkSamplerYcbcrConversion(enc, args->pYcbcrConversion);
}
static inline void vn_decode_vkDestroySamplerYcbcrConversion_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroySamplerYcbcrConversion *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkSamplerYcbcrConversion_lookup(dec, &args->ycbcrConversion);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroySamplerYcbcrConversion_args_handle(struct vn_command_vkDestroySamplerYcbcrConversion *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkSamplerYcbcrConversion_handle(&args->ycbcrConversion);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroySamplerYcbcrConversion_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroySamplerYcbcrConversion *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroySamplerYcbcrConversion_EXT});
/* skip args->device */
/* skip args->ycbcrConversion */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateSamplerYcbcrConversion(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateSamplerYcbcrConversion args;
if (!ctx->dispatch_vkCreateSamplerYcbcrConversion) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateSamplerYcbcrConversion_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateSamplerYcbcrConversion(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateSamplerYcbcrConversion returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateSamplerYcbcrConversion_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroySamplerYcbcrConversion(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroySamplerYcbcrConversion args;
if (!ctx->dispatch_vkDestroySamplerYcbcrConversion) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroySamplerYcbcrConversion_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroySamplerYcbcrConversion(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroySamplerYcbcrConversion_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_SAMPLER_YCBCR_CONVERSION_H */

@ -0,0 +1,625 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_SEMAPHORE_H
#define VN_PROTOCOL_RENDERER_SEMAPHORE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkExportSemaphoreCreateInfo chain */
static inline void *
vn_decode_VkExportSemaphoreCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkExportSemaphoreCreateInfo_self_temp(struct vn_cs_decoder *dec, VkExportSemaphoreCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->handleTypes);
}
static inline void
vn_decode_VkExportSemaphoreCreateInfo_temp(struct vn_cs_decoder *dec, VkExportSemaphoreCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkExportSemaphoreCreateInfo_pnext_temp(dec);
vn_decode_VkExportSemaphoreCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkExportSemaphoreCreateInfo_handle_self(VkExportSemaphoreCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->handleTypes */
}
static inline void
vn_replace_VkExportSemaphoreCreateInfo_handle(VkExportSemaphoreCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO:
vn_replace_VkExportSemaphoreCreateInfo_handle_self((VkExportSemaphoreCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSemaphoreCreateInfo chain */
static inline void *
vn_decode_VkSemaphoreCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
VkBaseOutStructure *pnext;
VkStructureType stype;
if (!vn_decode_simple_pointer(dec))
return NULL;
vn_decode_VkStructureType(dec, &stype);
switch ((int32_t)stype) {
case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkExportSemaphoreCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSemaphoreCreateInfo_pnext_temp(dec);
vn_decode_VkExportSemaphoreCreateInfo_self_temp(dec, (VkExportSemaphoreCreateInfo *)pnext);
}
break;
case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO:
pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkSemaphoreTypeCreateInfo));
if (pnext) {
pnext->sType = stype;
pnext->pNext = vn_decode_VkSemaphoreCreateInfo_pnext_temp(dec);
vn_decode_VkSemaphoreTypeCreateInfo_self_temp(dec, (VkSemaphoreTypeCreateInfo *)pnext);
}
break;
default:
/* unexpected struct */
pnext = NULL;
vn_cs_decoder_set_fatal(dec);
break;
}
return pnext;
}
static inline void
vn_decode_VkSemaphoreCreateInfo_self_temp(struct vn_cs_decoder *dec, VkSemaphoreCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
}
static inline void
vn_decode_VkSemaphoreCreateInfo_temp(struct vn_cs_decoder *dec, VkSemaphoreCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSemaphoreCreateInfo_pnext_temp(dec);
vn_decode_VkSemaphoreCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSemaphoreCreateInfo_handle_self(VkSemaphoreCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
}
static inline void
vn_replace_VkSemaphoreCreateInfo_handle(VkSemaphoreCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO:
vn_replace_VkSemaphoreCreateInfo_handle_self((VkSemaphoreCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO:
vn_replace_VkExportSemaphoreCreateInfo_handle_self((VkExportSemaphoreCreateInfo *)pnext);
break;
case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO:
vn_replace_VkSemaphoreTypeCreateInfo_handle_self((VkSemaphoreTypeCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSemaphoreWaitInfo chain */
static inline void *
vn_decode_VkSemaphoreWaitInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkSemaphoreWaitInfo_self_temp(struct vn_cs_decoder *dec, VkSemaphoreWaitInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->semaphoreCount);
if (vn_peek_array_size(dec)) {
val->pSemaphores = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pSemaphores) * val->semaphoreCount);
if (!val->pSemaphores) return;
vn_decode_array_size(dec, val->semaphoreCount);
for (uint32_t i = 0; i < val->semaphoreCount; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSemaphores)[i]);
} else {
vn_decode_array_size(dec, 0);
val->pSemaphores = NULL;
}
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->semaphoreCount);
val->pValues = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pValues) * array_size);
if (!val->pValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pValues, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pValues = NULL;
}
}
static inline void
vn_decode_VkSemaphoreWaitInfo_temp(struct vn_cs_decoder *dec, VkSemaphoreWaitInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSemaphoreWaitInfo_pnext_temp(dec);
vn_decode_VkSemaphoreWaitInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSemaphoreWaitInfo_handle_self(VkSemaphoreWaitInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->semaphoreCount */
if (val->pSemaphores) {
for (uint32_t i = 0; i < val->semaphoreCount; i++)
vn_replace_VkSemaphore_handle(&((VkSemaphore *)val->pSemaphores)[i]);
}
/* skip val->pValues */
}
static inline void
vn_replace_VkSemaphoreWaitInfo_handle(VkSemaphoreWaitInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO:
vn_replace_VkSemaphoreWaitInfo_handle_self((VkSemaphoreWaitInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkSemaphoreSignalInfo chain */
static inline void
vn_encode_VkSemaphoreSignalInfo_pnext(struct vn_cs_encoder *enc, const void *val)
{
/* no known/supported struct */
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkSemaphoreSignalInfo_self(struct vn_cs_encoder *enc, const VkSemaphoreSignalInfo *val)
{
/* skip val->{sType,pNext} */
vn_encode_VkSemaphore(enc, &val->semaphore);
vn_encode_uint64_t(enc, &val->value);
}
static inline void
vn_encode_VkSemaphoreSignalInfo(struct vn_cs_encoder *enc, const VkSemaphoreSignalInfo *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO });
vn_encode_VkSemaphoreSignalInfo_pnext(enc, val->pNext);
vn_encode_VkSemaphoreSignalInfo_self(enc, val);
}
static inline void *
vn_decode_VkSemaphoreSignalInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkSemaphoreSignalInfo_self_temp(struct vn_cs_decoder *dec, VkSemaphoreSignalInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkSemaphore_lookup(dec, &val->semaphore);
vn_decode_uint64_t(dec, &val->value);
}
static inline void
vn_decode_VkSemaphoreSignalInfo_temp(struct vn_cs_decoder *dec, VkSemaphoreSignalInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO);
val->sType = stype;
val->pNext = vn_decode_VkSemaphoreSignalInfo_pnext_temp(dec);
vn_decode_VkSemaphoreSignalInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkSemaphoreSignalInfo_handle_self(VkSemaphoreSignalInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
vn_replace_VkSemaphore_handle(&val->semaphore);
/* skip val->value */
}
static inline void
vn_replace_VkSemaphoreSignalInfo_handle(VkSemaphoreSignalInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO:
vn_replace_VkSemaphoreSignalInfo_handle_self((VkSemaphoreSignalInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateSemaphore_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateSemaphore *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkSemaphoreCreateInfo_temp(dec, (VkSemaphoreCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pSemaphore = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSemaphore));
if (!args->pSemaphore) return;
vn_decode_VkSemaphore(dec, args->pSemaphore);
} else {
args->pSemaphore = NULL;
}
}
static inline void vn_replace_vkCreateSemaphore_args_handle(struct vn_command_vkCreateSemaphore *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkSemaphoreCreateInfo_handle((VkSemaphoreCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pSemaphore */
}
static inline void vn_encode_vkCreateSemaphore_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateSemaphore *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateSemaphore_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pSemaphore))
vn_encode_VkSemaphore(enc, args->pSemaphore);
}
static inline void vn_decode_vkDestroySemaphore_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroySemaphore *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkSemaphore_lookup(dec, &args->semaphore);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroySemaphore_args_handle(struct vn_command_vkDestroySemaphore *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkSemaphore_handle(&args->semaphore);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroySemaphore_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroySemaphore *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroySemaphore_EXT});
/* skip args->device */
/* skip args->semaphore */
/* skip args->pAllocator */
}
static inline void vn_decode_vkGetSemaphoreCounterValue_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetSemaphoreCounterValue *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkSemaphore_lookup(dec, &args->semaphore);
if (vn_decode_simple_pointer(dec)) {
args->pValue = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pValue));
if (!args->pValue) return;
} else {
args->pValue = NULL;
}
}
static inline void vn_replace_vkGetSemaphoreCounterValue_args_handle(struct vn_command_vkGetSemaphoreCounterValue *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkSemaphore_handle(&args->semaphore);
/* skip args->pValue */
}
static inline void vn_encode_vkGetSemaphoreCounterValue_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetSemaphoreCounterValue *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetSemaphoreCounterValue_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->semaphore */
if (vn_encode_simple_pointer(enc, args->pValue))
vn_encode_uint64_t(enc, args->pValue);
}
static inline void vn_decode_vkWaitSemaphores_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkWaitSemaphores *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pWaitInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pWaitInfo));
if (!args->pWaitInfo) return;
vn_decode_VkSemaphoreWaitInfo_temp(dec, (VkSemaphoreWaitInfo *)args->pWaitInfo);
} else {
args->pWaitInfo = NULL;
}
vn_decode_uint64_t(dec, &args->timeout);
}
static inline void vn_replace_vkWaitSemaphores_args_handle(struct vn_command_vkWaitSemaphores *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pWaitInfo)
vn_replace_VkSemaphoreWaitInfo_handle((VkSemaphoreWaitInfo *)args->pWaitInfo);
/* skip args->timeout */
}
static inline void vn_encode_vkWaitSemaphores_reply(struct vn_cs_encoder *enc, const struct vn_command_vkWaitSemaphores *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkWaitSemaphores_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pWaitInfo */
/* skip args->timeout */
}
static inline void vn_decode_vkSignalSemaphore_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSignalSemaphore *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pSignalInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSignalInfo));
if (!args->pSignalInfo) return;
vn_decode_VkSemaphoreSignalInfo_temp(dec, (VkSemaphoreSignalInfo *)args->pSignalInfo);
} else {
args->pSignalInfo = NULL;
}
}
static inline void vn_replace_vkSignalSemaphore_args_handle(struct vn_command_vkSignalSemaphore *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pSignalInfo)
vn_replace_VkSemaphoreSignalInfo_handle((VkSemaphoreSignalInfo *)args->pSignalInfo);
}
static inline void vn_encode_vkSignalSemaphore_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSignalSemaphore *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSignalSemaphore_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pSignalInfo */
}
static inline void vn_dispatch_vkCreateSemaphore(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateSemaphore args;
if (!ctx->dispatch_vkCreateSemaphore) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateSemaphore_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateSemaphore(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateSemaphore returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateSemaphore_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroySemaphore(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroySemaphore args;
if (!ctx->dispatch_vkDestroySemaphore) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroySemaphore_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroySemaphore(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroySemaphore_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetSemaphoreCounterValue(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetSemaphoreCounterValue args;
if (!ctx->dispatch_vkGetSemaphoreCounterValue) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetSemaphoreCounterValue_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetSemaphoreCounterValue(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetSemaphoreCounterValue returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetSemaphoreCounterValue_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkWaitSemaphores(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkWaitSemaphores args;
if (!ctx->dispatch_vkWaitSemaphores) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkWaitSemaphores_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkWaitSemaphores(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkWaitSemaphores returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkWaitSemaphores_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkSignalSemaphore(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkSignalSemaphore args;
if (!ctx->dispatch_vkSignalSemaphore) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkSignalSemaphore_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkSignalSemaphore(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkSignalSemaphore returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkSignalSemaphore_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_SEMAPHORE_H */

@ -0,0 +1,204 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_SHADER_MODULE_H
#define VN_PROTOCOL_RENDERER_SHADER_MODULE_H
#include "vn_protocol_renderer_structs.h"
/* struct VkShaderModuleCreateInfo chain */
static inline void *
vn_decode_VkShaderModuleCreateInfo_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkShaderModuleCreateInfo_self_temp(struct vn_cs_decoder *dec, VkShaderModuleCreateInfo *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_size_t(dec, &val->codeSize);
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, val->codeSize / 4);
val->pCode = vn_cs_decoder_alloc_temp(dec, sizeof(*val->pCode) * array_size);
if (!val->pCode) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCode, array_size);
} else {
vn_decode_array_size(dec, 0);
val->pCode = NULL;
}
}
static inline void
vn_decode_VkShaderModuleCreateInfo_temp(struct vn_cs_decoder *dec, VkShaderModuleCreateInfo *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO);
val->sType = stype;
val->pNext = vn_decode_VkShaderModuleCreateInfo_pnext_temp(dec);
vn_decode_VkShaderModuleCreateInfo_self_temp(dec, val);
}
static inline void
vn_replace_VkShaderModuleCreateInfo_handle_self(VkShaderModuleCreateInfo *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->codeSize */
/* skip val->pCode */
}
static inline void
vn_replace_VkShaderModuleCreateInfo_handle(VkShaderModuleCreateInfo *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO:
vn_replace_VkShaderModuleCreateInfo_handle_self((VkShaderModuleCreateInfo *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
static inline void vn_decode_vkCreateShaderModule_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateShaderModule *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkShaderModuleCreateInfo_temp(dec, (VkShaderModuleCreateInfo *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
if (vn_decode_simple_pointer(dec)) {
args->pShaderModule = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pShaderModule));
if (!args->pShaderModule) return;
vn_decode_VkShaderModule(dec, args->pShaderModule);
} else {
args->pShaderModule = NULL;
}
}
static inline void vn_replace_vkCreateShaderModule_args_handle(struct vn_command_vkCreateShaderModule *args)
{
vn_replace_VkDevice_handle(&args->device);
if (args->pCreateInfo)
vn_replace_VkShaderModuleCreateInfo_handle((VkShaderModuleCreateInfo *)args->pCreateInfo);
/* skip args->pAllocator */
/* skip args->pShaderModule */
}
static inline void vn_encode_vkCreateShaderModule_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateShaderModule *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateShaderModule_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->pCreateInfo */
/* skip args->pAllocator */
if (vn_encode_simple_pointer(enc, args->pShaderModule))
vn_encode_VkShaderModule(enc, args->pShaderModule);
}
static inline void vn_decode_vkDestroyShaderModule_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyShaderModule *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_VkShaderModule_lookup(dec, &args->shaderModule);
if (vn_decode_simple_pointer(dec)) {
assert(false);
} else {
args->pAllocator = NULL;
}
}
static inline void vn_replace_vkDestroyShaderModule_args_handle(struct vn_command_vkDestroyShaderModule *args)
{
vn_replace_VkDevice_handle(&args->device);
vn_replace_VkShaderModule_handle(&args->shaderModule);
/* skip args->pAllocator */
}
static inline void vn_encode_vkDestroyShaderModule_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyShaderModule *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyShaderModule_EXT});
/* skip args->device */
/* skip args->shaderModule */
/* skip args->pAllocator */
}
static inline void vn_dispatch_vkCreateShaderModule(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateShaderModule args;
if (!ctx->dispatch_vkCreateShaderModule) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateShaderModule_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateShaderModule(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkCreateShaderModule returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateShaderModule_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyShaderModule(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyShaderModule args;
if (!ctx->dispatch_vkDestroyShaderModule) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyShaderModule_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyShaderModule(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyShaderModule_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_SHADER_MODULE_H */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,581 @@
/* This file is generated by venus-protocol git-e05ae158. */
/*
* Copyright 2020 Google LLC
* SPDX-License-Identifier: MIT
*/
#ifndef VN_PROTOCOL_RENDERER_TRANSPORT_H
#define VN_PROTOCOL_RENDERER_TRANSPORT_H
#include "vn_protocol_renderer_structs.h"
/* struct VkCommandStreamDescriptionMESA */
static inline void
vn_decode_VkCommandStreamDescriptionMESA_temp(struct vn_cs_decoder *dec, VkCommandStreamDescriptionMESA *val)
{
vn_decode_uint32_t(dec, &val->resourceId);
vn_decode_size_t(dec, &val->offset);
vn_decode_size_t(dec, &val->size);
}
static inline void
vn_replace_VkCommandStreamDescriptionMESA_handle(VkCommandStreamDescriptionMESA *val)
{
/* skip val->resourceId */
/* skip val->offset */
/* skip val->size */
}
/* struct VkCommandStreamDependencyMESA */
static inline void
vn_decode_VkCommandStreamDependencyMESA_temp(struct vn_cs_decoder *dec, VkCommandStreamDependencyMESA *val)
{
vn_decode_uint32_t(dec, &val->srcCommandStream);
vn_decode_uint32_t(dec, &val->dstCommandStream);
}
static inline void
vn_replace_VkCommandStreamDependencyMESA_handle(VkCommandStreamDependencyMESA *val)
{
/* skip val->srcCommandStream */
/* skip val->dstCommandStream */
}
/* struct VkRingCreateInfoMESA chain */
static inline void *
vn_decode_VkRingCreateInfoMESA_pnext_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkRingCreateInfoMESA_self_temp(struct vn_cs_decoder *dec, VkRingCreateInfoMESA *val)
{
/* skip val->{sType,pNext} */
vn_decode_VkFlags(dec, &val->flags);
vn_decode_uint32_t(dec, &val->resourceId);
vn_decode_size_t(dec, &val->offset);
vn_decode_size_t(dec, &val->size);
vn_decode_uint64_t(dec, &val->idleTimeout);
vn_decode_size_t(dec, &val->headOffset);
vn_decode_size_t(dec, &val->tailOffset);
vn_decode_size_t(dec, &val->statusOffset);
vn_decode_size_t(dec, &val->bufferOffset);
vn_decode_size_t(dec, &val->bufferSize);
vn_decode_size_t(dec, &val->extraOffset);
vn_decode_size_t(dec, &val->extraSize);
}
static inline void
vn_decode_VkRingCreateInfoMESA_temp(struct vn_cs_decoder *dec, VkRingCreateInfoMESA *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA);
val->sType = stype;
val->pNext = vn_decode_VkRingCreateInfoMESA_pnext_temp(dec);
vn_decode_VkRingCreateInfoMESA_self_temp(dec, val);
}
static inline void
vn_replace_VkRingCreateInfoMESA_handle_self(VkRingCreateInfoMESA *val)
{
/* skip val->sType */
/* skip val->pNext */
/* skip val->flags */
/* skip val->resourceId */
/* skip val->offset */
/* skip val->size */
/* skip val->idleTimeout */
/* skip val->headOffset */
/* skip val->tailOffset */
/* skip val->statusOffset */
/* skip val->bufferOffset */
/* skip val->bufferSize */
/* skip val->extraOffset */
/* skip val->extraSize */
}
static inline void
vn_replace_VkRingCreateInfoMESA_handle(VkRingCreateInfoMESA *val)
{
struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val;
do {
switch ((int32_t)pnext->sType) {
case VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA:
vn_replace_VkRingCreateInfoMESA_handle_self((VkRingCreateInfoMESA *)pnext);
break;
default:
/* ignore unknown/unsupported struct */
break;
}
pnext = pnext->pNext;
} while (pnext);
}
/* struct VkMemoryResourcePropertiesMESA chain */
static inline void
vn_encode_VkMemoryResourcePropertiesMESA_pnext(struct vn_cs_encoder *enc, const void *val)
{
/* no known/supported struct */
vn_encode_simple_pointer(enc, NULL);
}
static inline void
vn_encode_VkMemoryResourcePropertiesMESA_self(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
{
/* skip val->{sType,pNext} */
vn_encode_uint32_t(enc, &val->memoryTypeBits);
}
static inline void
vn_encode_VkMemoryResourcePropertiesMESA(struct vn_cs_encoder *enc, const VkMemoryResourcePropertiesMESA *val)
{
assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA);
vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA });
vn_encode_VkMemoryResourcePropertiesMESA_pnext(enc, val->pNext);
vn_encode_VkMemoryResourcePropertiesMESA_self(enc, val);
}
static inline void *
vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(struct vn_cs_decoder *dec)
{
/* no known/supported struct */
if (vn_decode_simple_pointer(dec))
vn_cs_decoder_set_fatal(dec);
return NULL;
}
static inline void
vn_decode_VkMemoryResourcePropertiesMESA_self_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
{
/* skip val->{sType,pNext} */
/* skip val->memoryTypeBits */
}
static inline void
vn_decode_VkMemoryResourcePropertiesMESA_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourcePropertiesMESA *val)
{
VkStructureType stype;
vn_decode_VkStructureType(dec, &stype);
assert(stype == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA);
val->sType = stype;
val->pNext = vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(dec);
vn_decode_VkMemoryResourcePropertiesMESA_self_partial_temp(dec, val);
}
static inline void vn_decode_vkSetReplyCommandStreamMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSetReplyCommandStreamMESA *args)
{
if (vn_decode_simple_pointer(dec)) {
args->pStream = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pStream));
if (!args->pStream) return;
vn_decode_VkCommandStreamDescriptionMESA_temp(dec, (VkCommandStreamDescriptionMESA *)args->pStream);
} else {
args->pStream = NULL;
}
}
static inline void vn_replace_vkSetReplyCommandStreamMESA_args_handle(struct vn_command_vkSetReplyCommandStreamMESA *args)
{
if (args->pStream)
vn_replace_VkCommandStreamDescriptionMESA_handle((VkCommandStreamDescriptionMESA *)args->pStream);
}
static inline void vn_encode_vkSetReplyCommandStreamMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSetReplyCommandStreamMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT});
/* skip args->pStream */
}
static inline void vn_decode_vkSeekReplyCommandStreamMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkSeekReplyCommandStreamMESA *args)
{
vn_decode_size_t(dec, &args->position);
}
static inline void vn_replace_vkSeekReplyCommandStreamMESA_args_handle(struct vn_command_vkSeekReplyCommandStreamMESA *args)
{
/* skip args->position */
}
static inline void vn_encode_vkSeekReplyCommandStreamMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkSeekReplyCommandStreamMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT});
/* skip args->position */
}
static inline void vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkExecuteCommandStreamsMESA *args)
{
vn_decode_uint32_t(dec, &args->streamCount);
if (vn_peek_array_size(dec)) {
args->pStreams = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pStreams) * args->streamCount);
if (!args->pStreams) return;
vn_decode_array_size(dec, args->streamCount);
for (uint32_t i = 0; i < args->streamCount; i++)
vn_decode_VkCommandStreamDescriptionMESA_temp(dec, &((VkCommandStreamDescriptionMESA *)args->pStreams)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pStreams = NULL;
}
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, args->streamCount);
args->pReplyPositions = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pReplyPositions) * array_size);
if (!args->pReplyPositions) return;
vn_decode_size_t_array(dec, (size_t *)args->pReplyPositions, array_size);
} else {
vn_decode_array_size(dec, 0);
args->pReplyPositions = NULL;
}
vn_decode_uint32_t(dec, &args->dependencyCount);
if (vn_peek_array_size(dec)) {
args->pDependencies = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDependencies) * args->dependencyCount);
if (!args->pDependencies) return;
vn_decode_array_size(dec, args->dependencyCount);
for (uint32_t i = 0; i < args->dependencyCount; i++)
vn_decode_VkCommandStreamDependencyMESA_temp(dec, &((VkCommandStreamDependencyMESA *)args->pDependencies)[i]);
} else {
vn_decode_array_size(dec, 0);
args->pDependencies = NULL;
}
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkExecuteCommandStreamsMESA_args_handle(struct vn_command_vkExecuteCommandStreamsMESA *args)
{
/* skip args->streamCount */
if (args->pStreams) {
for (uint32_t i = 0; i < args->streamCount; i++)
vn_replace_VkCommandStreamDescriptionMESA_handle(&((VkCommandStreamDescriptionMESA *)args->pStreams)[i]);
}
/* skip args->pReplyPositions */
/* skip args->dependencyCount */
if (args->pDependencies) {
for (uint32_t i = 0; i < args->dependencyCount; i++)
vn_replace_VkCommandStreamDependencyMESA_handle(&((VkCommandStreamDependencyMESA *)args->pDependencies)[i]);
}
/* skip args->flags */
}
static inline void vn_encode_vkExecuteCommandStreamsMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkExecuteCommandStreamsMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT});
/* skip args->streamCount */
/* skip args->pStreams */
/* skip args->pReplyPositions */
/* skip args->dependencyCount */
/* skip args->pDependencies */
/* skip args->flags */
}
static inline void vn_decode_vkCreateRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCreateRingMESA *args)
{
vn_decode_uint64_t(dec, &args->ring);
if (vn_decode_simple_pointer(dec)) {
args->pCreateInfo = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCreateInfo));
if (!args->pCreateInfo) return;
vn_decode_VkRingCreateInfoMESA_temp(dec, (VkRingCreateInfoMESA *)args->pCreateInfo);
} else {
args->pCreateInfo = NULL;
}
}
static inline void vn_replace_vkCreateRingMESA_args_handle(struct vn_command_vkCreateRingMESA *args)
{
/* skip args->ring */
if (args->pCreateInfo)
vn_replace_VkRingCreateInfoMESA_handle((VkRingCreateInfoMESA *)args->pCreateInfo);
}
static inline void vn_encode_vkCreateRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCreateRingMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCreateRingMESA_EXT});
/* skip args->ring */
/* skip args->pCreateInfo */
}
static inline void vn_decode_vkDestroyRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkDestroyRingMESA *args)
{
vn_decode_uint64_t(dec, &args->ring);
}
static inline void vn_replace_vkDestroyRingMESA_args_handle(struct vn_command_vkDestroyRingMESA *args)
{
/* skip args->ring */
}
static inline void vn_encode_vkDestroyRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkDestroyRingMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkDestroyRingMESA_EXT});
/* skip args->ring */
}
static inline void vn_decode_vkNotifyRingMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkNotifyRingMESA *args)
{
vn_decode_uint64_t(dec, &args->ring);
vn_decode_uint32_t(dec, &args->seqno);
vn_decode_VkFlags(dec, &args->flags);
}
static inline void vn_replace_vkNotifyRingMESA_args_handle(struct vn_command_vkNotifyRingMESA *args)
{
/* skip args->ring */
/* skip args->seqno */
/* skip args->flags */
}
static inline void vn_encode_vkNotifyRingMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkNotifyRingMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkNotifyRingMESA_EXT});
/* skip args->ring */
/* skip args->seqno */
/* skip args->flags */
}
static inline void vn_decode_vkWriteRingExtraMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkWriteRingExtraMESA *args)
{
vn_decode_uint64_t(dec, &args->ring);
vn_decode_size_t(dec, &args->offset);
vn_decode_uint32_t(dec, &args->value);
}
static inline void vn_replace_vkWriteRingExtraMESA_args_handle(struct vn_command_vkWriteRingExtraMESA *args)
{
/* skip args->ring */
/* skip args->offset */
/* skip args->value */
}
static inline void vn_encode_vkWriteRingExtraMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkWriteRingExtraMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT});
/* skip args->ring */
/* skip args->offset */
/* skip args->value */
}
static inline void vn_decode_vkGetMemoryResourcePropertiesMESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
{
vn_decode_VkDevice_lookup(dec, &args->device);
vn_decode_uint32_t(dec, &args->resourceId);
if (vn_decode_simple_pointer(dec)) {
args->pMemoryResourceProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pMemoryResourceProperties));
if (!args->pMemoryResourceProperties) return;
vn_decode_VkMemoryResourcePropertiesMESA_partial_temp(dec, args->pMemoryResourceProperties);
} else {
args->pMemoryResourceProperties = NULL;
}
}
static inline void vn_replace_vkGetMemoryResourcePropertiesMESA_args_handle(struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
{
vn_replace_VkDevice_handle(&args->device);
/* skip args->resourceId */
/* skip args->pMemoryResourceProperties */
}
static inline void vn_encode_vkGetMemoryResourcePropertiesMESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetMemoryResourcePropertiesMESA *args)
{
vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT});
vn_encode_VkResult(enc, &args->ret);
/* skip args->device */
/* skip args->resourceId */
if (vn_encode_simple_pointer(enc, args->pMemoryResourceProperties))
vn_encode_VkMemoryResourcePropertiesMESA(enc, args->pMemoryResourceProperties);
}
static inline void vn_dispatch_vkSetReplyCommandStreamMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkSetReplyCommandStreamMESA args;
if (!ctx->dispatch_vkSetReplyCommandStreamMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkSetReplyCommandStreamMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkSetReplyCommandStreamMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkSetReplyCommandStreamMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkSeekReplyCommandStreamMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkSeekReplyCommandStreamMESA args;
if (!ctx->dispatch_vkSeekReplyCommandStreamMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkSeekReplyCommandStreamMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkSeekReplyCommandStreamMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkSeekReplyCommandStreamMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkExecuteCommandStreamsMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkExecuteCommandStreamsMESA args;
if (!ctx->dispatch_vkExecuteCommandStreamsMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkExecuteCommandStreamsMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkExecuteCommandStreamsMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkExecuteCommandStreamsMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkCreateRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkCreateRingMESA args;
if (!ctx->dispatch_vkCreateRingMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkCreateRingMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkCreateRingMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkCreateRingMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkDestroyRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkDestroyRingMESA args;
if (!ctx->dispatch_vkDestroyRingMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkDestroyRingMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkDestroyRingMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkDestroyRingMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkNotifyRingMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkNotifyRingMESA args;
if (!ctx->dispatch_vkNotifyRingMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkNotifyRingMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkNotifyRingMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkNotifyRingMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkWriteRingExtraMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkWriteRingExtraMESA args;
if (!ctx->dispatch_vkWriteRingExtraMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkWriteRingExtraMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkWriteRingExtraMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkWriteRingExtraMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
static inline void vn_dispatch_vkGetMemoryResourcePropertiesMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags)
{
struct vn_command_vkGetMemoryResourcePropertiesMESA args;
if (!ctx->dispatch_vkGetMemoryResourcePropertiesMESA) {
vn_cs_decoder_set_fatal(ctx->decoder);
return;
}
vn_decode_vkGetMemoryResourcePropertiesMESA_args_temp(ctx->decoder, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder))
ctx->dispatch_vkGetMemoryResourcePropertiesMESA(ctx, &args);
if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) {
switch (args.ret) {
case VK_ERROR_FORMAT_NOT_SUPPORTED:
break;
default:
vn_dispatch_debug_log(ctx, "vkGetMemoryResourcePropertiesMESA returned %d", args.ret);
break;
}
}
if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT))
vn_encode_vkGetMemoryResourcePropertiesMESA_reply(ctx->encoder, &args);
vn_cs_decoder_reset_temp_pool(ctx->decoder);
}
#endif /* VN_PROTOCOL_RENDERER_TRANSPORT_H */

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-2c678af3. */ /* This file is generated by venus-protocol git-e05ae158. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC

Loading…
Cancel
Save