1bf215546Sopenharmony_ci/* This file is generated by venus-protocol. See vn_protocol_driver.h. */ 2bf215546Sopenharmony_ci 3bf215546Sopenharmony_ci/* 4bf215546Sopenharmony_ci * Copyright 2020 Google LLC 5bf215546Sopenharmony_ci * SPDX-License-Identifier: MIT 6bf215546Sopenharmony_ci */ 7bf215546Sopenharmony_ci 8bf215546Sopenharmony_ci#ifndef VN_PROTOCOL_DRIVER_HANDLES_H 9bf215546Sopenharmony_ci#define VN_PROTOCOL_DRIVER_HANDLES_H 10bf215546Sopenharmony_ci 11bf215546Sopenharmony_ci#include "vn_protocol_driver_types.h" 12bf215546Sopenharmony_ci 13bf215546Sopenharmony_ci/* VK_DEFINE_HANDLE(VkInstance) */ 14bf215546Sopenharmony_ci 15bf215546Sopenharmony_cistatic inline size_t 16bf215546Sopenharmony_civn_sizeof_VkInstance(const VkInstance *val) 17bf215546Sopenharmony_ci{ 18bf215546Sopenharmony_ci return sizeof(uint64_t); 19bf215546Sopenharmony_ci} 20bf215546Sopenharmony_ci 21bf215546Sopenharmony_cistatic inline void 22bf215546Sopenharmony_civn_encode_VkInstance(struct vn_cs_encoder *enc, const VkInstance *val) 23bf215546Sopenharmony_ci{ 24bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_INSTANCE); 25bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 26bf215546Sopenharmony_ci} 27bf215546Sopenharmony_ci 28bf215546Sopenharmony_cistatic inline void 29bf215546Sopenharmony_civn_decode_VkInstance(struct vn_cs_decoder *dec, VkInstance *val) 30bf215546Sopenharmony_ci{ 31bf215546Sopenharmony_ci uint64_t id; 32bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 33bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_INSTANCE); 34bf215546Sopenharmony_ci} 35bf215546Sopenharmony_ci 36bf215546Sopenharmony_ci/* VK_DEFINE_HANDLE(VkPhysicalDevice) */ 37bf215546Sopenharmony_ci 38bf215546Sopenharmony_cistatic inline size_t 39bf215546Sopenharmony_civn_sizeof_VkPhysicalDevice(const VkPhysicalDevice *val) 40bf215546Sopenharmony_ci{ 41bf215546Sopenharmony_ci return sizeof(uint64_t); 42bf215546Sopenharmony_ci} 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_cistatic inline void 45bf215546Sopenharmony_civn_encode_VkPhysicalDevice(struct vn_cs_encoder *enc, const VkPhysicalDevice *val) 46bf215546Sopenharmony_ci{ 47bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_PHYSICAL_DEVICE); 48bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 49bf215546Sopenharmony_ci} 50bf215546Sopenharmony_ci 51bf215546Sopenharmony_cistatic inline void 52bf215546Sopenharmony_civn_decode_VkPhysicalDevice(struct vn_cs_decoder *dec, VkPhysicalDevice *val) 53bf215546Sopenharmony_ci{ 54bf215546Sopenharmony_ci uint64_t id; 55bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 56bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_PHYSICAL_DEVICE); 57bf215546Sopenharmony_ci} 58bf215546Sopenharmony_ci 59bf215546Sopenharmony_ci/* VK_DEFINE_HANDLE(VkDevice) */ 60bf215546Sopenharmony_ci 61bf215546Sopenharmony_cistatic inline size_t 62bf215546Sopenharmony_civn_sizeof_VkDevice(const VkDevice *val) 63bf215546Sopenharmony_ci{ 64bf215546Sopenharmony_ci return sizeof(uint64_t); 65bf215546Sopenharmony_ci} 66bf215546Sopenharmony_ci 67bf215546Sopenharmony_cistatic inline void 68bf215546Sopenharmony_civn_encode_VkDevice(struct vn_cs_encoder *enc, const VkDevice *val) 69bf215546Sopenharmony_ci{ 70bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DEVICE); 71bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 72bf215546Sopenharmony_ci} 73bf215546Sopenharmony_ci 74bf215546Sopenharmony_cistatic inline void 75bf215546Sopenharmony_civn_decode_VkDevice(struct vn_cs_decoder *dec, VkDevice *val) 76bf215546Sopenharmony_ci{ 77bf215546Sopenharmony_ci uint64_t id; 78bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 79bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DEVICE); 80bf215546Sopenharmony_ci} 81bf215546Sopenharmony_ci 82bf215546Sopenharmony_ci/* VK_DEFINE_HANDLE(VkQueue) */ 83bf215546Sopenharmony_ci 84bf215546Sopenharmony_cistatic inline size_t 85bf215546Sopenharmony_civn_sizeof_VkQueue(const VkQueue *val) 86bf215546Sopenharmony_ci{ 87bf215546Sopenharmony_ci return sizeof(uint64_t); 88bf215546Sopenharmony_ci} 89bf215546Sopenharmony_ci 90bf215546Sopenharmony_cistatic inline void 91bf215546Sopenharmony_civn_encode_VkQueue(struct vn_cs_encoder *enc, const VkQueue *val) 92bf215546Sopenharmony_ci{ 93bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_QUEUE); 94bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 95bf215546Sopenharmony_ci} 96bf215546Sopenharmony_ci 97bf215546Sopenharmony_cistatic inline void 98bf215546Sopenharmony_civn_decode_VkQueue(struct vn_cs_decoder *dec, VkQueue *val) 99bf215546Sopenharmony_ci{ 100bf215546Sopenharmony_ci uint64_t id; 101bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 102bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_QUEUE); 103bf215546Sopenharmony_ci} 104bf215546Sopenharmony_ci 105bf215546Sopenharmony_ci/* VK_DEFINE_HANDLE(VkCommandBuffer) */ 106bf215546Sopenharmony_ci 107bf215546Sopenharmony_cistatic inline size_t 108bf215546Sopenharmony_civn_sizeof_VkCommandBuffer(const VkCommandBuffer *val) 109bf215546Sopenharmony_ci{ 110bf215546Sopenharmony_ci return sizeof(uint64_t); 111bf215546Sopenharmony_ci} 112bf215546Sopenharmony_ci 113bf215546Sopenharmony_cistatic inline void 114bf215546Sopenharmony_civn_encode_VkCommandBuffer(struct vn_cs_encoder *enc, const VkCommandBuffer *val) 115bf215546Sopenharmony_ci{ 116bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_COMMAND_BUFFER); 117bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 118bf215546Sopenharmony_ci} 119bf215546Sopenharmony_ci 120bf215546Sopenharmony_cistatic inline void 121bf215546Sopenharmony_civn_decode_VkCommandBuffer(struct vn_cs_decoder *dec, VkCommandBuffer *val) 122bf215546Sopenharmony_ci{ 123bf215546Sopenharmony_ci uint64_t id; 124bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 125bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_COMMAND_BUFFER); 126bf215546Sopenharmony_ci} 127bf215546Sopenharmony_ci 128bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) */ 129bf215546Sopenharmony_ci 130bf215546Sopenharmony_cistatic inline size_t 131bf215546Sopenharmony_civn_sizeof_VkDeviceMemory(const VkDeviceMemory *val) 132bf215546Sopenharmony_ci{ 133bf215546Sopenharmony_ci return sizeof(uint64_t); 134bf215546Sopenharmony_ci} 135bf215546Sopenharmony_ci 136bf215546Sopenharmony_cistatic inline void 137bf215546Sopenharmony_civn_encode_VkDeviceMemory(struct vn_cs_encoder *enc, const VkDeviceMemory *val) 138bf215546Sopenharmony_ci{ 139bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DEVICE_MEMORY); 140bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 141bf215546Sopenharmony_ci} 142bf215546Sopenharmony_ci 143bf215546Sopenharmony_cistatic inline void 144bf215546Sopenharmony_civn_decode_VkDeviceMemory(struct vn_cs_decoder *dec, VkDeviceMemory *val) 145bf215546Sopenharmony_ci{ 146bf215546Sopenharmony_ci uint64_t id; 147bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 148bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DEVICE_MEMORY); 149bf215546Sopenharmony_ci} 150bf215546Sopenharmony_ci 151bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) */ 152bf215546Sopenharmony_ci 153bf215546Sopenharmony_cistatic inline size_t 154bf215546Sopenharmony_civn_sizeof_VkCommandPool(const VkCommandPool *val) 155bf215546Sopenharmony_ci{ 156bf215546Sopenharmony_ci return sizeof(uint64_t); 157bf215546Sopenharmony_ci} 158bf215546Sopenharmony_ci 159bf215546Sopenharmony_cistatic inline void 160bf215546Sopenharmony_civn_encode_VkCommandPool(struct vn_cs_encoder *enc, const VkCommandPool *val) 161bf215546Sopenharmony_ci{ 162bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_COMMAND_POOL); 163bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 164bf215546Sopenharmony_ci} 165bf215546Sopenharmony_ci 166bf215546Sopenharmony_cistatic inline void 167bf215546Sopenharmony_civn_decode_VkCommandPool(struct vn_cs_decoder *dec, VkCommandPool *val) 168bf215546Sopenharmony_ci{ 169bf215546Sopenharmony_ci uint64_t id; 170bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 171bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_COMMAND_POOL); 172bf215546Sopenharmony_ci} 173bf215546Sopenharmony_ci 174bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) */ 175bf215546Sopenharmony_ci 176bf215546Sopenharmony_cistatic inline size_t 177bf215546Sopenharmony_civn_sizeof_VkBuffer(const VkBuffer *val) 178bf215546Sopenharmony_ci{ 179bf215546Sopenharmony_ci return sizeof(uint64_t); 180bf215546Sopenharmony_ci} 181bf215546Sopenharmony_ci 182bf215546Sopenharmony_cistatic inline void 183bf215546Sopenharmony_civn_encode_VkBuffer(struct vn_cs_encoder *enc, const VkBuffer *val) 184bf215546Sopenharmony_ci{ 185bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_BUFFER); 186bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 187bf215546Sopenharmony_ci} 188bf215546Sopenharmony_ci 189bf215546Sopenharmony_cistatic inline void 190bf215546Sopenharmony_civn_decode_VkBuffer(struct vn_cs_decoder *dec, VkBuffer *val) 191bf215546Sopenharmony_ci{ 192bf215546Sopenharmony_ci uint64_t id; 193bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 194bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_BUFFER); 195bf215546Sopenharmony_ci} 196bf215546Sopenharmony_ci 197bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) */ 198bf215546Sopenharmony_ci 199bf215546Sopenharmony_cistatic inline size_t 200bf215546Sopenharmony_civn_sizeof_VkBufferView(const VkBufferView *val) 201bf215546Sopenharmony_ci{ 202bf215546Sopenharmony_ci return sizeof(uint64_t); 203bf215546Sopenharmony_ci} 204bf215546Sopenharmony_ci 205bf215546Sopenharmony_cistatic inline void 206bf215546Sopenharmony_civn_encode_VkBufferView(struct vn_cs_encoder *enc, const VkBufferView *val) 207bf215546Sopenharmony_ci{ 208bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_BUFFER_VIEW); 209bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 210bf215546Sopenharmony_ci} 211bf215546Sopenharmony_ci 212bf215546Sopenharmony_cistatic inline void 213bf215546Sopenharmony_civn_decode_VkBufferView(struct vn_cs_decoder *dec, VkBufferView *val) 214bf215546Sopenharmony_ci{ 215bf215546Sopenharmony_ci uint64_t id; 216bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 217bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_BUFFER_VIEW); 218bf215546Sopenharmony_ci} 219bf215546Sopenharmony_ci 220bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) */ 221bf215546Sopenharmony_ci 222bf215546Sopenharmony_cistatic inline size_t 223bf215546Sopenharmony_civn_sizeof_VkImage(const VkImage *val) 224bf215546Sopenharmony_ci{ 225bf215546Sopenharmony_ci return sizeof(uint64_t); 226bf215546Sopenharmony_ci} 227bf215546Sopenharmony_ci 228bf215546Sopenharmony_cistatic inline void 229bf215546Sopenharmony_civn_encode_VkImage(struct vn_cs_encoder *enc, const VkImage *val) 230bf215546Sopenharmony_ci{ 231bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_IMAGE); 232bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 233bf215546Sopenharmony_ci} 234bf215546Sopenharmony_ci 235bf215546Sopenharmony_cistatic inline void 236bf215546Sopenharmony_civn_decode_VkImage(struct vn_cs_decoder *dec, VkImage *val) 237bf215546Sopenharmony_ci{ 238bf215546Sopenharmony_ci uint64_t id; 239bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 240bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_IMAGE); 241bf215546Sopenharmony_ci} 242bf215546Sopenharmony_ci 243bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) */ 244bf215546Sopenharmony_ci 245bf215546Sopenharmony_cistatic inline size_t 246bf215546Sopenharmony_civn_sizeof_VkImageView(const VkImageView *val) 247bf215546Sopenharmony_ci{ 248bf215546Sopenharmony_ci return sizeof(uint64_t); 249bf215546Sopenharmony_ci} 250bf215546Sopenharmony_ci 251bf215546Sopenharmony_cistatic inline void 252bf215546Sopenharmony_civn_encode_VkImageView(struct vn_cs_encoder *enc, const VkImageView *val) 253bf215546Sopenharmony_ci{ 254bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_IMAGE_VIEW); 255bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 256bf215546Sopenharmony_ci} 257bf215546Sopenharmony_ci 258bf215546Sopenharmony_cistatic inline void 259bf215546Sopenharmony_civn_decode_VkImageView(struct vn_cs_decoder *dec, VkImageView *val) 260bf215546Sopenharmony_ci{ 261bf215546Sopenharmony_ci uint64_t id; 262bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 263bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_IMAGE_VIEW); 264bf215546Sopenharmony_ci} 265bf215546Sopenharmony_ci 266bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) */ 267bf215546Sopenharmony_ci 268bf215546Sopenharmony_cistatic inline size_t 269bf215546Sopenharmony_civn_sizeof_VkShaderModule(const VkShaderModule *val) 270bf215546Sopenharmony_ci{ 271bf215546Sopenharmony_ci return sizeof(uint64_t); 272bf215546Sopenharmony_ci} 273bf215546Sopenharmony_ci 274bf215546Sopenharmony_cistatic inline void 275bf215546Sopenharmony_civn_encode_VkShaderModule(struct vn_cs_encoder *enc, const VkShaderModule *val) 276bf215546Sopenharmony_ci{ 277bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_SHADER_MODULE); 278bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 279bf215546Sopenharmony_ci} 280bf215546Sopenharmony_ci 281bf215546Sopenharmony_cistatic inline void 282bf215546Sopenharmony_civn_decode_VkShaderModule(struct vn_cs_decoder *dec, VkShaderModule *val) 283bf215546Sopenharmony_ci{ 284bf215546Sopenharmony_ci uint64_t id; 285bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 286bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_SHADER_MODULE); 287bf215546Sopenharmony_ci} 288bf215546Sopenharmony_ci 289bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) */ 290bf215546Sopenharmony_ci 291bf215546Sopenharmony_cistatic inline size_t 292bf215546Sopenharmony_civn_sizeof_VkPipeline(const VkPipeline *val) 293bf215546Sopenharmony_ci{ 294bf215546Sopenharmony_ci return sizeof(uint64_t); 295bf215546Sopenharmony_ci} 296bf215546Sopenharmony_ci 297bf215546Sopenharmony_cistatic inline void 298bf215546Sopenharmony_civn_encode_VkPipeline(struct vn_cs_encoder *enc, const VkPipeline *val) 299bf215546Sopenharmony_ci{ 300bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_PIPELINE); 301bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 302bf215546Sopenharmony_ci} 303bf215546Sopenharmony_ci 304bf215546Sopenharmony_cistatic inline void 305bf215546Sopenharmony_civn_decode_VkPipeline(struct vn_cs_decoder *dec, VkPipeline *val) 306bf215546Sopenharmony_ci{ 307bf215546Sopenharmony_ci uint64_t id; 308bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 309bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_PIPELINE); 310bf215546Sopenharmony_ci} 311bf215546Sopenharmony_ci 312bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) */ 313bf215546Sopenharmony_ci 314bf215546Sopenharmony_cistatic inline size_t 315bf215546Sopenharmony_civn_sizeof_VkPipelineLayout(const VkPipelineLayout *val) 316bf215546Sopenharmony_ci{ 317bf215546Sopenharmony_ci return sizeof(uint64_t); 318bf215546Sopenharmony_ci} 319bf215546Sopenharmony_ci 320bf215546Sopenharmony_cistatic inline void 321bf215546Sopenharmony_civn_encode_VkPipelineLayout(struct vn_cs_encoder *enc, const VkPipelineLayout *val) 322bf215546Sopenharmony_ci{ 323bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_PIPELINE_LAYOUT); 324bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 325bf215546Sopenharmony_ci} 326bf215546Sopenharmony_ci 327bf215546Sopenharmony_cistatic inline void 328bf215546Sopenharmony_civn_decode_VkPipelineLayout(struct vn_cs_decoder *dec, VkPipelineLayout *val) 329bf215546Sopenharmony_ci{ 330bf215546Sopenharmony_ci uint64_t id; 331bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 332bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_PIPELINE_LAYOUT); 333bf215546Sopenharmony_ci} 334bf215546Sopenharmony_ci 335bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) */ 336bf215546Sopenharmony_ci 337bf215546Sopenharmony_cistatic inline size_t 338bf215546Sopenharmony_civn_sizeof_VkSampler(const VkSampler *val) 339bf215546Sopenharmony_ci{ 340bf215546Sopenharmony_ci return sizeof(uint64_t); 341bf215546Sopenharmony_ci} 342bf215546Sopenharmony_ci 343bf215546Sopenharmony_cistatic inline void 344bf215546Sopenharmony_civn_encode_VkSampler(struct vn_cs_encoder *enc, const VkSampler *val) 345bf215546Sopenharmony_ci{ 346bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_SAMPLER); 347bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 348bf215546Sopenharmony_ci} 349bf215546Sopenharmony_ci 350bf215546Sopenharmony_cistatic inline void 351bf215546Sopenharmony_civn_decode_VkSampler(struct vn_cs_decoder *dec, VkSampler *val) 352bf215546Sopenharmony_ci{ 353bf215546Sopenharmony_ci uint64_t id; 354bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 355bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_SAMPLER); 356bf215546Sopenharmony_ci} 357bf215546Sopenharmony_ci 358bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) */ 359bf215546Sopenharmony_ci 360bf215546Sopenharmony_cistatic inline size_t 361bf215546Sopenharmony_civn_sizeof_VkDescriptorSet(const VkDescriptorSet *val) 362bf215546Sopenharmony_ci{ 363bf215546Sopenharmony_ci return sizeof(uint64_t); 364bf215546Sopenharmony_ci} 365bf215546Sopenharmony_ci 366bf215546Sopenharmony_cistatic inline void 367bf215546Sopenharmony_civn_encode_VkDescriptorSet(struct vn_cs_encoder *enc, const VkDescriptorSet *val) 368bf215546Sopenharmony_ci{ 369bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DESCRIPTOR_SET); 370bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 371bf215546Sopenharmony_ci} 372bf215546Sopenharmony_ci 373bf215546Sopenharmony_cistatic inline void 374bf215546Sopenharmony_civn_decode_VkDescriptorSet(struct vn_cs_decoder *dec, VkDescriptorSet *val) 375bf215546Sopenharmony_ci{ 376bf215546Sopenharmony_ci uint64_t id; 377bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 378bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DESCRIPTOR_SET); 379bf215546Sopenharmony_ci} 380bf215546Sopenharmony_ci 381bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) */ 382bf215546Sopenharmony_ci 383bf215546Sopenharmony_cistatic inline size_t 384bf215546Sopenharmony_civn_sizeof_VkDescriptorSetLayout(const VkDescriptorSetLayout *val) 385bf215546Sopenharmony_ci{ 386bf215546Sopenharmony_ci return sizeof(uint64_t); 387bf215546Sopenharmony_ci} 388bf215546Sopenharmony_ci 389bf215546Sopenharmony_cistatic inline void 390bf215546Sopenharmony_civn_encode_VkDescriptorSetLayout(struct vn_cs_encoder *enc, const VkDescriptorSetLayout *val) 391bf215546Sopenharmony_ci{ 392bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT); 393bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 394bf215546Sopenharmony_ci} 395bf215546Sopenharmony_ci 396bf215546Sopenharmony_cistatic inline void 397bf215546Sopenharmony_civn_decode_VkDescriptorSetLayout(struct vn_cs_decoder *dec, VkDescriptorSetLayout *val) 398bf215546Sopenharmony_ci{ 399bf215546Sopenharmony_ci uint64_t id; 400bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 401bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT); 402bf215546Sopenharmony_ci} 403bf215546Sopenharmony_ci 404bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) */ 405bf215546Sopenharmony_ci 406bf215546Sopenharmony_cistatic inline size_t 407bf215546Sopenharmony_civn_sizeof_VkDescriptorPool(const VkDescriptorPool *val) 408bf215546Sopenharmony_ci{ 409bf215546Sopenharmony_ci return sizeof(uint64_t); 410bf215546Sopenharmony_ci} 411bf215546Sopenharmony_ci 412bf215546Sopenharmony_cistatic inline void 413bf215546Sopenharmony_civn_encode_VkDescriptorPool(struct vn_cs_encoder *enc, const VkDescriptorPool *val) 414bf215546Sopenharmony_ci{ 415bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DESCRIPTOR_POOL); 416bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 417bf215546Sopenharmony_ci} 418bf215546Sopenharmony_ci 419bf215546Sopenharmony_cistatic inline void 420bf215546Sopenharmony_civn_decode_VkDescriptorPool(struct vn_cs_decoder *dec, VkDescriptorPool *val) 421bf215546Sopenharmony_ci{ 422bf215546Sopenharmony_ci uint64_t id; 423bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 424bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DESCRIPTOR_POOL); 425bf215546Sopenharmony_ci} 426bf215546Sopenharmony_ci 427bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) */ 428bf215546Sopenharmony_ci 429bf215546Sopenharmony_cistatic inline size_t 430bf215546Sopenharmony_civn_sizeof_VkFence(const VkFence *val) 431bf215546Sopenharmony_ci{ 432bf215546Sopenharmony_ci return sizeof(uint64_t); 433bf215546Sopenharmony_ci} 434bf215546Sopenharmony_ci 435bf215546Sopenharmony_cistatic inline void 436bf215546Sopenharmony_civn_encode_VkFence(struct vn_cs_encoder *enc, const VkFence *val) 437bf215546Sopenharmony_ci{ 438bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_FENCE); 439bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 440bf215546Sopenharmony_ci} 441bf215546Sopenharmony_ci 442bf215546Sopenharmony_cistatic inline void 443bf215546Sopenharmony_civn_decode_VkFence(struct vn_cs_decoder *dec, VkFence *val) 444bf215546Sopenharmony_ci{ 445bf215546Sopenharmony_ci uint64_t id; 446bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 447bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_FENCE); 448bf215546Sopenharmony_ci} 449bf215546Sopenharmony_ci 450bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) */ 451bf215546Sopenharmony_ci 452bf215546Sopenharmony_cistatic inline size_t 453bf215546Sopenharmony_civn_sizeof_VkSemaphore(const VkSemaphore *val) 454bf215546Sopenharmony_ci{ 455bf215546Sopenharmony_ci return sizeof(uint64_t); 456bf215546Sopenharmony_ci} 457bf215546Sopenharmony_ci 458bf215546Sopenharmony_cistatic inline void 459bf215546Sopenharmony_civn_encode_VkSemaphore(struct vn_cs_encoder *enc, const VkSemaphore *val) 460bf215546Sopenharmony_ci{ 461bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_SEMAPHORE); 462bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 463bf215546Sopenharmony_ci} 464bf215546Sopenharmony_ci 465bf215546Sopenharmony_cistatic inline void 466bf215546Sopenharmony_civn_decode_VkSemaphore(struct vn_cs_decoder *dec, VkSemaphore *val) 467bf215546Sopenharmony_ci{ 468bf215546Sopenharmony_ci uint64_t id; 469bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 470bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_SEMAPHORE); 471bf215546Sopenharmony_ci} 472bf215546Sopenharmony_ci 473bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) */ 474bf215546Sopenharmony_ci 475bf215546Sopenharmony_cistatic inline size_t 476bf215546Sopenharmony_civn_sizeof_VkEvent(const VkEvent *val) 477bf215546Sopenharmony_ci{ 478bf215546Sopenharmony_ci return sizeof(uint64_t); 479bf215546Sopenharmony_ci} 480bf215546Sopenharmony_ci 481bf215546Sopenharmony_cistatic inline void 482bf215546Sopenharmony_civn_encode_VkEvent(struct vn_cs_encoder *enc, const VkEvent *val) 483bf215546Sopenharmony_ci{ 484bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_EVENT); 485bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 486bf215546Sopenharmony_ci} 487bf215546Sopenharmony_ci 488bf215546Sopenharmony_cistatic inline void 489bf215546Sopenharmony_civn_decode_VkEvent(struct vn_cs_decoder *dec, VkEvent *val) 490bf215546Sopenharmony_ci{ 491bf215546Sopenharmony_ci uint64_t id; 492bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 493bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_EVENT); 494bf215546Sopenharmony_ci} 495bf215546Sopenharmony_ci 496bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) */ 497bf215546Sopenharmony_ci 498bf215546Sopenharmony_cistatic inline size_t 499bf215546Sopenharmony_civn_sizeof_VkQueryPool(const VkQueryPool *val) 500bf215546Sopenharmony_ci{ 501bf215546Sopenharmony_ci return sizeof(uint64_t); 502bf215546Sopenharmony_ci} 503bf215546Sopenharmony_ci 504bf215546Sopenharmony_cistatic inline void 505bf215546Sopenharmony_civn_encode_VkQueryPool(struct vn_cs_encoder *enc, const VkQueryPool *val) 506bf215546Sopenharmony_ci{ 507bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_QUERY_POOL); 508bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 509bf215546Sopenharmony_ci} 510bf215546Sopenharmony_ci 511bf215546Sopenharmony_cistatic inline void 512bf215546Sopenharmony_civn_decode_VkQueryPool(struct vn_cs_decoder *dec, VkQueryPool *val) 513bf215546Sopenharmony_ci{ 514bf215546Sopenharmony_ci uint64_t id; 515bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 516bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_QUERY_POOL); 517bf215546Sopenharmony_ci} 518bf215546Sopenharmony_ci 519bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) */ 520bf215546Sopenharmony_ci 521bf215546Sopenharmony_cistatic inline size_t 522bf215546Sopenharmony_civn_sizeof_VkFramebuffer(const VkFramebuffer *val) 523bf215546Sopenharmony_ci{ 524bf215546Sopenharmony_ci return sizeof(uint64_t); 525bf215546Sopenharmony_ci} 526bf215546Sopenharmony_ci 527bf215546Sopenharmony_cistatic inline void 528bf215546Sopenharmony_civn_encode_VkFramebuffer(struct vn_cs_encoder *enc, const VkFramebuffer *val) 529bf215546Sopenharmony_ci{ 530bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_FRAMEBUFFER); 531bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 532bf215546Sopenharmony_ci} 533bf215546Sopenharmony_ci 534bf215546Sopenharmony_cistatic inline void 535bf215546Sopenharmony_civn_decode_VkFramebuffer(struct vn_cs_decoder *dec, VkFramebuffer *val) 536bf215546Sopenharmony_ci{ 537bf215546Sopenharmony_ci uint64_t id; 538bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 539bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_FRAMEBUFFER); 540bf215546Sopenharmony_ci} 541bf215546Sopenharmony_ci 542bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) */ 543bf215546Sopenharmony_ci 544bf215546Sopenharmony_cistatic inline size_t 545bf215546Sopenharmony_civn_sizeof_VkRenderPass(const VkRenderPass *val) 546bf215546Sopenharmony_ci{ 547bf215546Sopenharmony_ci return sizeof(uint64_t); 548bf215546Sopenharmony_ci} 549bf215546Sopenharmony_ci 550bf215546Sopenharmony_cistatic inline void 551bf215546Sopenharmony_civn_encode_VkRenderPass(struct vn_cs_encoder *enc, const VkRenderPass *val) 552bf215546Sopenharmony_ci{ 553bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_RENDER_PASS); 554bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 555bf215546Sopenharmony_ci} 556bf215546Sopenharmony_ci 557bf215546Sopenharmony_cistatic inline void 558bf215546Sopenharmony_civn_decode_VkRenderPass(struct vn_cs_decoder *dec, VkRenderPass *val) 559bf215546Sopenharmony_ci{ 560bf215546Sopenharmony_ci uint64_t id; 561bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 562bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_RENDER_PASS); 563bf215546Sopenharmony_ci} 564bf215546Sopenharmony_ci 565bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) */ 566bf215546Sopenharmony_ci 567bf215546Sopenharmony_cistatic inline size_t 568bf215546Sopenharmony_civn_sizeof_VkPipelineCache(const VkPipelineCache *val) 569bf215546Sopenharmony_ci{ 570bf215546Sopenharmony_ci return sizeof(uint64_t); 571bf215546Sopenharmony_ci} 572bf215546Sopenharmony_ci 573bf215546Sopenharmony_cistatic inline void 574bf215546Sopenharmony_civn_encode_VkPipelineCache(struct vn_cs_encoder *enc, const VkPipelineCache *val) 575bf215546Sopenharmony_ci{ 576bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_PIPELINE_CACHE); 577bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 578bf215546Sopenharmony_ci} 579bf215546Sopenharmony_ci 580bf215546Sopenharmony_cistatic inline void 581bf215546Sopenharmony_civn_decode_VkPipelineCache(struct vn_cs_decoder *dec, VkPipelineCache *val) 582bf215546Sopenharmony_ci{ 583bf215546Sopenharmony_ci uint64_t id; 584bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 585bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_PIPELINE_CACHE); 586bf215546Sopenharmony_ci} 587bf215546Sopenharmony_ci 588bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) */ 589bf215546Sopenharmony_ci 590bf215546Sopenharmony_cistatic inline size_t 591bf215546Sopenharmony_civn_sizeof_VkDescriptorUpdateTemplate(const VkDescriptorUpdateTemplate *val) 592bf215546Sopenharmony_ci{ 593bf215546Sopenharmony_ci return sizeof(uint64_t); 594bf215546Sopenharmony_ci} 595bf215546Sopenharmony_ci 596bf215546Sopenharmony_cistatic inline void 597bf215546Sopenharmony_civn_encode_VkDescriptorUpdateTemplate(struct vn_cs_encoder *enc, const VkDescriptorUpdateTemplate *val) 598bf215546Sopenharmony_ci{ 599bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE); 600bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 601bf215546Sopenharmony_ci} 602bf215546Sopenharmony_ci 603bf215546Sopenharmony_cistatic inline void 604bf215546Sopenharmony_civn_decode_VkDescriptorUpdateTemplate(struct vn_cs_decoder *dec, VkDescriptorUpdateTemplate *val) 605bf215546Sopenharmony_ci{ 606bf215546Sopenharmony_ci uint64_t id; 607bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 608bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE); 609bf215546Sopenharmony_ci} 610bf215546Sopenharmony_ci 611bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) */ 612bf215546Sopenharmony_ci 613bf215546Sopenharmony_cistatic inline size_t 614bf215546Sopenharmony_civn_sizeof_VkSamplerYcbcrConversion(const VkSamplerYcbcrConversion *val) 615bf215546Sopenharmony_ci{ 616bf215546Sopenharmony_ci return sizeof(uint64_t); 617bf215546Sopenharmony_ci} 618bf215546Sopenharmony_ci 619bf215546Sopenharmony_cistatic inline void 620bf215546Sopenharmony_civn_encode_VkSamplerYcbcrConversion(struct vn_cs_encoder *enc, const VkSamplerYcbcrConversion *val) 621bf215546Sopenharmony_ci{ 622bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION); 623bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 624bf215546Sopenharmony_ci} 625bf215546Sopenharmony_ci 626bf215546Sopenharmony_cistatic inline void 627bf215546Sopenharmony_civn_decode_VkSamplerYcbcrConversion(struct vn_cs_decoder *dec, VkSamplerYcbcrConversion *val) 628bf215546Sopenharmony_ci{ 629bf215546Sopenharmony_ci uint64_t id; 630bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 631bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION); 632bf215546Sopenharmony_ci} 633bf215546Sopenharmony_ci 634bf215546Sopenharmony_ci/* VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot) */ 635bf215546Sopenharmony_ci 636bf215546Sopenharmony_cistatic inline size_t 637bf215546Sopenharmony_civn_sizeof_VkPrivateDataSlot(const VkPrivateDataSlot *val) 638bf215546Sopenharmony_ci{ 639bf215546Sopenharmony_ci return sizeof(uint64_t); 640bf215546Sopenharmony_ci} 641bf215546Sopenharmony_ci 642bf215546Sopenharmony_cistatic inline void 643bf215546Sopenharmony_civn_encode_VkPrivateDataSlot(struct vn_cs_encoder *enc, const VkPrivateDataSlot *val) 644bf215546Sopenharmony_ci{ 645bf215546Sopenharmony_ci const uint64_t id = vn_cs_handle_load_id((const void **)val, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT); 646bf215546Sopenharmony_ci vn_encode_uint64_t(enc, &id); 647bf215546Sopenharmony_ci} 648bf215546Sopenharmony_ci 649bf215546Sopenharmony_cistatic inline void 650bf215546Sopenharmony_civn_decode_VkPrivateDataSlot(struct vn_cs_decoder *dec, VkPrivateDataSlot *val) 651bf215546Sopenharmony_ci{ 652bf215546Sopenharmony_ci uint64_t id; 653bf215546Sopenharmony_ci vn_decode_uint64_t(dec, &id); 654bf215546Sopenharmony_ci vn_cs_handle_store_id((void **)val, id, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT); 655bf215546Sopenharmony_ci} 656bf215546Sopenharmony_ci 657bf215546Sopenharmony_ci#endif /* VN_PROTOCOL_DRIVER_HANDLES_H */ 658