From 56d727a0248fed534da1e941804dc31a288f6264 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Thu, 11 May 2017 20:09:31 -0500 Subject: [PATCH] Update the Vulkan loader to SDK 1.0.46.0 --- third_party/vulkan/GLSL.std.450.h | 131 + third_party/vulkan/loader/cJSON.c | 672 +- third_party/vulkan/loader/cJSON.h | 56 +- third_party/vulkan/loader/debug_report.c | 254 +- third_party/vulkan/loader/debug_report.h | 220 +- .../vulkan/loader/dev_ext_trampoline.c | 5 +- third_party/vulkan/loader/dirent_on_windows.c | 6 +- third_party/vulkan/loader/extension_manual.c | 586 + third_party/vulkan/loader/extension_manual.h | 49 + third_party/vulkan/loader/extensions.c | 850 - third_party/vulkan/loader/extensions.h | 117 - third_party/vulkan/loader/gpa_helper.h | 439 +- third_party/vulkan/loader/loader.c | 3555 ++-- third_party/vulkan/loader/loader.h | 508 +- .../vulkan/loader/loader_cmake_config.h | 2 + third_party/vulkan/loader/murmurhash.c | 32 +- third_party/vulkan/loader/phys_dev_ext.c | 41 +- third_party/vulkan/loader/premake5.lua | 3 + third_party/vulkan/loader/table_ops.h | 935 - third_party/vulkan/loader/trampoline.c | 1437 +- .../vulkan/loader/vk_loader_extensions.c | 2626 +++ .../vulkan/loader/vk_loader_extensions.h | 328 + third_party/vulkan/loader/vk_loader_layer.h | 1 - .../vulkan/loader/vk_loader_platform.h | 224 +- third_party/vulkan/loader/wsi.c | 1396 +- third_party/vulkan/loader/wsi.h | 190 +- third_party/vulkan/vk_icd.h | 1 + third_party/vulkan/vk_layer.h | 269 +- third_party/vulkan/vk_layer_dispatch_table.h | 403 + third_party/vulkan/vk_platform.h | 2 +- third_party/vulkan/vulkan.h | 1102 +- third_party/vulkan/vulkan.hpp | 14533 +++++++++++----- 32 files changed, 19271 insertions(+), 11702 deletions(-) create mode 100644 third_party/vulkan/GLSL.std.450.h create mode 100644 third_party/vulkan/loader/extension_manual.c create mode 100644 third_party/vulkan/loader/extension_manual.h delete mode 100644 third_party/vulkan/loader/extensions.c delete mode 100644 third_party/vulkan/loader/extensions.h create mode 100644 third_party/vulkan/loader/loader_cmake_config.h delete mode 100644 third_party/vulkan/loader/table_ops.h create mode 100644 third_party/vulkan/loader/vk_loader_extensions.c create mode 100644 third_party/vulkan/loader/vk_loader_extensions.h create mode 100644 third_party/vulkan/vk_layer_dispatch_table.h diff --git a/third_party/vulkan/GLSL.std.450.h b/third_party/vulkan/GLSL.std.450.h new file mode 100644 index 000000000..54cc00e9a --- /dev/null +++ b/third_party/vulkan/GLSL.std.450.h @@ -0,0 +1,131 @@ +/* +** Copyright (c) 2014-2016 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and/or associated documentation files (the "Materials"), +** to deal in the Materials without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Materials, and to permit persons to whom the +** Materials are furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Materials. +** +** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +** IN THE MATERIALS. +*/ + +#ifndef GLSLstd450_H +#define GLSLstd450_H + +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 3; + +enum GLSLstd450 { + GLSLstd450Bad = 0, // Don't use + + GLSLstd450Round = 1, + GLSLstd450RoundEven = 2, + GLSLstd450Trunc = 3, + GLSLstd450FAbs = 4, + GLSLstd450SAbs = 5, + GLSLstd450FSign = 6, + GLSLstd450SSign = 7, + GLSLstd450Floor = 8, + GLSLstd450Ceil = 9, + GLSLstd450Fract = 10, + + GLSLstd450Radians = 11, + GLSLstd450Degrees = 12, + GLSLstd450Sin = 13, + GLSLstd450Cos = 14, + GLSLstd450Tan = 15, + GLSLstd450Asin = 16, + GLSLstd450Acos = 17, + GLSLstd450Atan = 18, + GLSLstd450Sinh = 19, + GLSLstd450Cosh = 20, + GLSLstd450Tanh = 21, + GLSLstd450Asinh = 22, + GLSLstd450Acosh = 23, + GLSLstd450Atanh = 24, + GLSLstd450Atan2 = 25, + + GLSLstd450Pow = 26, + GLSLstd450Exp = 27, + GLSLstd450Log = 28, + GLSLstd450Exp2 = 29, + GLSLstd450Log2 = 30, + GLSLstd450Sqrt = 31, + GLSLstd450InverseSqrt = 32, + + GLSLstd450Determinant = 33, + GLSLstd450MatrixInverse = 34, + + GLSLstd450Modf = 35, // second operand needs an OpVariable to write to + GLSLstd450ModfStruct = 36, // no OpVariable operand + GLSLstd450FMin = 37, + GLSLstd450UMin = 38, + GLSLstd450SMin = 39, + GLSLstd450FMax = 40, + GLSLstd450UMax = 41, + GLSLstd450SMax = 42, + GLSLstd450FClamp = 43, + GLSLstd450UClamp = 44, + GLSLstd450SClamp = 45, + GLSLstd450FMix = 46, + GLSLstd450IMix = 47, // Reserved + GLSLstd450Step = 48, + GLSLstd450SmoothStep = 49, + + GLSLstd450Fma = 50, + GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to + GLSLstd450FrexpStruct = 52, // no OpVariable operand + GLSLstd450Ldexp = 53, + + GLSLstd450PackSnorm4x8 = 54, + GLSLstd450PackUnorm4x8 = 55, + GLSLstd450PackSnorm2x16 = 56, + GLSLstd450PackUnorm2x16 = 57, + GLSLstd450PackHalf2x16 = 58, + GLSLstd450PackDouble2x32 = 59, + GLSLstd450UnpackSnorm2x16 = 60, + GLSLstd450UnpackUnorm2x16 = 61, + GLSLstd450UnpackHalf2x16 = 62, + GLSLstd450UnpackSnorm4x8 = 63, + GLSLstd450UnpackUnorm4x8 = 64, + GLSLstd450UnpackDouble2x32 = 65, + + GLSLstd450Length = 66, + GLSLstd450Distance = 67, + GLSLstd450Cross = 68, + GLSLstd450Normalize = 69, + GLSLstd450FaceForward = 70, + GLSLstd450Reflect = 71, + GLSLstd450Refract = 72, + + GLSLstd450FindILsb = 73, + GLSLstd450FindSMsb = 74, + GLSLstd450FindUMsb = 75, + + GLSLstd450InterpolateAtCentroid = 76, + GLSLstd450InterpolateAtSample = 77, + GLSLstd450InterpolateAtOffset = 78, + + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + + GLSLstd450Count +}; + +#endif // #ifndef GLSLstd450_H diff --git a/third_party/vulkan/loader/cJSON.c b/third_party/vulkan/loader/cJSON.c index e7266c382..a7671c4a0 100644 --- a/third_party/vulkan/loader/cJSON.c +++ b/third_party/vulkan/loader/cJSON.c @@ -47,8 +47,7 @@ static char *cJSON_strdup(const char *str) { char *copy; len = strlen(str) + 1; - if (!(copy = (char *)cJSON_malloc(len))) - return 0; + if (!(copy = (char *)cJSON_malloc(len))) return 0; memcpy(copy, str, len); return copy; } @@ -67,8 +66,7 @@ void cJSON_InitHooks(cJSON_Hooks *hooks) { /* Internal constructor. */ static cJSON *cJSON_New_Item(void) { cJSON *node = (cJSON *)cJSON_malloc(sizeof(cJSON)); - if (node) - memset(node, 0, sizeof(cJSON)); + if (node) memset(node, 0, sizeof(cJSON)); return node; } @@ -77,20 +75,15 @@ void cJSON_Delete(cJSON *c) { cJSON *next; while (c) { next = c->next; - if (!(c->type & cJSON_IsReference) && c->child) - cJSON_Delete(c->child); - if (!(c->type & cJSON_IsReference) && c->valuestring) - cJSON_free(c->valuestring); - if (!(c->type & cJSON_StringIsConst) && c->string) - cJSON_free(c->string); + if (!(c->type & cJSON_IsReference) && c->child) cJSON_Delete(c->child); + if (!(c->type & cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); + if (!(c->type & cJSON_StringIsConst) && c->string) cJSON_free(c->string); cJSON_free(c); c = next; } } -void cJSON_Free(void *p) { - cJSON_free(p); -} +void cJSON_Free(void *p) { cJSON_free(p); } /* Parse the input text to generate a number, and populate the result into item. */ @@ -98,12 +91,9 @@ static const char *parse_number(cJSON *item, const char *num) { double n = 0, sign = 1, scale = 0; int subscale = 0, signsubscale = 1; - if (*num == '-') - sign = -1, num++; /* Has sign? */ - if (*num == '0') - num++; /* is zero */ - if (*num >= '1' && *num <= '9') - do + if (*num == '-') sign = -1, num++; /* Has sign? */ + if (*num == '0') num++; /* is zero */ + if (*num >= '1' && *num <= '9') do n = (n * 10.0) + (*num++ - '0'); while (*num >= '0' && *num <= '9'); /* Number? */ if (*num == '.' && num[1] >= '0' && num[1] <= '9') { @@ -118,15 +108,13 @@ static const char *parse_number(cJSON *item, const char *num) { if (*num == '+') num++; else if (*num == '-') - signsubscale = -1, num++; /* With sign? */ - while (*num >= '0' && *num <= '9') - subscale = (subscale * 10) + (*num++ - '0'); /* Number? */ + signsubscale = -1, num++; /* With sign? */ + while (*num >= '0' && *num <= '9') subscale = (subscale * 10) + (*num++ - '0'); /* Number? */ } - n = sign * n * - pow(10.0, (scale + subscale * signsubscale)); /* number = +/- - number.fraction * - 10^+/- exponent */ + n = sign * n * pow(10.0, (scale + subscale * signsubscale)); /* number = +/- + number.fraction * + 10^+/- exponent */ item->valuedouble = n; item->valueint = (int)n; @@ -153,11 +141,9 @@ typedef struct { static char *ensure(printbuffer *p, size_t needed) { char *newbuffer; size_t newsize; - if (!p || !p->buffer) - return 0; + if (!p || !p->buffer) return 0; needed += p->offset; - if (needed <= p->length) - return p->buffer + p->offset; + if (needed <= p->length) return p->buffer + p->offset; newsize = pow2gt(needed); newbuffer = (char *)cJSON_malloc(newsize); @@ -166,8 +152,7 @@ static char *ensure(printbuffer *p, size_t needed) { p->length = 0, p->buffer = 0; return 0; } - if (newbuffer) - memcpy(newbuffer, p->buffer, p->length); + if (newbuffer) memcpy(newbuffer, p->buffer, p->length); cJSON_free(p->buffer); p->length = newsize; p->buffer = newbuffer; @@ -176,8 +161,7 @@ static char *ensure(printbuffer *p, size_t needed) { static size_t update(printbuffer *p) { char *str; - if (!p || !p->buffer) - return 0; + if (!p || !p->buffer) return 0; str = p->buffer + p->offset; return p->offset + strlen(str); } @@ -191,17 +175,13 @@ static char *print_number(cJSON *item, printbuffer *p) { str = ensure(p, 2); else str = (char *)cJSON_malloc(2); /* special case for 0. */ - if (str) - strcpy(str, "0"); - } else if (fabs(((double)item->valueint) - d) <= DBL_EPSILON && - d <= INT_MAX && d >= INT_MIN) { + if (str) strcpy(str, "0"); + } else if (fabs(((double)item->valueint) - d) <= DBL_EPSILON && d <= INT_MAX && d >= INT_MIN) { if (p) str = ensure(p, 21); else - str = (char *)cJSON_malloc( - 21); /* 2^64+1 can be represented in 21 chars. */ - if (str) - sprintf(str, "%d", item->valueint); + str = (char *)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */ + if (str) sprintf(str, "%d", item->valueint); } else { if (p) str = ensure(p, 64); @@ -263,8 +243,7 @@ static unsigned parse_hex4(const char *str) { } /* Parse the input text into an unescaped cstring, and populate item. */ -static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, - 0xF0, 0xF8, 0xFC}; +static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}; static const char *parse_string(cJSON *item, const char *str) { const char *ptr = str + 1; char *ptr2; @@ -277,13 +256,10 @@ static const char *parse_string(cJSON *item, const char *str) { } /* not a string! */ while (*ptr != '\"' && *ptr && ++len) - if (*ptr++ == '\\') - ptr++; /* Skip escaped quotes. */ + if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */ - out = (char *)cJSON_malloc( - len + 1); /* This is how long we need for the string, roughly. */ - if (!out) - return 0; + out = (char *)cJSON_malloc(len + 1); /* This is how long we need for the string, roughly. */ + if (!out) return 0; ptr = str + 1; ptr2 = out; @@ -293,74 +269,69 @@ static const char *parse_string(cJSON *item, const char *str) { else { ptr++; switch (*ptr) { - case 'b': - *ptr2++ = '\b'; - break; - case 'f': - *ptr2++ = '\f'; - break; - case 'n': - *ptr2++ = '\n'; - break; - case 'r': - *ptr2++ = '\r'; - break; - case 't': - *ptr2++ = '\t'; - break; - case 'u': /* transcode utf16 to utf8. */ - uc = parse_hex4(ptr + 1); - ptr += 4; /* get the unicode char. */ + case 'b': + *ptr2++ = '\b'; + break; + case 'f': + *ptr2++ = '\f'; + break; + case 'n': + *ptr2++ = '\n'; + break; + case 'r': + *ptr2++ = '\r'; + break; + case 't': + *ptr2++ = '\t'; + break; + case 'u': /* transcode utf16 to utf8. */ + uc = parse_hex4(ptr + 1); + ptr += 4; /* get the unicode char. */ - if ((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0) - break; /* check for invalid. */ + if ((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0) break; /* check for invalid. */ - if (uc >= 0xD800 && - uc <= 0xDBFF) /* UTF16 surrogate pairs. */ - { - if (ptr[1] != '\\' || ptr[2] != 'u') - break; /* missing second-half of surrogate. */ - uc2 = parse_hex4(ptr + 3); - ptr += 6; - if (uc2 < 0xDC00 || uc2 > 0xDFFF) - break; /* invalid second-half of surrogate. */ - uc = 0x10000 + (((uc & 0x3FF) << 10) | (uc2 & 0x3FF)); - } + if (uc >= 0xD800 && uc <= 0xDBFF) /* UTF16 surrogate pairs. */ + { + if (ptr[1] != '\\' || ptr[2] != 'u') break; /* missing second-half of surrogate. */ + uc2 = parse_hex4(ptr + 3); + ptr += 6; + if (uc2 < 0xDC00 || uc2 > 0xDFFF) break; /* invalid second-half of surrogate. */ + uc = 0x10000 + (((uc & 0x3FF) << 10) | (uc2 & 0x3FF)); + } - len = 4; - if (uc < 0x80) - len = 1; - else if (uc < 0x800) - len = 2; - else if (uc < 0x10000) - len = 3; - ptr2 += len; + len = 4; + if (uc < 0x80) + len = 1; + else if (uc < 0x800) + len = 2; + else if (uc < 0x10000) + len = 3; + ptr2 += len; - switch (len) { - case 4: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - case 3: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - case 2: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - case 1: - *--ptr2 = ((unsigned char)uc | firstByteMark[len]); - } - ptr2 += len; - break; - default: - *ptr2++ = *ptr; - break; + switch (len) { + case 4: + *--ptr2 = ((uc | 0x80) & 0xBF); + uc >>= 6; + case 3: + *--ptr2 = ((uc | 0x80) & 0xBF); + uc >>= 6; + case 2: + *--ptr2 = ((uc | 0x80) & 0xBF); + uc >>= 6; + case 1: + *--ptr2 = ((unsigned char)uc | firstByteMark[len]); + } + ptr2 += len; + break; + default: + *ptr2++ = *ptr; + break; } ptr++; } } *ptr2 = 0; - if (*ptr == '\"') - ptr++; + if (*ptr == '\"') ptr++; item->valuestring = out; item->type = cJSON_String; return ptr; @@ -374,18 +345,14 @@ static char *print_string_ptr(const char *str, printbuffer *p) { size_t len = 0, flag = 0; unsigned char token; - for (ptr = str; *ptr; ptr++) - flag |= ((*ptr > 0 && *ptr < 32) || (*ptr == '\"') || (*ptr == '\\')) - ? 1 - : 0; + for (ptr = str; *ptr; ptr++) flag |= ((*ptr > 0 && *ptr < 32) || (*ptr == '\"') || (*ptr == '\\')) ? 1 : 0; if (!flag) { len = ptr - str; if (p) out = ensure(p, len + 3); else out = (char *)cJSON_malloc(len + 3); - if (!out) - return 0; + if (!out) return 0; ptr2 = out; *ptr2++ = '\"'; strcpy(ptr2, str); @@ -399,8 +366,7 @@ static char *print_string_ptr(const char *str, printbuffer *p) { out = ensure(p, 3); else out = (char *)cJSON_malloc(3); - if (!out) - return 0; + if (!out) return 0; strcpy(out, "\"\""); return out; } @@ -417,8 +383,7 @@ static char *print_string_ptr(const char *str, printbuffer *p) { out = ensure(p, len + 3); else out = (char *)cJSON_malloc(len + 3); - if (!out) - return 0; + if (!out) return 0; ptr2 = out; ptr = str; @@ -428,31 +393,31 @@ static char *print_string_ptr(const char *str, printbuffer *p) { *ptr2++ = *ptr++; else { switch (token = *ptr++) { - case '\\': - *ptr2++ = '\\'; - break; - case '\"': - *ptr2++ = '\"'; - break; - case '\b': - *ptr2++ = '\b'; - break; - case '\f': - *ptr2++ = '\f'; - break; - case '\n': - *ptr2++ = '\n'; - break; - case '\r': - *ptr2++ = '\r'; - break; - case '\t': - *ptr2++ = '\t'; - break; - default: - sprintf(ptr2, "u%04x", token); - ptr2 += 5; - break; /* escape and print */ + case '\\': + *ptr2++ = '\\'; + break; + case '\"': + *ptr2++ = '\"'; + break; + case '\b': + *ptr2++ = '\b'; + break; + case '\f': + *ptr2++ = '\f'; + break; + case '\n': + *ptr2++ = '\n'; + break; + case '\r': + *ptr2++ = '\r'; + break; + case '\t': + *ptr2++ = '\t'; + break; + default: + sprintf(ptr2, "u%04x", token); + ptr2 += 5; + break; /* escape and print */ } } } @@ -461,9 +426,7 @@ static char *print_string_ptr(const char *str, printbuffer *p) { return out; } /* Invote print_string_ptr (which is useful) on an item. */ -static char *print_string(cJSON *item, printbuffer *p) { - return print_string_ptr(item->valuestring, p); -} +static char *print_string(cJSON *item, printbuffer *p) { return print_string_ptr(item->valuestring, p); } /* Predeclare these prototypes. */ static const char *parse_value(cJSON *item, const char *value); @@ -475,19 +438,16 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p); /* Utility to jump whitespace and cr/lf */ static const char *skip(const char *in) { - while (in && *in && (unsigned char)*in <= 32) - in++; + while (in && *in && (unsigned char)*in <= 32) in++; return in; } /* Parse an object - create a new root, and populate. */ -cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, - int require_null_terminated) { +cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated) { const char *end = 0; cJSON *c = cJSON_New_Item(); ep = 0; - if (!c) - return 0; /* memory fail */ + if (!c) return 0; /* memory fail */ end = parse_value(c, skip(value)); if (!end) { @@ -505,14 +465,11 @@ cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, return 0; } } - if (return_parse_end) - *return_parse_end = end; + if (return_parse_end) *return_parse_end = end; return c; } /* Default options for cJSON_Parse */ -cJSON *cJSON_Parse(const char *value) { - return cJSON_ParseWithOpts(value, 0, 0); -} +cJSON *cJSON_Parse(const char *value) { return cJSON_ParseWithOpts(value, 0, 0); } /* Render a cJSON item/entity/structure to text. */ char *cJSON_Print(cJSON *item) { return print_value(item, 0, 1, 0); } @@ -528,8 +485,7 @@ char *cJSON_PrintBuffered(cJSON *item, int prebuffer, int fmt) { /* Parser core - when encountering text, process appropriately. */ static const char *parse_value(cJSON *item, const char *value) { - if (!value) - return 0; /* Fail on null. */ + if (!value) return 0; /* Fail on null. */ if (!strncmp(value, "null", 4)) { item->type = cJSON_NULL; return value + 4; @@ -563,64 +519,60 @@ static const char *parse_value(cJSON *item, const char *value) { /* Render a value to text. */ static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p) { char *out = 0; - if (!item) - return 0; + if (!item) return 0; if (p) { switch ((item->type) & 255) { - case cJSON_NULL: { - out = ensure(p, 5); - if (out) - strcpy(out, "null"); - break; - } - case cJSON_False: { - out = ensure(p, 6); - if (out) - strcpy(out, "false"); - break; - } - case cJSON_True: { - out = ensure(p, 5); - if (out) - strcpy(out, "true"); - break; - } - case cJSON_Number: - out = print_number(item, p); - break; - case cJSON_String: - out = print_string(item, p); - break; - case cJSON_Array: - out = print_array(item, depth, fmt, p); - break; - case cJSON_Object: - out = print_object(item, depth, fmt, p); - break; + case cJSON_NULL: { + out = ensure(p, 5); + if (out) strcpy(out, "null"); + break; + } + case cJSON_False: { + out = ensure(p, 6); + if (out) strcpy(out, "false"); + break; + } + case cJSON_True: { + out = ensure(p, 5); + if (out) strcpy(out, "true"); + break; + } + case cJSON_Number: + out = print_number(item, p); + break; + case cJSON_String: + out = print_string(item, p); + break; + case cJSON_Array: + out = print_array(item, depth, fmt, p); + break; + case cJSON_Object: + out = print_object(item, depth, fmt, p); + break; } } else { switch ((item->type) & 255) { - case cJSON_NULL: - out = cJSON_strdup("null"); - break; - case cJSON_False: - out = cJSON_strdup("false"); - break; - case cJSON_True: - out = cJSON_strdup("true"); - break; - case cJSON_Number: - out = print_number(item, 0); - break; - case cJSON_String: - out = print_string(item, 0); - break; - case cJSON_Array: - out = print_array(item, depth, fmt, 0); - break; - case cJSON_Object: - out = print_object(item, depth, fmt, 0); - break; + case cJSON_NULL: + out = cJSON_strdup("null"); + break; + case cJSON_False: + out = cJSON_strdup("false"); + break; + case cJSON_True: + out = cJSON_strdup("true"); + break; + case cJSON_Number: + out = print_number(item, 0); + break; + case cJSON_String: + out = print_string(item, 0); + break; + case cJSON_Array: + out = print_array(item, depth, fmt, 0); + break; + case cJSON_Object: + out = print_object(item, depth, fmt, 0); + break; } } return out; @@ -636,31 +588,24 @@ static const char *parse_array(cJSON *item, const char *value) { item->type = cJSON_Array; value = skip(value + 1); - if (*value == ']') - return value + 1; /* empty array. */ + if (*value == ']') return value + 1; /* empty array. */ item->child = child = cJSON_New_Item(); - if (!item->child) - return 0; /* memory fail */ - value = skip( - parse_value(child, skip(value))); /* skip any spacing, get the value. */ - if (!value) - return 0; + if (!item->child) return 0; /* memory fail */ + value = skip(parse_value(child, skip(value))); /* skip any spacing, get the value. */ + if (!value) return 0; while (*value == ',') { cJSON *new_item; - if (!(new_item = cJSON_New_Item())) - return 0; /* memory fail */ + if (!(new_item = cJSON_New_Item())) return 0; /* memory fail */ child->next = new_item; new_item->prev = child; child = new_item; value = skip(parse_value(child, skip(value + 1))); - if (!value) - return 0; /* memory fail */ + if (!value) return 0; /* memory fail */ } - if (*value == ']') - return value + 1; /* end of array */ + if (*value == ']') return value + 1; /* end of array */ ep = value; return 0; /* malformed. */ } @@ -675,16 +620,14 @@ static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) { size_t tmplen = 0, i = 0; /* How many entries in the array? */ - while (child) - numentries++, child = child->next; + while (child) numentries++, child = child->next; /* Explicitly handle numentries==0 */ if (!numentries) { if (p) out = ensure(p, 3); else out = (char *)cJSON_malloc(3); - if (out) - strcpy(out, "[]"); + if (out) strcpy(out, "[]"); return out; } @@ -692,8 +635,7 @@ static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) { /* Compose the output array. */ i = p->offset; ptr = ensure(p, 1); - if (!ptr) - return 0; + if (!ptr) return 0; *ptr = '['; p->offset++; child = item->child; @@ -703,27 +645,23 @@ static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) { if (child->next) { len = fmt ? 2 : 1; ptr = ensure(p, len + 1); - if (!ptr) - return 0; + if (!ptr) return 0; *ptr++ = ','; - if (fmt) - *ptr++ = ' '; + if (fmt) *ptr++ = ' '; *ptr = 0; p->offset += len; } child = child->next; } ptr = ensure(p, 2); - if (!ptr) - return 0; + if (!ptr) return 0; *ptr++ = ']'; *ptr = 0; out = (p->buffer) + i; } else { /* Allocate an array to hold the values for each */ entries = (char **)cJSON_malloc(numentries * sizeof(char *)); - if (!entries) - return 0; + if (!entries) return 0; memset(entries, 0, numentries * sizeof(char *)); /* Retrieve all the results: */ child = item->child; @@ -738,17 +676,14 @@ static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) { } /* If we didn't fail, try to malloc the output string */ - if (!fail) - out = (char *)cJSON_malloc(len); + if (!fail) out = (char *)cJSON_malloc(len); /* If that fails, we fail. */ - if (!out) - fail = 1; + if (!out) fail = 1; /* Handle failure. */ if (fail) { for (j = 0; j < numentries; j++) - if (entries[j]) - cJSON_free(entries[j]); + if (entries[j]) cJSON_free(entries[j]); cJSON_free(entries); return 0; } @@ -763,8 +698,7 @@ static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) { ptr += tmplen; if (j != numentries - 1) { *ptr++ = ','; - if (fmt) - *ptr++ = ' '; + if (fmt) *ptr++ = ' '; *ptr = 0; } cJSON_free(entries[j]); @@ -786,50 +720,40 @@ static const char *parse_object(cJSON *item, const char *value) { item->type = cJSON_Object; value = skip(value + 1); - if (*value == '}') - return value + 1; /* empty array. */ + if (*value == '}') return value + 1; /* empty array. */ item->child = child = cJSON_New_Item(); - if (!item->child) - return 0; + if (!item->child) return 0; value = skip(parse_string(child, skip(value))); - if (!value) - return 0; + if (!value) return 0; child->string = child->valuestring; child->valuestring = 0; if (*value != ':') { ep = value; return 0; - } /* fail! */ - value = skip(parse_value( - child, skip(value + 1))); /* skip any spacing, get the value. */ - if (!value) - return 0; + } /* fail! */ + value = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */ + if (!value) return 0; while (*value == ',') { cJSON *new_item; - if (!(new_item = cJSON_New_Item())) - return 0; /* memory fail */ + if (!(new_item = cJSON_New_Item())) return 0; /* memory fail */ child->next = new_item; new_item->prev = child; child = new_item; value = skip(parse_string(child, skip(value + 1))); - if (!value) - return 0; + if (!value) return 0; child->string = child->valuestring; child->valuestring = 0; if (*value != ':') { ep = value; return 0; - } /* fail! */ - value = skip(parse_value( - child, skip(value + 1))); /* skip any spacing, get the value. */ - if (!value) - return 0; + } /* fail! */ + value = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */ + if (!value) return 0; } - if (*value == '}') - return value + 1; /* end of array */ + if (*value == '}') return value + 1; /* end of array */ ep = value; return 0; /* malformed. */ } @@ -843,22 +767,19 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { int numentries = 0, fail = 0, k; size_t tmplen = 0, i = 0, len = 7; /* Count the number of entries. */ - while (child) - numentries++, child = child->next; + while (child) numentries++, child = child->next; /* Explicitly handle empty object case */ if (!numentries) { if (p) out = ensure(p, fmt ? depth + 4 : 3); else out = (char *)cJSON_malloc(fmt ? depth + 4 : 3); - if (!out) - return 0; + if (!out) return 0; ptr = out; *ptr++ = '{'; if (fmt) { *ptr++ = '\n'; - for (j = 0; j < depth - 1; j++) - *ptr++ = '\t'; + for (j = 0; j < depth - 1; j++) *ptr++ = '\t'; } *ptr++ = '}'; *ptr++ = 0; @@ -869,11 +790,9 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { i = p->offset; len = fmt ? 2 : 1; ptr = ensure(p, len + 1); - if (!ptr) - return 0; + if (!ptr) return 0; *ptr++ = '{'; - if (fmt) - *ptr++ = '\n'; + if (fmt) *ptr++ = '\n'; *ptr = 0; p->offset += len; child = item->child; @@ -881,10 +800,8 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { while (child) { if (fmt) { ptr = ensure(p, depth); - if (!ptr) - return 0; - for (j = 0; j < depth; j++) - *ptr++ = '\t'; + if (!ptr) return 0; + for (j = 0; j < depth; j++) *ptr++ = '\t'; p->offset += depth; } print_string_ptr(child->string, p); @@ -892,11 +809,9 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { len = fmt ? 2 : 1; ptr = ensure(p, len); - if (!ptr) - return 0; + if (!ptr) return 0; *ptr++ = ':'; - if (fmt) - *ptr++ = '\t'; + if (fmt) *ptr++ = '\t'; p->offset += len; print_value(child, depth, fmt, p); @@ -904,30 +819,24 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { len = (fmt ? 1 : 0) + (child->next ? 1 : 0); ptr = ensure(p, len + 1); - if (!ptr) - return 0; - if (child->next) - *ptr++ = ','; - if (fmt) - *ptr++ = '\n'; + if (!ptr) return 0; + if (child->next) *ptr++ = ','; + if (fmt) *ptr++ = '\n'; *ptr = 0; p->offset += len; child = child->next; } ptr = ensure(p, fmt ? (depth + 1) : 2); - if (!ptr) - return 0; + if (!ptr) return 0; if (fmt) - for (j = 0; j < depth - 1; j++) - *ptr++ = '\t'; + for (j = 0; j < depth - 1; j++) *ptr++ = '\t'; *ptr++ = '}'; *ptr = 0; out = (p->buffer) + i; } else { /* Allocate space for the names and the objects */ entries = (char **)cJSON_malloc(numentries * sizeof(char *)); - if (!entries) - return 0; + if (!entries) return 0; names = (char **)cJSON_malloc(numentries * sizeof(char *)); if (!names) { cJSON_free(entries); @@ -939,8 +848,7 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { /* Collect all the results into our arrays: */ child = item->child; depth++; - if (fmt) - len += depth; + if (fmt) len += depth; while (child) { names[i] = str = print_string_ptr(child->string, 0); entries[i++] = ret = print_value(child, depth, fmt, 0); @@ -952,18 +860,14 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { } /* Try to allocate the output string */ - if (!fail) - out = (char *)cJSON_malloc(len); - if (!out) - fail = 1; + if (!fail) out = (char *)cJSON_malloc(len); + if (!out) fail = 1; /* Handle failure */ if (fail) { for (j = 0; j < numentries; j++) { - if (names[i]) - cJSON_free(names[j]); - if (entries[j]) - cJSON_free(entries[j]); + if (names[i]) cJSON_free(names[j]); + if (entries[j]) cJSON_free(entries[j]); } cJSON_free(names); cJSON_free(entries); @@ -973,25 +877,20 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { /* Compose the output: */ *out = '{'; ptr = out + 1; - if (fmt) - *ptr++ = '\n'; + if (fmt) *ptr++ = '\n'; *ptr = 0; for (j = 0; j < numentries; j++) { if (fmt) - for (k = 0; k < depth; k++) - *ptr++ = '\t'; + for (k = 0; k < depth; k++) *ptr++ = '\t'; tmplen = strlen(names[j]); memcpy(ptr, names[j], tmplen); ptr += tmplen; *ptr++ = ':'; - if (fmt) - *ptr++ = '\t'; + if (fmt) *ptr++ = '\t'; strcpy(ptr, entries[j]); ptr += strlen(entries[j]); - if (j != numentries - 1) - *ptr++ = ','; - if (fmt) - *ptr++ = '\n'; + if (j != numentries - 1) *ptr++ = ','; + if (fmt) *ptr++ = '\n'; *ptr = 0; cJSON_free(names[j]); cJSON_free(entries[j]); @@ -1000,8 +899,7 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { cJSON_free(names); cJSON_free(entries); if (fmt) - for (j = 0; j < depth - 1; j++) - *ptr++ = '\t'; + for (j = 0; j < depth - 1; j++) *ptr++ = '\t'; *ptr++ = '}'; *ptr++ = 0; } @@ -1012,20 +910,17 @@ static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) { int cJSON_GetArraySize(cJSON *array) { cJSON *c = array->child; int i = 0; - while (c) - i++, c = c->next; + while (c) i++, c = c->next; return i; } cJSON *cJSON_GetArrayItem(cJSON *array, int item) { cJSON *c = array->child; - while (c && item > 0) - item--, c = c->next; + while (c && item > 0) item--, c = c->next; return c; } cJSON *cJSON_GetObjectItem(cJSON *object, const char *string) { cJSON *c = object->child; - while (c && strcmp(c->string, string)) - c = c->next; + while (c && strcmp(c->string, string)) c = c->next; return c; } @@ -1037,8 +932,7 @@ static void suffix_object(cJSON *prev, cJSON *item) { /* Utility for handling references. */ static cJSON *create_reference(cJSON *item) { cJSON *ref = cJSON_New_Item(); - if (!ref) - return 0; + if (!ref) return 0; memcpy(ref, item, sizeof(cJSON)); ref->string = 0; ref->type |= cJSON_IsReference; @@ -1049,77 +943,56 @@ static cJSON *create_reference(cJSON *item) { /* Add item to array/object. */ void cJSON_AddItemToArray(cJSON *array, cJSON *item) { cJSON *c = array->child; - if (!item) - return; + if (!item) return; if (!c) { array->child = item; } else { - while (c && c->next) - c = c->next; + while (c && c->next) c = c->next; suffix_object(c, item); } } void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) { - if (!item) - return; - if (item->string) - cJSON_free(item->string); + if (!item) return; + if (item->string) cJSON_free(item->string); item->string = cJSON_strdup(string); cJSON_AddItemToArray(object, item); } void cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) { - if (!item) - return; - if (!(item->type & cJSON_StringIsConst) && item->string) - cJSON_free(item->string); + if (!item) return; + if (!(item->type & cJSON_StringIsConst) && item->string) cJSON_free(item->string); item->string = (char *)string; item->type |= cJSON_StringIsConst; cJSON_AddItemToArray(object, item); } -void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { - cJSON_AddItemToArray(array, create_reference(item)); -} -void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, - cJSON *item) { +void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { cJSON_AddItemToArray(array, create_reference(item)); } +void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) { cJSON_AddItemToObject(object, string, create_reference(item)); } cJSON *cJSON_DetachItemFromArray(cJSON *array, int which) { cJSON *c = array->child; - while (c && which > 0) - c = c->next, which--; - if (!c) - return 0; - if (c->prev) - c->prev->next = c->next; - if (c->next) - c->next->prev = c->prev; - if (c == array->child) - array->child = c->next; + while (c && which > 0) c = c->next, which--; + if (!c) return 0; + if (c->prev) c->prev->next = c->next; + if (c->next) c->next->prev = c->prev; + if (c == array->child) array->child = c->next; c->prev = c->next = 0; return c; } -void cJSON_DeleteItemFromArray(cJSON *array, int which) { - cJSON_Delete(cJSON_DetachItemFromArray(array, which)); -} +void cJSON_DeleteItemFromArray(cJSON *array, int which) { cJSON_Delete(cJSON_DetachItemFromArray(array, which)); } cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string) { int i = 0; cJSON *c = object->child; - while (c && strcmp(c->string, string)) - i++, c = c->next; - if (c) - return cJSON_DetachItemFromArray(object, i); + while (c && strcmp(c->string, string)) i++, c = c->next; + if (c) return cJSON_DetachItemFromArray(object, i); return 0; } -void cJSON_DeleteItemFromObject(cJSON *object, const char *string) { - cJSON_Delete(cJSON_DetachItemFromObject(object, string)); -} +void cJSON_DeleteItemFromObject(cJSON *object, const char *string) { cJSON_Delete(cJSON_DetachItemFromObject(object, string)); } /* Replace array/object items with new ones. */ void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) { cJSON *c = array->child; - while (c && which > 0) - c = c->next, which--; + while (c && which > 0) c = c->next, which--; if (!c) { cJSON_AddItemToArray(array, newitem); return; @@ -1134,14 +1007,11 @@ void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) { } void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) { cJSON *c = array->child; - while (c && which > 0) - c = c->next, which--; - if (!c) - return; + while (c && which > 0) c = c->next, which--; + if (!c) return; newitem->next = c->next; newitem->prev = c->prev; - if (newitem->next) - newitem->next->prev = newitem; + if (newitem->next) newitem->next->prev = newitem; if (c == array->child) array->child = newitem; else @@ -1149,12 +1019,10 @@ void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) { c->next = c->prev = 0; cJSON_Delete(c); } -void cJSON_ReplaceItemInObject(cJSON *object, const char *string, - cJSON *newitem) { +void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) { int i = 0; cJSON *c = object->child; - while (c && strcmp(c->string, string)) - i++, c = c->next; + while (c && strcmp(c->string, string)) i++, c = c->next; if (c) { newitem->string = cJSON_strdup(string); cJSON_ReplaceItemInArray(object, i, newitem); @@ -1164,26 +1032,22 @@ void cJSON_ReplaceItemInObject(cJSON *object, const char *string, /* Create basic types: */ cJSON *cJSON_CreateNull(void) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = cJSON_NULL; + if (item) item->type = cJSON_NULL; return item; } cJSON *cJSON_CreateTrue(void) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = cJSON_True; + if (item) item->type = cJSON_True; return item; } cJSON *cJSON_CreateFalse(void) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = cJSON_False; + if (item) item->type = cJSON_False; return item; } cJSON *cJSON_CreateBool(int b) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = b ? cJSON_True : cJSON_False; + if (item) item->type = b ? cJSON_True : cJSON_False; return item; } cJSON *cJSON_CreateNumber(double num) { @@ -1205,14 +1069,12 @@ cJSON *cJSON_CreateString(const char *string) { } cJSON *cJSON_CreateArray(void) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = cJSON_Array; + if (item) item->type = cJSON_Array; return item; } cJSON *cJSON_CreateObject(void) { cJSON *item = cJSON_New_Item(); - if (item) - item->type = cJSON_Object; + if (item) item->type = cJSON_Object; return item; } @@ -1274,16 +1136,12 @@ cJSON *cJSON_CreateStringArray(const char **strings, int count) { cJSON *cJSON_Duplicate(cJSON *item, int recurse) { cJSON *newitem, *cptr, *nptr = 0, *newchild; /* Bail on bad ptr */ - if (!item) - return 0; + if (!item) return 0; /* Create new item */ newitem = cJSON_New_Item(); - if (!newitem) - return 0; + if (!newitem) return 0; /* Copy over all vars */ - newitem->type = item->type & (~cJSON_IsReference), - newitem->valueint = item->valueint, - newitem->valuedouble = item->valuedouble; + newitem->type = item->type & (~cJSON_IsReference), newitem->valueint = item->valueint, newitem->valuedouble = item->valuedouble; if (item->valuestring) { newitem->valuestring = cJSON_strdup(item->valuestring); if (!newitem->valuestring) { @@ -1299,14 +1157,11 @@ cJSON *cJSON_Duplicate(cJSON *item, int recurse) { } } /* If non-recursive, then we're done! */ - if (!recurse) - return newitem; + if (!recurse) return newitem; /* Walk the ->next chain for the child. */ cptr = item->child; while (cptr) { - newchild = cJSON_Duplicate( - cptr, - 1); /* Duplicate (with recurse) each item in the ->next chain */ + newchild = cJSON_Duplicate(cptr, 1); /* Duplicate (with recurse) each item in the ->next chain */ if (!newchild) { cJSON_Delete(newitem); return 0; @@ -1337,18 +1192,15 @@ void cJSON_Minify(char *json) { else if (*json == '\n') json++; else if (*json == '/' && json[1] == '/') - while (*json && *json != '\n') - json++; /* double-slash comments, to end of line. */ + while (*json && *json != '\n') json++; /* double-slash comments, to end of line. */ else if (*json == '/' && json[1] == '*') { - while (*json && !(*json == '*' && json[1] == '/')) - json++; + while (*json && !(*json == '*' && json[1] == '/')) json++; json += 2; } /* multiline comments. */ else if (*json == '\"') { *into++ = *json++; while (*json && *json != '\"') { - if (*json == '\\') - *into++ = *json++; + if (*json == '\\') *into++ = *json++; *into++ = *json++; } *into++ = *json++; diff --git a/third_party/vulkan/loader/cJSON.h b/third_party/vulkan/loader/cJSON.h index cab30515e..f0059abdc 100644 --- a/third_party/vulkan/loader/cJSON.h +++ b/third_party/vulkan/loader/cJSON.h @@ -47,9 +47,9 @@ typedef struct cJSON { struct cJSON *next, *prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *child; /* An array or object item will have a child pointer - pointing to a chain of the items in the - array/object. */ + struct cJSON *child; /* An array or object item will have a child pointer + pointing to a chain of the items in the + array/object. */ int type; /* The type of the item, as above. */ @@ -118,19 +118,16 @@ extern cJSON *cJSON_CreateStringArray(const char **strings, int count); /* Append item to the specified array/object. */ extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); -extern void cJSON_AddItemToObject(cJSON *object, const char *string, - cJSON *item); -extern void cJSON_AddItemToObjectCS( - cJSON *object, const char *string, - cJSON *item); /* Use this when string is definitely const (i.e. a literal, - or as good as), and will definitely survive the cJSON - object */ +extern void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); +extern void cJSON_AddItemToObjectCS(cJSON *object, const char *string, + cJSON *item); /* Use this when string is definitely const (i.e. a literal, + or as good as), and will definitely survive the cJSON + object */ /* Append reference to item to the specified array/object. Use this when you * want to add an existing cJSON to a new cJSON, but don't want to corrupt your * existing cJSON. */ extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); -extern void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, - cJSON *item); +extern void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); /* Remove/Detatch items from Arrays/Objects. */ extern cJSON *cJSON_DetachItemFromArray(cJSON *array, int which); @@ -139,12 +136,9 @@ extern cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string); extern void cJSON_DeleteItemFromObject(cJSON *object, const char *string); /* Update array items. */ -extern void cJSON_InsertItemInArray( - cJSON *array, int which, - cJSON *newitem); /* Shifts pre-existing items to the right. */ +extern void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ extern void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); -extern void cJSON_ReplaceItemInObject(cJSON *object, const char *string, - cJSON *newitem); +extern void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem); /* Duplicate a cJSON item */ extern cJSON *cJSON_Duplicate(cJSON *item, int recurse); @@ -156,32 +150,22 @@ The item->next and ->prev pointers are always zero on return from Duplicate. */ /* ParseWithOpts allows you to require (and check) that the JSON is null * terminated, and to retrieve the pointer to the final byte parsed. */ -extern cJSON *cJSON_ParseWithOpts(const char *value, - const char **return_parse_end, - int require_null_terminated); +extern cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated); extern void cJSON_Minify(char *json); /* Macros for creating things quickly. */ -#define cJSON_AddNullToObject(object, name) \ - cJSON_AddItemToObject(object, name, cJSON_CreateNull()) -#define cJSON_AddTrueToObject(object, name) \ - cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) -#define cJSON_AddFalseToObject(object, name) \ - cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) -#define cJSON_AddBoolToObject(object, name, b) \ - cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) -#define cJSON_AddNumberToObject(object, name, n) \ - cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) -#define cJSON_AddStringToObject(object, name, s) \ - cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) +#define cJSON_AddNullToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) +#define cJSON_AddTrueToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) +#define cJSON_AddFalseToObject(object, name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) +#define cJSON_AddBoolToObject(object, name, b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) +#define cJSON_AddNumberToObject(object, name, n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) +#define cJSON_AddStringToObject(object, name, s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) /* When assigning an integer value, it needs to be propagated to valuedouble * too. */ -#define cJSON_SetIntValue(object, val) \ - ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val)) -#define cJSON_SetNumberValue(object, val) \ - ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val)) +#define cJSON_SetIntValue(object, val) ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val)) +#define cJSON_SetNumberValue(object, val) ((object) ? (object)->valueint = (object)->valuedouble = (val) : (val)) #ifdef __cplusplus } diff --git a/third_party/vulkan/loader/debug_report.c b/third_party/vulkan/loader/debug_report.c index bf9ff4114..04e55ccfc 100644 --- a/third_party/vulkan/loader/debug_report.c +++ b/third_party/vulkan/loader/debug_report.c @@ -37,50 +37,38 @@ typedef void(VKAPI_PTR *PFN_stringCallback)(char *message); static const VkExtensionProperties debug_report_extension_info = { - .extensionName = VK_EXT_DEBUG_REPORT_EXTENSION_NAME, - .specVersion = VK_EXT_DEBUG_REPORT_SPEC_VERSION, + .extensionName = VK_EXT_DEBUG_REPORT_EXTENSION_NAME, .specVersion = VK_EXT_DEBUG_REPORT_SPEC_VERSION, }; -void debug_report_add_instance_extensions( - const struct loader_instance *inst, - struct loader_extension_list *ext_list) { +void debug_report_add_instance_extensions(const struct loader_instance *inst, struct loader_extension_list *ext_list) { loader_add_to_ext_list(inst, ext_list, 1, &debug_report_extension_info); } -void debug_report_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo) { +void debug_report_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { ptr_instance->enabled_known_extensions.ext_debug_report = 0; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { ptr_instance->enabled_known_extensions.ext_debug_report = 1; return; } } } -VkResult -util_CreateDebugReportCallback(struct loader_instance *inst, - VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT callback) { +VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback) { VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (pAllocator != NULL) { - pNewDbgFuncNode = - (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation( - pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), - sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); } else { #endif - pNewDbgFuncNode = - (VkLayerDbgFunctionNode *)loader_instance_heap_alloc( - inst, sizeof(VkLayerDbgFunctionNode), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); } if (!pNewDbgFuncNode) { return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -97,32 +85,24 @@ util_CreateDebugReportCallback(struct loader_instance *inst, return VK_SUCCESS; } -static VKAPI_ATTR VkResult VKAPI_CALL debug_report_CreateDebugReportCallbackEXT( - VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback) { +static VKAPI_ATTR VkResult VKAPI_CALL +debug_report_CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) { struct loader_instance *inst = loader_get_instance(instance); loader_platform_thread_lock_mutex(&loader_lock); - VkResult result = inst->disp->layer_inst_disp.CreateDebugReportCallbackEXT( - instance, pCreateInfo, pAllocator, pCallback); + VkResult result = inst->disp->layer_inst_disp.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback); loader_platform_thread_unlock_mutex(&loader_lock); return result; } // Utility function to handle reporting -VkBool32 util_DebugReportMessage(const struct loader_instance *inst, - VkFlags msgFlags, - VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, - int32_t msgCode, const char *pLayerPrefix, - const char *pMsg) { +VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, + uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { VkBool32 bail = false; VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; while (pTrav) { if (pTrav->msgFlags & msgFlags) { - if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, - msgCode, pLayerPrefix, pMsg, - pTrav->pUserData)) { + if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg, pTrav->pUserData)) { bail = true; } } @@ -132,8 +112,7 @@ VkBool32 util_DebugReportMessage(const struct loader_instance *inst, return bail; } -void util_DestroyDebugReportCallback(struct loader_instance *inst, - VkDebugReportCallbackEXT callback, +void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator) { VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; VkLayerDbgFunctionNode *pPrev = pTrav; @@ -141,8 +120,7 @@ void util_DestroyDebugReportCallback(struct loader_instance *inst, while (pTrav) { if (pTrav->msgCallback == callback) { pPrev->pNext = pTrav->pNext; - if (inst->DbgFunctionHead == pTrav) - inst->DbgFunctionHead = pTrav->pNext; + if (inst->DbgFunctionHead == pTrav) inst->DbgFunctionHead = pTrav->pNext; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else @@ -164,10 +142,8 @@ void util_DestroyDebugReportCallback(struct loader_instance *inst, // then allocates array that can hold that many structs, as well as that many // VkDebugReportCallbackEXT handles. It then copies each // VkDebugReportCallbackCreateInfoEXT, and initializes each handle. -VkResult util_CopyDebugReportCreateInfos( - const void *pChain, const VkAllocationCallbacks *pAllocator, - uint32_t *num_callbacks, VkDebugReportCallbackCreateInfoEXT **infos, - VkDebugReportCallbackEXT **callbacks) { +VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks) { uint32_t n = *num_callbacks = 0; VkDebugReportCallbackCreateInfoEXT *pInfos = NULL; VkDebugReportCallbackEXT *pCallbacks = NULL; @@ -178,8 +154,7 @@ VkResult util_CopyDebugReportCreateInfos( const void *pNext = pChain; while (pNext) { // 1st, count the number VkDebugReportCallbackCreateInfoEXT: - if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == - VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { + if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { n++; } pNext = (void *)((VkDebugReportCallbackCreateInfoEXT *)pNext)->pNext; @@ -193,15 +168,12 @@ VkResult util_CopyDebugReportCreateInfos( { #else if (pAllocator != NULL) { - pInfos = *infos = - ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation( - pAllocator->pUserData, - n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); } else { #endif - pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc( - n * sizeof(VkDebugReportCallbackCreateInfoEXT))); + pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc(n * sizeof(VkDebugReportCallbackCreateInfoEXT))); } if (!pInfos) { return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -211,18 +183,15 @@ VkResult util_CopyDebugReportCreateInfos( { #else if (pAllocator != NULL) { - pCallbacks = *callbacks = - ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( - pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), - sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( + pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); if (!pCallbacks) { pAllocator->pfnFree(pAllocator->pUserData, pInfos); return VK_ERROR_OUT_OF_HOST_MEMORY; } } else { #endif - pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc( - n * sizeof(VkDebugReportCallbackEXT))); + pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc(n * sizeof(VkDebugReportCallbackEXT))); if (!pCallbacks) { free(pInfos); return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -233,8 +202,7 @@ VkResult util_CopyDebugReportCreateInfos( // use the address of the copied VkDebugReportCallbackCreateInfoEXT): pNext = pChain; while (pNext) { - if (((VkInstanceCreateInfo *)pNext)->sType == - VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { + if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { memcpy(pInfos, pNext, sizeof(VkDebugReportCallbackCreateInfoEXT)); *pCallbacks++ = (VkDebugReportCallbackEXT)(uintptr_t)pInfos++; } @@ -245,15 +213,14 @@ VkResult util_CopyDebugReportCreateInfos( return VK_SUCCESS; } -void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackCreateInfoEXT *infos, +void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) - { + { #else if (pAllocator != NULL) { - pAllocator->pfnFree(pAllocator->pUserData, infos); - pAllocator->pfnFree(pAllocator->pUserData, callbacks); + pAllocator->pfnFree(pAllocator->pUserData, infos); + pAllocator->pfnFree(pAllocator->pUserData, callbacks); } else { #endif free(infos); @@ -261,14 +228,12 @@ void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, } } -VkResult util_CreateDebugReportCallbacks( - struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks) { +VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks) { VkResult rtn = VK_SUCCESS; for (uint32_t i = 0; i < num_callbacks; i++) { - rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, - callbacks[i]); + rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, callbacks[i]); if (rtn != VK_SUCCESS) { for (uint32_t j = 0; j < i; j++) { util_DestroyDebugReportCallback(inst, callbacks[j], pAllocator); @@ -279,50 +244,40 @@ VkResult util_CreateDebugReportCallbacks( return rtn; } -void util_DestroyDebugReportCallbacks(struct loader_instance *inst, - const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, +void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, VkDebugReportCallbackEXT *callbacks) { for (uint32_t i = 0; i < num_callbacks; i++) { util_DestroyDebugReportCallback(inst, callbacks[i], pAllocator); } } -static VKAPI_ATTR void VKAPI_CALL -debug_report_DestroyDebugReportCallbackEXT( - VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { +static VKAPI_ATTR void VKAPI_CALL debug_report_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { struct loader_instance *inst = loader_get_instance(instance); loader_platform_thread_lock_mutex(&loader_lock); - inst->disp->layer_inst_disp.DestroyDebugReportCallbackEXT( - instance, callback, pAllocator); + inst->disp->layer_inst_disp.DestroyDebugReportCallbackEXT(instance, callback, pAllocator); util_DestroyDebugReportCallback(inst, callback, pAllocator); loader_platform_thread_unlock_mutex(&loader_lock); } -static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT( - VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { +static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, + size_t location, int32_t msgCode, const char *pLayerPrefix, + const char *pMsg) { struct loader_instance *inst = loader_get_instance(instance); - inst->disp->layer_inst_disp.DebugReportMessageEXT( - instance, flags, objType, object, location, msgCode, pLayerPrefix, - pMsg); + inst->disp->layer_inst_disp.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); } -/* - * This is the instance chain terminator function - * for CreateDebugReportCallback - */ - -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( - VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback) { +// This is the instance chain terminator function +// for CreateDebugReportCallback +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback) { VkDebugReportCallbackEXT *icd_info = NULL; const struct loader_icd_term *icd_term; struct loader_instance *inst = (struct loader_instance *)instance; @@ -334,18 +289,15 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( { #else if (pAllocator != NULL) { - icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( - pAllocator->pUserData, - inst->total_icd_count * sizeof(VkDebugReportCallbackEXT), - sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); + icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(pAllocator->pUserData, + inst->total_icd_count * sizeof(VkDebugReportCallbackEXT), + sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); if (icd_info) { - memset(icd_info, 0, - inst->total_icd_count * sizeof(VkDebugReportCallbackEXT)); + memset(icd_info, 0, inst->total_icd_count * sizeof(VkDebugReportCallbackEXT)); } } else { #endif - icd_info = - calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count); + icd_info = calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count); } if (!icd_info) { res = VK_ERROR_OUT_OF_HOST_MEMORY; @@ -354,13 +306,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (!icd_term->CreateDebugReportCallbackEXT) { + if (!icd_term->dispatch.CreateDebugReportCallbackEXT) { continue; } - res = icd_term->CreateDebugReportCallbackEXT(icd_term->instance, - pCreateInfo, pAllocator, - &icd_info[storage_idx]); + res = icd_term->dispatch.CreateDebugReportCallbackEXT(icd_term->instance, pCreateInfo, pAllocator, &icd_info[storage_idx]); if (res != VK_SUCCESS) { goto out; @@ -368,23 +318,19 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( storage_idx++; } - // Setup the debug report callback in the terminator since a layer may want - // to grab the information itself (RenderDoc) and then return back to the - // user callback a sub-set of the messages. +// Setup the debug report callback in the terminator since a layer may want +// to grab the information itself (RenderDoc) and then return back to the +// user callback a sub-set of the messages. #if (DEBUG_DISABLE_APP_ALLOCATORS == 0) if (pAllocator != NULL) { - pNewDbgFuncNode = - (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation( - pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), - sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); } else { #else { #endif - pNewDbgFuncNode = - (VkLayerDbgFunctionNode *)loader_instance_heap_alloc( - inst, sizeof(VkLayerDbgFunctionNode), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + pNewDbgFuncNode = (VkLayerDbgFunctionNode *)loader_instance_heap_alloc(inst, sizeof(VkLayerDbgFunctionNode), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); } if (!pNewDbgFuncNode) { res = VK_ERROR_OUT_OF_HOST_MEMORY; @@ -407,13 +353,12 @@ out: if (VK_SUCCESS != res) { storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->DestroyDebugReportCallbackEXT) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { continue; } if (icd_info && icd_info[storage_idx]) { - icd_term->DestroyDebugReportCallbackEXT( - icd_term->instance, icd_info[storage_idx], pAllocator); + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); } storage_idx++; } @@ -442,13 +387,9 @@ out: return res; } -/* - * This is the instance chain terminator function - * for DestroyDebugReportCallback - */ -VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback( - VkInstance instance, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { +// This is the instance chain terminator function for DestroyDebugReportCallback +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { uint32_t storage_idx; VkDebugReportCallbackEXT *icd_info; const struct loader_icd_term *icd_term; @@ -457,13 +398,12 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback( icd_info = *(VkDebugReportCallbackEXT **)&callback; storage_idx = 0; for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (NULL == icd_term->DestroyDebugReportCallbackEXT) { + if (NULL == icd_term->dispatch.DestroyDebugReportCallbackEXT) { continue; } if (icd_info[storage_idx]) { - icd_term->DestroyDebugReportCallbackEXT( - icd_term->instance, icd_info[storage_idx], pAllocator); + icd_term->dispatch.DestroyDebugReportCallbackEXT(icd_term->instance, icd_info[storage_idx], pAllocator); } storage_idx++; } @@ -479,61 +419,47 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback( } } -/* - * This is the instance chain terminator function - * for DebugReportMessage - */ -VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessage( - VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, - int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { +// This is the instance chain terminator function for DebugReportMessage +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { const struct loader_icd_term *icd_term; struct loader_instance *inst = (struct loader_instance *)instance; loader_platform_thread_lock_mutex(&loader_lock); for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { - if (icd_term->DebugReportMessageEXT != NULL) { - icd_term->DebugReportMessageEXT(icd_term->instance, flags, objType, - object, location, msgCode, - pLayerPrefix, pMsg); + if (icd_term->dispatch.DebugReportMessageEXT != NULL) { + icd_term->dispatch.DebugReportMessageEXT(icd_term->instance, flags, objType, object, location, msgCode, pLayerPrefix, + pMsg); } } - /* - * Now that all ICDs have seen the message, call the necessary callbacks. - * Ignoring "bail" return value as there is nothing to bail from at this - * point. - */ + // Now that all ICDs have seen the message, call the necessary callbacks. Ignoring "bail" return value + // as there is nothing to bail from at this point. - util_DebugReportMessage(inst, flags, objType, object, location, msgCode, - pLayerPrefix, pMsg); + util_DebugReportMessage(inst, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); loader_platform_thread_unlock_mutex(&loader_lock); } -bool debug_report_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr) { +bool debug_report_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { // debug_report is currently advertised to be supported by the loader, // so always return the entry points if name matches and it's enabled *addr = NULL; if (!strcmp("vkCreateDebugReportCallbackEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) - ? (void *)debug_report_CreateDebugReportCallbackEXT - : NULL; + *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_CreateDebugReportCallbackEXT + : NULL; return true; } if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) - ? (void *)debug_report_DestroyDebugReportCallbackEXT - : NULL; + *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_DestroyDebugReportCallbackEXT + : NULL; return true; } if (!strcmp("vkDebugReportMessageEXT", name)) { - *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) - ? (void *)debug_report_DebugReportMessageEXT - : NULL; + *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) ? (void *)debug_report_DebugReportMessageEXT : NULL; return true; } return false; diff --git a/third_party/vulkan/loader/debug_report.h b/third_party/vulkan/loader/debug_report.h index 7a659d03b..89074d7f7 100644 --- a/third_party/vulkan/loader/debug_report.h +++ b/third_party/vulkan/loader/debug_report.h @@ -23,138 +23,116 @@ #include "vk_loader_platform.h" #include "loader.h" -/* - * CreateMsgCallback is global and needs to be - * applied to all layers and ICDs. - * What happens if a layer is enabled on both the instance chain - * as well as the device chain and a call to CreateMsgCallback is made? - * Do we need to make sure that each layer / driver only gets called once? - * Should a layer implementing support for CreateMsgCallback only be allowed (?) - * to live on one chain? Or maybe make it the application's responsibility. - * If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice - * time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via - * the instance chain and once via the device chain. - * The loader should only return the DEBUG_REPORT extension as supported - * for the GetGlobalExtensionSupport call. That should help eliminate one - * duplication. - * Since the instance chain requires us iterating over the available ICDs - * and each ICD will have it's own unique MsgCallback object we need to - * track those objects to give back the right one. - * This also implies that the loader has to intercept vkDestroyObject and - * if the extension is enabled and the object type is a MsgCallback then - * we must translate the object into the proper ICD specific ones. - * DestroyObject works on a device chain. Should not be what's destroying - * the MsgCallback object. That needs to be an instance thing. So, since - * we used an instance to create it, we need a custom Destroy that also - * takes an instance. That way we can iterate over the ICDs properly. - * Example use: - * CreateInstance: DEBUG_REPORT - * Loader will create instance chain with enabled extensions. - * TODO: Should validation layers be enabled here? If not, they will not be in - * the instance chain. - * fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's - * vkCreateMsgCallback - * App creates a callback object: fn(..., &MsgCallbackObject1) - * Have only established the instance chain so far. Loader will call the - * instance chain. - * Each layer in the instance chain will call down to the next layer, - * terminating with - * the CreateMsgCallback loader terminator function that creates the actual - * MsgCallbackObject1 object. - * The loader CreateMsgCallback terminator will iterate over the ICDs. - * Calling each ICD that supports vkCreateMsgCallback and collect answers in - * icd_msg_callback_map here. - * As result is sent back up the chain each layer has opportunity to record the - * callback operation and - * appropriate MsgCallback object. - * ... - * Any reports matching the flags set in MsgCallbackObject1 will generate the - * defined callback behavior - * in the layer / ICD that initiated that report. - * ... - * CreateDevice: MemTracker:... - * App does not include DEBUG_REPORT as that is a global extension. - * TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance. - * App MUST include any desired validation layers or they will not participate - * in the device call chain. - * App creates a callback object: fn(..., &MsgCallbackObject2) - * Loader's vkCreateMsgCallback is called. - * Loader sends call down instance chain - this is a global extension - any - * validation layer that was - * enabled at CreateInstance will be able to register the callback. Loader will - * iterate over the ICDs and - * will record the ICD's version of the MsgCallback2 object here. - * ... - * Any report will go to the layer's report function and it will check the flags - * for MsgCallbackObject1 - * and MsgCallbackObject2 and take the appropriate action as indicated by the - * app. - * ... - * App calls vkDestroyMsgCallback( MsgCallbackObject1 ) - * Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be - * sent down instance chain - * ending in the loader's DestroyMsgCallback terminator which will iterate over - * the ICD's destroying each - * ICD version of that MsgCallback object and then destroy the loader's version - * of the object. - * Any reports generated after this will only have MsgCallbackObject2 available. - */ -void debug_report_add_instance_extensions( - const struct loader_instance *inst, struct loader_extension_list *ext_list); +// CreateMsgCallback is global and needs to be +// applied to all layers and ICDs. +// What happens if a layer is enabled on both the instance chain +// as well as the device chain and a call to CreateMsgCallback is made? +// Do we need to make sure that each layer / driver only gets called once? +// Should a layer implementing support for CreateMsgCallback only be allowed (?) +// to live on one chain? Or maybe make it the application's responsibility. +// If the app enables DRAW_STATE on at both CreateInstance time and CreateDevice +// time, CreateMsgCallback will call the DRAW_STATE layer twice. Once via +// the instance chain and once via the device chain. +// The loader should only return the DEBUG_REPORT extension as supported +// for the GetGlobalExtensionSupport call. That should help eliminate one +// duplication. +// Since the instance chain requires us iterating over the available ICDs +// and each ICD will have it's own unique MsgCallback object we need to +// track those objects to give back the right one. +// This also implies that the loader has to intercept vkDestroyObject and +// if the extension is enabled and the object type is a MsgCallback then +// we must translate the object into the proper ICD specific ones. +// DestroyObject works on a device chain. Should not be what's destroying +// the MsgCallback object. That needs to be an instance thing. So, since +// we used an instance to create it, we need a custom Destroy that also +// takes an instance. That way we can iterate over the ICDs properly. +// Example use: +// CreateInstance: DEBUG_REPORT +// Loader will create instance chain with enabled extensions. +// TODO: Should validation layers be enabled here? If not, they will not be in +// the instance chain. +// fn = GetProcAddr(INSTANCE, "vkCreateMsgCallback") -> point to loader's +// vkCreateMsgCallback +// App creates a callback object: fn(..., &MsgCallbackObject1) +// Have only established the instance chain so far. Loader will call the +// instance chain. +// Each layer in the instance chain will call down to the next layer, +// terminating with +// the CreateMsgCallback loader terminator function that creates the actual +// MsgCallbackObject1 object. +// The loader CreateMsgCallback terminator will iterate over the ICDs. +// Calling each ICD that supports vkCreateMsgCallback and collect answers in +// icd_msg_callback_map here. +// As result is sent back up the chain each layer has opportunity to record the +// callback operation and +// appropriate MsgCallback object. +// ... +// Any reports matching the flags set in MsgCallbackObject1 will generate the +// defined callback behavior +// in the layer / ICD that initiated that report. +// ... +// CreateDevice: MemTracker:... +// App does not include DEBUG_REPORT as that is a global extension. +// TODO: GetExtensionSupport must not report DEBUG_REPORT when using instance. +// App MUST include any desired validation layers or they will not participate +// in the device call chain. +// App creates a callback object: fn(..., &MsgCallbackObject2) +// Loader's vkCreateMsgCallback is called. +// Loader sends call down instance chain - this is a global extension - any +// validation layer that was +// enabled at CreateInstance will be able to register the callback. Loader will +// iterate over the ICDs and +// will record the ICD's version of the MsgCallback2 object here. +// ... +// Any report will go to the layer's report function and it will check the flags +// for MsgCallbackObject1 +// and MsgCallbackObject2 and take the appropriate action as indicated by the +// app. +// ... +// App calls vkDestroyMsgCallback( MsgCallbackObject1 ) +// Loader's DestroyMsgCallback is where call starts. DestroyMsgCallback will be +// sent down instance chain +// ending in the loader's DestroyMsgCallback terminator which will iterate over +// the ICD's destroying each +// ICD version of that MsgCallback object and then destroy the loader's version +// of the object. +// Any reports generated after this will only have MsgCallbackObject2 available. -void debug_report_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo); +void debug_report_add_instance_extensions(const struct loader_instance *inst, struct loader_extension_list *ext_list); -bool debug_report_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr); +void debug_report_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( - VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT *pCallback); +bool debug_report_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); -VKAPI_ATTR void VKAPI_CALL -terminator_DestroyDebugReportCallback(VkInstance instance, - VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDebugReportCallbackEXT *pCallback); -VKAPI_ATTR void VKAPI_CALL -terminator_DebugReportMessage(VkInstance instance, VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objType, - uint64_t object, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg); +VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator); -VkResult -util_CreateDebugReportCallback(struct loader_instance *inst, - VkDebugReportCallbackCreateInfoEXT *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackEXT callback); +VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, + int32_t msgCode, const char *pLayerPrefix, const char *pMsg); -void util_DestroyDebugReportCallback(struct loader_instance *inst, - VkDebugReportCallbackEXT callback, +VkResult util_CreateDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT callback); + +void util_DestroyDebugReportCallback(struct loader_instance *inst, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator); -VkResult util_CopyDebugReportCreateInfos( - const void *pChain, const VkAllocationCallbacks *pAllocator, - uint32_t *num_callbacks, VkDebugReportCallbackCreateInfoEXT **infos, - VkDebugReportCallbackEXT **callbacks); -void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, - VkDebugReportCallbackCreateInfoEXT *infos, +VkResult util_CopyDebugReportCreateInfos(const void *pChain, const VkAllocationCallbacks *pAllocator, uint32_t *num_callbacks, + VkDebugReportCallbackCreateInfoEXT **infos, VkDebugReportCallbackEXT **callbacks); +void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks); -VkResult util_CreateDebugReportCallbacks( - struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, - VkDebugReportCallbackEXT *callbacks); +VkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, + uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, + VkDebugReportCallbackEXT *callbacks); -void util_DestroyDebugReportCallbacks(struct loader_instance *inst, - const VkAllocationCallbacks *pAllocator, - uint32_t num_callbacks, +void util_DestroyDebugReportCallbacks(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, uint32_t num_callbacks, VkDebugReportCallbackEXT *callbacks); -VkBool32 util_DebugReportMessage(const struct loader_instance *inst, - VkFlags msgFlags, - VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, - int32_t msgCode, const char *pLayerPrefix, - const char *pMsg); +VkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, + uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg); diff --git a/third_party/vulkan/loader/dev_ext_trampoline.c b/third_party/vulkan/loader/dev_ext_trampoline.c index e1ffa37cd..c5c549aee 100644 --- a/third_party/vulkan/loader/dev_ext_trampoline.c +++ b/third_party/vulkan/loader/dev_ext_trampoline.c @@ -21,9 +21,12 @@ #include "vk_loader_platform.h" #include "loader.h" #if defined(__GNUC__) && !defined(__clang__) -#pragma GCC optimize(3) // force gcc to use tail-calls +#pragma GCC optimize(3) // force gcc to use tail-calls #endif +// Clang-format does not understand macros. +// clang-format off + // Trampoline function macro for unknown physical device extension command. #define DevExtTramp(num) \ VKAPI_ATTR void VKAPI_CALL vkdev_ext##num(VkDevice device) { \ diff --git a/third_party/vulkan/loader/dirent_on_windows.c b/third_party/vulkan/loader/dirent_on_windows.c index 6f78cf931..16318cc70 100644 --- a/third_party/vulkan/loader/dirent_on_windows.c +++ b/third_party/vulkan/loader/dirent_on_windows.c @@ -37,12 +37,10 @@ DIR *opendir(const char *name) { strchr("/\\", name[base_length - 1]) ? "*" : "/*"; if ((dir = (DIR *)loader_instance_tls_heap_alloc(sizeof *dir)) != 0 && - (dir->name = (char *)loader_instance_tls_heap_alloc( - base_length + strlen(all) + 1)) != 0) { + (dir->name = (char *)loader_instance_tls_heap_alloc(base_length + strlen(all) + 1)) != 0) { strcat(strcpy(dir->name, name), all); - if ((dir->handle = - (handle_type)_findfirst(dir->name, &dir->info)) != -1) { + if ((dir->handle = (handle_type)_findfirst(dir->name, &dir->info)) != -1) { dir->result.d_name = 0; } else /* rollback */ { diff --git a/third_party/vulkan/loader/extension_manual.c b/third_party/vulkan/loader/extension_manual.c new file mode 100644 index 000000000..6ddb9b098 --- /dev/null +++ b/third_party/vulkan/loader/extension_manual.c @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Mark Young + */ + +#define _GNU_SOURCE +#include +#include +#include +#include "vk_loader_platform.h" +#include "loader.h" +#include "vk_loader_extensions.h" +#include +#include "wsi.h" +#include "debug_report.h" + +// ---- Manually added trampoline/terminator functions + +// These functions, for whatever reason, require more complex changes than +// can easily be automatically generated. +VkResult setupLoaderTrampPhysDevGroups(VkInstance instance); +VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst); + +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { + VkResult res = VK_SUCCESS; + uint32_t count; + uint32_t i; + struct loader_instance *inst = NULL; + + loader_platform_thread_lock_mutex(&loader_lock); + + inst = loader_get_instance(instance); + if (NULL == inst) { + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + if (NULL == pPhysicalDeviceGroupCount) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkEnumeratePhysicalDeviceGroupsKHX: Received NULL pointer for physical " + "device group count return value."); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + VkResult setup_res = setupLoaderTrampPhysDevGroups(instance); + if (VK_SUCCESS != setup_res) { + res = setup_res; + goto out; + } + + count = inst->phys_dev_group_count_tramp; + + // Wrap the PhysDev object for loader usage, return wrapped objects + if (NULL != pPhysicalDeviceGroupProperties) { + if (inst->phys_dev_group_count_tramp > *pPhysicalDeviceGroupCount) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkEnumeratePhysicalDeviceGroupsKHX: Trimming device group count down" + " by application request from %d to %d physical device groups", + inst->phys_dev_group_count_tramp, *pPhysicalDeviceGroupCount); + count = *pPhysicalDeviceGroupCount; + res = VK_INCOMPLETE; + } + for (i = 0; i < count; i++) { + memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_tramp[i], + sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + } + } + + *pPhysicalDeviceGroupCount = count; + +out: + + loader_platform_thread_unlock_mutex(&loader_lock); + return res; +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { + struct loader_instance *inst = (struct loader_instance *)instance; + VkResult res = VK_SUCCESS; + + // Always call the setup loader terminator physical device groups because they may + // have changed at any point. + res = setupLoaderTermPhysDevGroups(inst); + if (VK_SUCCESS != res) { + goto out; + } + + uint32_t copy_count = inst->phys_dev_group_count_term; + if (NULL != pPhysicalDeviceGroupProperties) { + if (copy_count > *pPhysicalDeviceGroupCount) { + copy_count = *pPhysicalDeviceGroupCount; + res = VK_INCOMPLETE; + } + + for (uint32_t i = 0; i < copy_count; i++) { + memcpy(&pPhysicalDeviceGroupProperties[i], inst->phys_dev_groups_term[i], + sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + } + } + + *pPhysicalDeviceGroupCount = copy_count; + +out: + + return res; +} + +VKAPI_ATTR VkResult VKAPI_CALL +GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, + VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + + return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV( + unwrapped_phys_dev, format, type, tiling, usage, flags, + externalHandleType, pExternalImageFormatProperties); +} + +VKAPI_ATTR VkResult VKAPI_CALL +terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, + VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { + struct loader_physical_device_term *phys_dev_term = + (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + + if (!icd_term->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV) { + if (externalHandleType) { + return VK_ERROR_FORMAT_NOT_SUPPORTED; + } + + if (!icd_term->dispatch.GetPhysicalDeviceImageFormatProperties) { + return VK_ERROR_INITIALIZATION_FAILED; + } + + pExternalImageFormatProperties->externalMemoryFeatures = 0; + pExternalImageFormatProperties->exportFromImportedHandleTypes = 0; + pExternalImageFormatProperties->compatibleHandleTypes = 0; + + return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties( + phys_dev_term->phys_dev, format, type, tiling, usage, flags, + &pExternalImageFormatProperties->imageFormatProperties); + } + + return icd_term->dispatch.GetPhysicalDeviceExternalImageFormatPropertiesNV( + phys_dev_term->phys_dev, format, type, tiling, usage, flags, + externalHandleType, pExternalImageFormatProperties); +} + + +VkResult setupLoaderTrampPhysDevGroups(VkInstance instance) { + VkResult res = VK_SUCCESS; + struct loader_instance *inst; + uint32_t total_count = 0; + VkPhysicalDeviceGroupPropertiesKHX **new_phys_dev_groups = NULL; + VkPhysicalDeviceGroupPropertiesKHX *local_phys_dev_groups = NULL; + + inst = loader_get_instance(instance); + if (NULL == inst) { + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + // Setup the trampoline loader physical devices. This will actually + // call down and setup the terminator loader physical devices during the + // process. + VkResult setup_res = setupLoaderTrampPhysDevs(instance); + if (setup_res != VK_SUCCESS && setup_res != VK_INCOMPLETE) { + res = setup_res; + goto out; + } + + // Query how many physical device groups there + res = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHX(instance, &total_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHX\' to lower layers or " + "loader to get count."); + goto out; + } + + // Create an array for the new physical device groups, which will be stored + // in the instance for the trampoline code. + new_phys_dev_groups = (VkPhysicalDeviceGroupPropertiesKHX **)loader_instance_heap_alloc( + inst, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate new physical device" + " group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *)); + + // Create a temporary array (on the stack) to keep track of the + // returned VkPhysicalDevice values. + local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); + if (NULL == local_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate local " + "physical device group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + // Initialize the memory to something valid + memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); + for (uint32_t group = 0; group < total_count; group++) { + local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX; + local_phys_dev_groups[group].pNext = NULL; + local_phys_dev_groups[group].subsetAllocation = false; + } + + // Call down and get the content + res = inst->disp->layer_inst_disp.EnumeratePhysicalDeviceGroupsKHX(instance, &total_count, local_phys_dev_groups); + if (VK_SUCCESS != res) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHX\' to lower layers or " + "loader to get content."); + goto out; + } + + // Replace all the physical device IDs with the proper loader values + for (uint32_t group = 0; group < total_count; group++) { + for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { + bool found = false; + for (uint32_t tramp_gpu = 0; tramp_gpu < inst->phys_dev_count_tramp; tramp_gpu++) { + if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_tramp[tramp_gpu]->phys_dev) { + local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_tramp[tramp_gpu]; + found = true; + break; + } + } + if (!found) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to find GPU %d in group %d" + " returned by \'EnumeratePhysicalDeviceGroupsKHX\' in list returned" + " by \'EnumeratePhysicalDevices\'", group_gpu, group); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + } + } + + // Copy or create everything to fill the new array of physical device groups + for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { + // Check if this physical device group with the same contents is already in the old buffer + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_tramp; old_idx++) { + if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount) { + bool found_all_gpus = true; + for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_tramp[old_idx]->physicalDeviceCount; old_gpu++) { + bool found_gpu = false; + for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { + if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_tramp[old_idx]->physicalDevices[old_gpu]) { + found_gpu = true; + break; + } + } + + if (!found_gpu) { + found_all_gpus = false; + break; + } + } + if (!found_all_gpus) { + continue; + } else { + new_phys_dev_groups[new_idx] = inst->phys_dev_groups_tramp[old_idx]; + break; + } + } + } + + // If this physical device group isn't in the old buffer, create it + if (NULL == new_phys_dev_groups[new_idx]) { + new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHX *)loader_instance_heap_alloc( + inst, sizeof(VkPhysicalDeviceGroupPropertiesKHX), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups[new_idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevGroups: Failed to allocate " + "physical device group trampoline object %d", + new_idx); + total_count = new_idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], + sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + } + } + +out: + + if (VK_SUCCESS != res) { + if (NULL != new_phys_dev_groups) { + for (uint32_t i = 0; i < total_count; i++) { + loader_instance_heap_free(inst, new_phys_dev_groups[i]); + } + loader_instance_heap_free(inst, new_phys_dev_groups); + } + total_count = 0; + } else { + // Free everything that didn't carry over to the new array of + // physical device groups + if (NULL != inst->phys_dev_groups_tramp) { + for (uint32_t i = 0; i < inst->phys_dev_group_count_tramp; i++) { + bool found = false; + for (uint32_t j = 0; j < total_count; j++) { + if (inst->phys_dev_groups_tramp[i] == new_phys_dev_groups[j]) { + found = true; + break; + } + } + if (!found) { + loader_instance_heap_free(inst, inst->phys_dev_groups_tramp[i]); + } + } + loader_instance_heap_free(inst, inst->phys_dev_groups_tramp); + } + + // Swap in the new physical device group list + inst->phys_dev_group_count_tramp = total_count; + inst->phys_dev_groups_tramp = new_phys_dev_groups; + } + + return res; +} + +VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { + VkResult res = VK_SUCCESS; + struct loader_icd_term *icd_term; + uint32_t total_count = 0; + uint32_t cur_icd_group_count = 0; + VkPhysicalDeviceGroupPropertiesKHX **new_phys_dev_groups = NULL; + VkPhysicalDeviceGroupPropertiesKHX *local_phys_dev_groups = NULL; + + if (0 == inst->phys_dev_count_term) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Loader failed to setup physical " + "device terminator info before calling \'EnumeratePhysicalDeviceGroupsKHX\'."); + assert(false); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + + // For each ICD, query the number of physical device groups, and then get an + // internal value for those physical devices. + icd_term = inst->icd_terms; + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + cur_icd_group_count = 0; + if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX) { + // Treat each ICD's GPU as it's own group if the extension isn't supported + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &cur_icd_group_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", + icd_idx); + goto out; + } + } else { + // Query the actual group info + res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(icd_term->instance, &cur_icd_group_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHX\' to ICD %d to get count.", + icd_idx); + goto out; + } + } + total_count += cur_icd_group_count; + } + + // Create an array for the new physical device groups, which will be stored + // in the instance for the Terminator code. + new_phys_dev_groups = (VkPhysicalDeviceGroupPropertiesKHX **)loader_instance_heap_alloc( + inst, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate new physical device" + " group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memset(new_phys_dev_groups, 0, total_count * sizeof(VkPhysicalDeviceGroupPropertiesKHX *)); + + // Create a temporary array (on the stack) to keep track of the + // returned VkPhysicalDevice values. + local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); + if (NULL == local_phys_dev_groups) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate local " + "physical device group array of size %d", + total_count); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + // Initialize the memory to something valid + memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupPropertiesKHX) * total_count); + for (uint32_t group = 0; group < total_count; group++) { + local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX; + local_phys_dev_groups[group].pNext = NULL; + local_phys_dev_groups[group].subsetAllocation = false; + } + + cur_icd_group_count = 0; + icd_term = inst->icd_terms; + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + uint32_t count_this_time = total_count - cur_icd_group_count; + + if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX) { + VkPhysicalDevice* phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * count_this_time); + if (NULL == phys_dev_array) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate local " + "physical device array of size %d", + count_this_time); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &count_this_time, phys_dev_array); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDevices\' to ICD %d to get plain phys dev count.", + icd_idx); + goto out; + } + + // Add each GPU as it's own group + for (uint32_t indiv_gpu = 0; indiv_gpu < count_this_time; indiv_gpu++) { + local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDeviceCount = 1; + local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDevices[0] = phys_dev_array[indiv_gpu]; + } + + } else { + res = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHX(icd_term->instance, &count_this_time, &local_phys_dev_groups[cur_icd_group_count]); + if (VK_SUCCESS != res) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed during dispatch call of " + "\'EnumeratePhysicalDeviceGroupsKHX\' to ICD %d to get content.", + icd_idx); + goto out; + } + } + + cur_icd_group_count += count_this_time; + } + + // Replace all the physical device IDs with the proper loader values + for (uint32_t group = 0; group < total_count; group++) { + for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { + bool found = false; + for (uint32_t term_gpu = 0; term_gpu < inst->phys_dev_count_term; term_gpu++) { + if (local_phys_dev_groups[group].physicalDevices[group_gpu] == inst->phys_devs_term[term_gpu]->phys_dev) { + local_phys_dev_groups[group].physicalDevices[group_gpu] = (VkPhysicalDevice)inst->phys_devs_term[term_gpu]; + found = true; + break; + } + } + if (!found) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to find GPU %d in group %d" + " returned by \'EnumeratePhysicalDeviceGroupsKHX\' in list returned" + " by \'EnumeratePhysicalDevices\'", group_gpu, group); + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } + } + } + + // Copy or create everything to fill the new array of physical device groups + for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { + // Check if this physical device group with the same contents is already in the old buffer + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_term; old_idx++) { + if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_term[old_idx]->physicalDeviceCount) { + bool found_all_gpus = true; + for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_term[old_idx]->physicalDeviceCount; old_gpu++) { + bool found_gpu = false; + for (uint32_t new_gpu = 0; new_gpu < local_phys_dev_groups[new_idx].physicalDeviceCount; new_gpu++) { + if (local_phys_dev_groups[new_idx].physicalDevices[new_gpu] == inst->phys_dev_groups_term[old_idx]->physicalDevices[old_gpu]) { + found_gpu = true; + break; + } + } + + if (!found_gpu) { + found_all_gpus = false; + break; + } + } + if (!found_all_gpus) { + continue; + } else { + new_phys_dev_groups[new_idx] = inst->phys_dev_groups_term[old_idx]; + break; + } + } + } + + // If this physical device group isn't in the old buffer, create it + if (NULL == new_phys_dev_groups[new_idx]) { + new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHX *)loader_instance_heap_alloc( + inst, sizeof(VkPhysicalDeviceGroupPropertiesKHX), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups[new_idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate " + "physical device group Terminator object %d", + new_idx); + total_count = new_idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], + sizeof(VkPhysicalDeviceGroupPropertiesKHX)); + } + } + +out: + + if (VK_SUCCESS != res) { + if (NULL != new_phys_dev_groups) { + for (uint32_t i = 0; i < total_count; i++) { + loader_instance_heap_free(inst, new_phys_dev_groups[i]); + } + loader_instance_heap_free(inst, new_phys_dev_groups); + } + total_count = 0; + } else { + // Free everything that didn't carry over to the new array of + // physical device groups + if (NULL != inst->phys_dev_groups_term) { + for (uint32_t i = 0; i < inst->phys_dev_group_count_term; i++) { + bool found = false; + for (uint32_t j = 0; j < total_count; j++) { + if (inst->phys_dev_groups_term[i] == new_phys_dev_groups[j]) { + found = true; + break; + } + } + if (!found) { + loader_instance_heap_free(inst, inst->phys_dev_groups_term[i]); + } + } + loader_instance_heap_free(inst, inst->phys_dev_groups_term); + } + + // Swap in the new physical device group list + inst->phys_dev_group_count_term = total_count; + inst->phys_dev_groups_term = new_phys_dev_groups; + } + + return res; +} \ No newline at end of file diff --git a/third_party/vulkan/loader/extension_manual.h b/third_party/vulkan/loader/extension_manual.h new file mode 100644 index 000000000..35d7c6fa0 --- /dev/null +++ b/third_party/vulkan/loader/extension_manual.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Mark Young + */ + +#pragma once + +// ---- Manually added trampoline/terminator functions + +// These functions, for whatever reason, require more complex changes than +// can easily be automatically generated. + +VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties); + +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties); + +VKAPI_ATTR VkResult VKAPI_CALL +GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, + VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL +terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, + VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, + VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); + diff --git a/third_party/vulkan/loader/extensions.c b/third_party/vulkan/loader/extensions.c deleted file mode 100644 index 221924a93..000000000 --- a/third_party/vulkan/loader/extensions.c +++ /dev/null @@ -1,850 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Mark Lobodzinski - */ - -#define _GNU_SOURCE -#include -#include -#include -#include "vk_loader_platform.h" -#include "loader.h" -#include "extensions.h" -#include "table_ops.h" -#include -#include "wsi.h" - -// Definitions for the VK_KHR_get_physical_device_properties2 extension - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFeatures2KHR(unwrapped_phys_dev, pFeatures); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceFeatures2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceFeatures2KHR"); - } - icd_term->GetPhysicalDeviceFeatures2KHR(phys_dev_term->phys_dev, pFeatures); -} - -VKAPI_ATTR void VKAPI_CALL -vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceProperties2KHR(unwrapped_phys_dev, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceProperties2KHR"); - } - icd_term->GetPhysicalDeviceProperties2KHR(phys_dev_term->phys_dev, - pProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR( - VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceFormatProperties2KHR(unwrapped_phys_dev, format, - pFormatProperties); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR( - VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceFormatProperties2KHR"); - } - icd_term->GetPhysicalDeviceFormatProperties2KHR(phys_dev_term->phys_dev, - format, pFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceImageFormatProperties2KHR( - unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceImageFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceImageFormatProperties2KHR"); - } - return icd_term->GetPhysicalDeviceImageFormatProperties2KHR( - phys_dev_term->phys_dev, pImageFormatInfo, pImageFormatProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceQueueFamilyProperties2KHR( - unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); -} - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceQueueFamilyProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); - } - icd_term->GetPhysicalDeviceQueueFamilyProperties2KHR( - phys_dev_term->phys_dev, pQueueFamilyPropertyCount, - pQueueFamilyProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceMemoryProperties2KHR(unwrapped_phys_dev, - pMemoryProperties); -} -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceMemoryProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceMemoryProperties2KHR"); - } - icd_term->GetPhysicalDeviceMemoryProperties2KHR(phys_dev_term->phys_dev, - pMemoryProperties); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, - uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceSparseImageFormatProperties2KHR( - unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); -} - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, - uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceSparseImageFormatProperties2KHR) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); - } - icd_term->GetPhysicalDeviceSparseImageFormatProperties2KHR( - phys_dev_term->phys_dev, pFormatInfo, pPropertyCount, pProperties); -} - -// Definitions for the VK_KHR_maintenance1 extension - -VKAPI_ATTR void VKAPI_CALL -vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, - VkCommandPoolTrimFlagsKHR flags) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->TrimCommandPoolKHR(device, commandPool, flags); -} - -// Definitions for the VK_EXT_acquire_xlib_display extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( - VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->AcquireXlibDisplayEXT(unwrapped_phys_dev, dpy, display); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT( - VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->AcquireXlibDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkAcquireXlibDisplayEXT"); - } - return icd_term->AcquireXlibDisplayEXT(phys_dev_term->phys_dev, dpy, - display); -} - -VKAPI_ATTR VkResult VKAPI_CALL -vkGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, - RROutput rrOutput, VkDisplayKHR *pDisplay) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetRandROutputDisplayEXT(unwrapped_phys_dev, dpy, rrOutput, - pDisplay); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT( - VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, - VkDisplayKHR *pDisplay) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetRandROutputDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetRandROutputDisplayEXT"); - } - return icd_term->GetRandROutputDisplayEXT(phys_dev_term->phys_dev, dpy, - rrOutput, pDisplay); -} -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -// Definitions for the VK_EXT_debug_marker extension commands which -// need to have a terminator function - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT( - VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - // If this is a physical device, we have to replace it with the proper one - // for the next call. - if (pTagInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_tramp *phys_dev_tramp = - (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->object; - pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; - } - return disp->DebugMarkerSetObjectTagEXT(device, pTagInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT( - VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { - uint32_t icd_index = 0; - struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->DebugMarkerSetObjectTagEXT) { - // If this is a physical device, we have to replace it with the proper - // one for the next call. - if (pTagInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)(uintptr_t) - pTagInfo->object; - pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; - - // If this is a KHR_surface, and the ICD has created its own, we - // have to replace it with the proper one for the next call. - } else if (pTagInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { - VkIcdSurface *icd_surface = - (VkIcdSurface *)(uintptr_t)pTagInfo->object; - if (NULL != icd_surface->real_icd_surfaces) { - pTagInfo->object = - (uint64_t)icd_surface->real_icd_surfaces[icd_index]; - } - } - } - return icd_term->DebugMarkerSetObjectTagEXT(device, pTagInfo); - } else { - return VK_SUCCESS; - } -} - -VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT( - VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - // If this is a physical device, we have to replace it with the proper one - // for the next call. - if (pNameInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_tramp *phys_dev_tramp = - (struct loader_physical_device_tramp *)(uintptr_t)pNameInfo->object; - pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; - } - return disp->DebugMarkerSetObjectNameEXT(device, pNameInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT( - VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { - uint32_t icd_index = 0; - struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->DebugMarkerSetObjectNameEXT) { - // If this is a physical device, we have to replace it with the proper - // one for the next call. - if (pNameInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)(uintptr_t) - pNameInfo->object; - pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; - - // If this is a KHR_surface, and the ICD has created its own, we - // have to replace it with the proper one for the next call. - } else if (pNameInfo->objectType == - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { - VkIcdSurface *icd_surface = - (VkIcdSurface *)(uintptr_t)pNameInfo->object; - if (NULL != icd_surface->real_icd_surfaces) { - pNameInfo->object = - (uint64_t)( - uintptr_t)icd_surface->real_icd_surfaces[icd_index]; - } - } - } - return icd_term->DebugMarkerSetObjectNameEXT(device, pNameInfo); - } else { - return VK_SUCCESS; - } -} - -// Definitions for the VK_EXT_direct_mode_display extension - -VKAPI_ATTR VkResult VKAPI_CALL -vkReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->ReleaseDisplayEXT(unwrapped_phys_dev, display); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT( - VkPhysicalDevice physicalDevice, VkDisplayKHR display) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->ReleaseDisplayEXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkReleaseDisplayEXT"); - } - return icd_term->ReleaseDisplayEXT(phys_dev_term->phys_dev, display); -} - -// Definitions for the VK_EXT_display_surface_counter extension - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceSurfaceCapabilities2EXT( - unwrapped_phys_dev, surface, pSurfaceCapabilities); -} - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term) { - if (NULL == icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, - 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); - } - VkIcdSurface *icd_surface = (VkIcdSurface *)(surface); - uint8_t icd_index = phys_dev_term->icd_index; - if (NULL != icd_surface->real_icd_surfaces) { - if (NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT( - phys_dev_term->phys_dev, - icd_surface->real_icd_surfaces[icd_index], - pSurfaceCapabilities); - } - } - } - return icd_term->GetPhysicalDeviceSurfaceCapabilities2EXT( - phys_dev_term->phys_dev, surface, pSurfaceCapabilities); -} - -// Definitions for the VK_AMD_draw_indirect_count extension - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD( - VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, - uint32_t stride) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, - countBufferOffset, maxDrawCount, stride); -} - -VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( - VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, - uint32_t stride) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, - countBuffer, countBufferOffset, - maxDrawCount, stride); -} - -// Definitions for the VK_NV_external_memory_capabilities extension - -VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - - return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV( - unwrapped_phys_dev, format, type, tiling, usage, flags, - externalHandleType, pExternalImageFormatProperties); -} - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - if (!icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV) { - if (externalHandleType) { - return VK_ERROR_FORMAT_NOT_SUPPORTED; - } - - if (!icd_term->GetPhysicalDeviceImageFormatProperties) { - return VK_ERROR_INITIALIZATION_FAILED; - } - - pExternalImageFormatProperties->externalMemoryFeatures = 0; - pExternalImageFormatProperties->exportFromImportedHandleTypes = 0; - pExternalImageFormatProperties->compatibleHandleTypes = 0; - - return icd_term->GetPhysicalDeviceImageFormatProperties( - phys_dev_term->phys_dev, format, type, tiling, usage, flags, - &pExternalImageFormatProperties->imageFormatProperties); - } - - return icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV( - phys_dev_term->phys_dev, format, type, tiling, usage, flags, - externalHandleType, pExternalImageFormatProperties); -} - -#ifdef VK_USE_PLATFORM_WIN32_KHR - -// Definitions for the VK_NV_external_memory_win32 extension - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( - VkDevice device, VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->GetMemoryWin32HandleNV(device, memory, handleType, pHandle); -} - -#endif // VK_USE_PLATFORM_WIN32_KHR - -// Definitions for the VK_NVX_device_generated_commands - -VKAPI_ATTR void VKAPI_CALL vkCmdProcessCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); -} - -VKAPI_ATTR void VKAPI_CALL vkCmdReserveSpaceForCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateIndirectCommandsLayoutNVX( - VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateIndirectCommandsLayoutNVX( - device, pCreateInfo, pAllocator, pIndirectCommandsLayout); -} - -VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNVX( - VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks *pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, - pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateObjectTableNVX( - VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateObjectTableNVX(device, pCreateInfo, pAllocator, - pObjectTable); -} - -VKAPI_ATTR void VKAPI_CALL -vkDestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, - const VkAllocationCallbacks *pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyObjectTableNVX(device, objectTable, pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkRegisterObjectsNVX( - VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectTableEntryNVX *const *ppObjectTableEntries, - const uint32_t *pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->RegisterObjectsNVX(device, objectTable, objectCount, - ppObjectTableEntries, pObjectIndices); -} - -VKAPI_ATTR VkResult VKAPI_CALL vkUnregisterObjectsNVX( - VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, - const VkObjectEntryTypeNVX *pObjectEntryTypes, - const uint32_t *pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->UnregisterObjectsNVX(device, objectTable, objectCount, - pObjectEntryTypes, pObjectIndices); -} - -VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, - VkDeviceGeneratedCommandsLimitsNVX *pLimits) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(unwrapped_phys_dev, - pFeatures, pLimits); -} - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, - VkDeviceGeneratedCommandsLimitsNVX *pLimits) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceGeneratedCommandsPropertiesNVX) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support " - "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); - } else { - icd_term->GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - phys_dev_term->phys_dev, pFeatures, pLimits); - } -} - -// GPA helpers for extensions - -bool extension_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr) { - *addr = NULL; - - // Functions for the VK_KHR_get_physical_device_properties2 extension - - if (!strcmp("vkGetPhysicalDeviceFeatures2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceFeatures2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceFormatProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceImageFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceImageFormatProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceQueueFamilyProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceQueueFamilyProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceMemoryProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceMemoryProperties2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceSparseImageFormatProperties2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 == 1) - ? (void *)vkGetPhysicalDeviceSparseImageFormatProperties2KHR - : NULL; - return true; - } - - // Functions for the VK_KHR_maintenance1 extension - - if (!strcmp("vkTrimCommandPoolKHR", name)) { - *addr = (void *)vkTrimCommandPoolKHR; - return true; - } - -// Functions for the VK_EXT_acquire_xlib_display extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - if (!strcmp("vkAcquireXlibDisplayEXT", name)) { - *addr = - (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == - 1) - ? (void *)vkAcquireXlibDisplayEXT - : NULL; - return true; - } - - if (!strcmp("vkGetRandROutputDisplayEXT", name)) { - *addr = - (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == - 1) - ? (void *)vkGetRandROutputDisplayEXT - : NULL; - return true; - } - -#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT - - // Definitions for the VK_EXT_debug_marker extension commands which - // need to have a terminator function. Since these are device - // commands, we always need to return a valid value for them. - - if (!strcmp("vkDebugMarkerSetObjectTagEXT", name)) { - *addr = (void *)vkDebugMarkerSetObjectTagEXT; - return true; - } - if (!strcmp("vkDebugMarkerSetObjectNameEXT", name)) { - *addr = (void *)vkDebugMarkerSetObjectNameEXT; - return true; - } - - // Functions for the VK_EXT_direct_mode_display extension - - if (!strcmp("vkReleaseDisplayEXT", name)) { - *addr = - (ptr_instance->enabled_known_extensions.ext_direct_mode_display == - 1) - ? (void *)vkReleaseDisplayEXT - : NULL; - return true; - } - - // Functions for the VK_EXT_display_surface_counter extension - - if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2EXT", name)) { - *addr = (ptr_instance->enabled_known_extensions - .ext_display_surface_counter == 1) - ? (void *)vkGetPhysicalDeviceSurfaceCapabilities2EXT - : NULL; - return true; - } - - // Functions for the VK_AMD_draw_indirect_count extension - - if (!strcmp("vkCmdDrawIndirectCountAMD", name)) { - *addr = (void *)vkCmdDrawIndirectCountAMD; - return true; - } - if (!strcmp("vkCmdDrawIndexedIndirectCountAMD", name)) { - *addr = (void *)vkCmdDrawIndexedIndirectCountAMD; - return true; - } - // Functions for the VK_NV_external_memory_capabilities extension - - if (!strcmp("vkGetPhysicalDeviceExternalImageFormatPropertiesNV", name)) { - *addr = (ptr_instance->enabled_known_extensions - .nv_external_memory_capabilities == 1) - ? (void *)vkGetPhysicalDeviceExternalImageFormatPropertiesNV - : NULL; - return true; - } - -#ifdef VK_USE_PLATFORM_WIN32_KHR - - // Functions for the VK_NV_external_memory_win32 extension - if (!strcmp("vkGetMemoryWin32HandleNV", name)) { - *addr = (void *)vkGetMemoryWin32HandleNV; - return true; - } - -#endif // VK_USE_PLATFORM_WIN32_KHR - - // Functions for the VK_NVX_device_generated_commands extension - - if (!strcmp("vkCmdProcessCommandsNVX", name)) { - *addr = (void *)vkCmdProcessCommandsNVX; - return true; - } - if (!strcmp("vkCmdReserveSpaceForCommandsNVX", name)) { - *addr = (void *)vkCmdReserveSpaceForCommandsNVX; - return true; - } - if (!strcmp("vkCreateIndirectCommandsLayoutNVX", name)) { - *addr = (void *)vkCreateIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkDestroyIndirectCommandsLayoutNVX", name)) { - *addr = (void *)vkDestroyIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkCreateObjectTableNVX", name)) { - *addr = (void *)vkCreateObjectTableNVX; - return true; - } - if (!strcmp("vkDestroyObjectTableNVX", name)) { - *addr = (void *)vkDestroyObjectTableNVX; - return true; - } - if (!strcmp("vkRegisterObjectsNVX", name)) { - *addr = (void *)vkRegisterObjectsNVX; - return true; - } - if (!strcmp("vkUnregisterObjectsNVX", name)) { - *addr = (void *)vkUnregisterObjectsNVX; - return true; - } - if (!strcmp("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", name)) { - *addr = (void *)vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; - return true; - } - - return false; -} - -void extensions_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo) { - for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (0 == - strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions - .khr_get_physical_device_properties2 = 1; -#ifdef VK_USE_PLATFORM_XLIB_KHR - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_acquire_xlib_display = 1; -#endif - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_direct_mode_display = 1; - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.ext_display_surface_counter = - 1; - } else if (0 == - strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions - .nv_external_memory_capabilities = 1; - } - } -} diff --git a/third_party/vulkan/loader/extensions.h b/third_party/vulkan/loader/extensions.h deleted file mode 100644 index b94aaf90b..000000000 --- a/third_party/vulkan/loader/extensions.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Mark Lobodzinski - * - */ - -#include "vk_loader_platform.h" -#include "loader.h" - -bool extension_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr); - -void extensions_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo); - -// Instance extension terminators for the VK_KHR_get_physical_device_properties2 -// extension - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties2KHR *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR( - VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties2KHR *pFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, - VkImageFormatProperties2KHR *pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties2KHR *pQueueFamilyProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, - uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties); - -// Instance extension terminators for the VK_EXT_acquire_xlib_display -// extension - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT -VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT( - VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT( - VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, - VkDisplayKHR *pDisplay); -#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */ - -// Instance extension terminators for the VK_EXT_direct_mode_display -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT( - VkPhysicalDevice physicalDevice, VkDisplayKHR display); - -// Instance extension terminators for the VK_EXT_display_surface_counter -// extension - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfaceCapabilities2EXT( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT *pSurfaceCapabilities); - -// Device extension terminators for the VK_NV_external_memory_capabilities -// extension - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT( - VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT( - VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo); - -// Instance extension terminators for the VK_NV_external_memory_capabilities -// extension - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); - -// Instance extension terminators for the VK_NVX_device_generated_commands -// extension -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, - VkDeviceGeneratedCommandsLimitsNVX *pLimits); diff --git a/third_party/vulkan/loader/gpa_helper.h b/third_party/vulkan/loader/gpa_helper.h index c7e7ba2da..0763938bb 100644 --- a/third_party/vulkan/loader/gpa_helper.h +++ b/third_party/vulkan/loader/gpa_helper.h @@ -22,295 +22,157 @@ #include #include "debug_report.h" #include "wsi.h" -#include "extensions.h" -static inline void *trampolineGetProcAddr(struct loader_instance *inst, - const char *funcName) { +static inline void *trampolineGetProcAddr(struct loader_instance *inst, const char *funcName) { // Don't include or check global functions - if (!strcmp(funcName, "vkGetInstanceProcAddr")) - return (PFN_vkVoidFunction)vkGetInstanceProcAddr; - if (!strcmp(funcName, "vkDestroyInstance")) - return (PFN_vkVoidFunction)vkDestroyInstance; - if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) - return (PFN_vkVoidFunction)vkEnumeratePhysicalDevices; - if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) - return (PFN_vkVoidFunction)vkGetPhysicalDeviceFeatures; - if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) - return (PFN_vkVoidFunction)vkGetPhysicalDeviceFormatProperties; + if (!strcmp(funcName, "vkGetInstanceProcAddr")) return (PFN_vkVoidFunction)vkGetInstanceProcAddr; + if (!strcmp(funcName, "vkDestroyInstance")) return (PFN_vkVoidFunction)vkDestroyInstance; + if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) return (PFN_vkVoidFunction)vkEnumeratePhysicalDevices; + if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceFeatures; + if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceFormatProperties; if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceImageFormatProperties; if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties")) - return ( - PFN_vkVoidFunction)vkGetPhysicalDeviceSparseImageFormatProperties; - if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) - return (PFN_vkVoidFunction)vkGetPhysicalDeviceProperties; + return (PFN_vkVoidFunction)vkGetPhysicalDeviceSparseImageFormatProperties; + if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceProperties; if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceQueueFamilyProperties; - if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties")) - return (PFN_vkVoidFunction)vkGetPhysicalDeviceMemoryProperties; - if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) - return (PFN_vkVoidFunction)vkEnumerateDeviceLayerProperties; - if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) - return (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties; - if (!strcmp(funcName, "vkCreateDevice")) - return (PFN_vkVoidFunction)vkCreateDevice; - if (!strcmp(funcName, "vkGetDeviceProcAddr")) - return (PFN_vkVoidFunction)vkGetDeviceProcAddr; - if (!strcmp(funcName, "vkDestroyDevice")) - return (PFN_vkVoidFunction)vkDestroyDevice; - if (!strcmp(funcName, "vkGetDeviceQueue")) - return (PFN_vkVoidFunction)vkGetDeviceQueue; - if (!strcmp(funcName, "vkQueueSubmit")) - return (PFN_vkVoidFunction)vkQueueSubmit; - if (!strcmp(funcName, "vkQueueWaitIdle")) - return (PFN_vkVoidFunction)vkQueueWaitIdle; - if (!strcmp(funcName, "vkDeviceWaitIdle")) - return (PFN_vkVoidFunction)vkDeviceWaitIdle; - if (!strcmp(funcName, "vkAllocateMemory")) - return (PFN_vkVoidFunction)vkAllocateMemory; - if (!strcmp(funcName, "vkFreeMemory")) - return (PFN_vkVoidFunction)vkFreeMemory; - if (!strcmp(funcName, "vkMapMemory")) - return (PFN_vkVoidFunction)vkMapMemory; - if (!strcmp(funcName, "vkUnmapMemory")) - return (PFN_vkVoidFunction)vkUnmapMemory; - if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) - return (PFN_vkVoidFunction)vkFlushMappedMemoryRanges; - if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) - return (PFN_vkVoidFunction)vkInvalidateMappedMemoryRanges; - if (!strcmp(funcName, "vkGetDeviceMemoryCommitment")) - return (PFN_vkVoidFunction)vkGetDeviceMemoryCommitment; - if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements")) - return (PFN_vkVoidFunction)vkGetImageSparseMemoryRequirements; - if (!strcmp(funcName, "vkGetImageMemoryRequirements")) - return (PFN_vkVoidFunction)vkGetImageMemoryRequirements; - if (!strcmp(funcName, "vkGetBufferMemoryRequirements")) - return (PFN_vkVoidFunction)vkGetBufferMemoryRequirements; - if (!strcmp(funcName, "vkBindImageMemory")) - return (PFN_vkVoidFunction)vkBindImageMemory; - if (!strcmp(funcName, "vkBindBufferMemory")) - return (PFN_vkVoidFunction)vkBindBufferMemory; - if (!strcmp(funcName, "vkQueueBindSparse")) - return (PFN_vkVoidFunction)vkQueueBindSparse; - if (!strcmp(funcName, "vkCreateFence")) - return (PFN_vkVoidFunction)vkCreateFence; - if (!strcmp(funcName, "vkDestroyFence")) - return (PFN_vkVoidFunction)vkDestroyFence; - if (!strcmp(funcName, "vkGetFenceStatus")) - return (PFN_vkVoidFunction)vkGetFenceStatus; - if (!strcmp(funcName, "vkResetFences")) - return (PFN_vkVoidFunction)vkResetFences; - if (!strcmp(funcName, "vkWaitForFences")) - return (PFN_vkVoidFunction)vkWaitForFences; - if (!strcmp(funcName, "vkCreateSemaphore")) - return (PFN_vkVoidFunction)vkCreateSemaphore; - if (!strcmp(funcName, "vkDestroySemaphore")) - return (PFN_vkVoidFunction)vkDestroySemaphore; - if (!strcmp(funcName, "vkCreateEvent")) - return (PFN_vkVoidFunction)vkCreateEvent; - if (!strcmp(funcName, "vkDestroyEvent")) - return (PFN_vkVoidFunction)vkDestroyEvent; - if (!strcmp(funcName, "vkGetEventStatus")) - return (PFN_vkVoidFunction)vkGetEventStatus; - if (!strcmp(funcName, "vkSetEvent")) - return (PFN_vkVoidFunction)vkSetEvent; - if (!strcmp(funcName, "vkResetEvent")) - return (PFN_vkVoidFunction)vkResetEvent; - if (!strcmp(funcName, "vkCreateQueryPool")) - return (PFN_vkVoidFunction)vkCreateQueryPool; - if (!strcmp(funcName, "vkDestroyQueryPool")) - return (PFN_vkVoidFunction)vkDestroyQueryPool; - if (!strcmp(funcName, "vkGetQueryPoolResults")) - return (PFN_vkVoidFunction)vkGetQueryPoolResults; - if (!strcmp(funcName, "vkCreateBuffer")) - return (PFN_vkVoidFunction)vkCreateBuffer; - if (!strcmp(funcName, "vkDestroyBuffer")) - return (PFN_vkVoidFunction)vkDestroyBuffer; - if (!strcmp(funcName, "vkCreateBufferView")) - return (PFN_vkVoidFunction)vkCreateBufferView; - if (!strcmp(funcName, "vkDestroyBufferView")) - return (PFN_vkVoidFunction)vkDestroyBufferView; - if (!strcmp(funcName, "vkCreateImage")) - return (PFN_vkVoidFunction)vkCreateImage; - if (!strcmp(funcName, "vkDestroyImage")) - return (PFN_vkVoidFunction)vkDestroyImage; - if (!strcmp(funcName, "vkGetImageSubresourceLayout")) - return (PFN_vkVoidFunction)vkGetImageSubresourceLayout; - if (!strcmp(funcName, "vkCreateImageView")) - return (PFN_vkVoidFunction)vkCreateImageView; - if (!strcmp(funcName, "vkDestroyImageView")) - return (PFN_vkVoidFunction)vkDestroyImageView; - if (!strcmp(funcName, "vkCreateShaderModule")) - return (PFN_vkVoidFunction)vkCreateShaderModule; - if (!strcmp(funcName, "vkDestroyShaderModule")) - return (PFN_vkVoidFunction)vkDestroyShaderModule; - if (!strcmp(funcName, "vkCreatePipelineCache")) - return (PFN_vkVoidFunction)vkCreatePipelineCache; - if (!strcmp(funcName, "vkDestroyPipelineCache")) - return (PFN_vkVoidFunction)vkDestroyPipelineCache; - if (!strcmp(funcName, "vkGetPipelineCacheData")) - return (PFN_vkVoidFunction)vkGetPipelineCacheData; - if (!strcmp(funcName, "vkMergePipelineCaches")) - return (PFN_vkVoidFunction)vkMergePipelineCaches; - if (!strcmp(funcName, "vkCreateGraphicsPipelines")) - return (PFN_vkVoidFunction)vkCreateGraphicsPipelines; - if (!strcmp(funcName, "vkCreateComputePipelines")) - return (PFN_vkVoidFunction)vkCreateComputePipelines; - if (!strcmp(funcName, "vkDestroyPipeline")) - return (PFN_vkVoidFunction)vkDestroyPipeline; - if (!strcmp(funcName, "vkCreatePipelineLayout")) - return (PFN_vkVoidFunction)vkCreatePipelineLayout; - if (!strcmp(funcName, "vkDestroyPipelineLayout")) - return (PFN_vkVoidFunction)vkDestroyPipelineLayout; - if (!strcmp(funcName, "vkCreateSampler")) - return (PFN_vkVoidFunction)vkCreateSampler; - if (!strcmp(funcName, "vkDestroySampler")) - return (PFN_vkVoidFunction)vkDestroySampler; - if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) - return (PFN_vkVoidFunction)vkCreateDescriptorSetLayout; - if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) - return (PFN_vkVoidFunction)vkDestroyDescriptorSetLayout; - if (!strcmp(funcName, "vkCreateDescriptorPool")) - return (PFN_vkVoidFunction)vkCreateDescriptorPool; - if (!strcmp(funcName, "vkDestroyDescriptorPool")) - return (PFN_vkVoidFunction)vkDestroyDescriptorPool; - if (!strcmp(funcName, "vkResetDescriptorPool")) - return (PFN_vkVoidFunction)vkResetDescriptorPool; - if (!strcmp(funcName, "vkAllocateDescriptorSets")) - return (PFN_vkVoidFunction)vkAllocateDescriptorSets; - if (!strcmp(funcName, "vkFreeDescriptorSets")) - return (PFN_vkVoidFunction)vkFreeDescriptorSets; - if (!strcmp(funcName, "vkUpdateDescriptorSets")) - return (PFN_vkVoidFunction)vkUpdateDescriptorSets; - if (!strcmp(funcName, "vkCreateFramebuffer")) - return (PFN_vkVoidFunction)vkCreateFramebuffer; - if (!strcmp(funcName, "vkDestroyFramebuffer")) - return (PFN_vkVoidFunction)vkDestroyFramebuffer; - if (!strcmp(funcName, "vkCreateRenderPass")) - return (PFN_vkVoidFunction)vkCreateRenderPass; - if (!strcmp(funcName, "vkDestroyRenderPass")) - return (PFN_vkVoidFunction)vkDestroyRenderPass; - if (!strcmp(funcName, "vkGetRenderAreaGranularity")) - return (PFN_vkVoidFunction)vkGetRenderAreaGranularity; - if (!strcmp(funcName, "vkCreateCommandPool")) - return (PFN_vkVoidFunction)vkCreateCommandPool; - if (!strcmp(funcName, "vkDestroyCommandPool")) - return (PFN_vkVoidFunction)vkDestroyCommandPool; - if (!strcmp(funcName, "vkResetCommandPool")) - return (PFN_vkVoidFunction)vkResetCommandPool; - if (!strcmp(funcName, "vkAllocateCommandBuffers")) - return (PFN_vkVoidFunction)vkAllocateCommandBuffers; - if (!strcmp(funcName, "vkFreeCommandBuffers")) - return (PFN_vkVoidFunction)vkFreeCommandBuffers; - if (!strcmp(funcName, "vkBeginCommandBuffer")) - return (PFN_vkVoidFunction)vkBeginCommandBuffer; - if (!strcmp(funcName, "vkEndCommandBuffer")) - return (PFN_vkVoidFunction)vkEndCommandBuffer; - if (!strcmp(funcName, "vkResetCommandBuffer")) - return (PFN_vkVoidFunction)vkResetCommandBuffer; - if (!strcmp(funcName, "vkCmdBindPipeline")) - return (PFN_vkVoidFunction)vkCmdBindPipeline; - if (!strcmp(funcName, "vkCmdBindDescriptorSets")) - return (PFN_vkVoidFunction)vkCmdBindDescriptorSets; - if (!strcmp(funcName, "vkCmdBindVertexBuffers")) - return (PFN_vkVoidFunction)vkCmdBindVertexBuffers; - if (!strcmp(funcName, "vkCmdBindIndexBuffer")) - return (PFN_vkVoidFunction)vkCmdBindIndexBuffer; - if (!strcmp(funcName, "vkCmdSetViewport")) - return (PFN_vkVoidFunction)vkCmdSetViewport; - if (!strcmp(funcName, "vkCmdSetScissor")) - return (PFN_vkVoidFunction)vkCmdSetScissor; - if (!strcmp(funcName, "vkCmdSetLineWidth")) - return (PFN_vkVoidFunction)vkCmdSetLineWidth; - if (!strcmp(funcName, "vkCmdSetDepthBias")) - return (PFN_vkVoidFunction)vkCmdSetDepthBias; - if (!strcmp(funcName, "vkCmdSetBlendConstants")) - return (PFN_vkVoidFunction)vkCmdSetBlendConstants; - if (!strcmp(funcName, "vkCmdSetDepthBounds")) - return (PFN_vkVoidFunction)vkCmdSetDepthBounds; - if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) - return (PFN_vkVoidFunction)vkCmdSetStencilCompareMask; - if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) - return (PFN_vkVoidFunction)vkCmdSetStencilWriteMask; - if (!strcmp(funcName, "vkCmdSetStencilReference")) - return (PFN_vkVoidFunction)vkCmdSetStencilReference; - if (!strcmp(funcName, "vkCmdDraw")) - return (PFN_vkVoidFunction)vkCmdDraw; - if (!strcmp(funcName, "vkCmdDrawIndexed")) - return (PFN_vkVoidFunction)vkCmdDrawIndexed; - if (!strcmp(funcName, "vkCmdDrawIndirect")) - return (PFN_vkVoidFunction)vkCmdDrawIndirect; - if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) - return (PFN_vkVoidFunction)vkCmdDrawIndexedIndirect; - if (!strcmp(funcName, "vkCmdDispatch")) - return (PFN_vkVoidFunction)vkCmdDispatch; - if (!strcmp(funcName, "vkCmdDispatchIndirect")) - return (PFN_vkVoidFunction)vkCmdDispatchIndirect; - if (!strcmp(funcName, "vkCmdCopyBuffer")) - return (PFN_vkVoidFunction)vkCmdCopyBuffer; - if (!strcmp(funcName, "vkCmdCopyImage")) - return (PFN_vkVoidFunction)vkCmdCopyImage; - if (!strcmp(funcName, "vkCmdBlitImage")) - return (PFN_vkVoidFunction)vkCmdBlitImage; - if (!strcmp(funcName, "vkCmdCopyBufferToImage")) - return (PFN_vkVoidFunction)vkCmdCopyBufferToImage; - if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) - return (PFN_vkVoidFunction)vkCmdCopyImageToBuffer; - if (!strcmp(funcName, "vkCmdUpdateBuffer")) - return (PFN_vkVoidFunction)vkCmdUpdateBuffer; - if (!strcmp(funcName, "vkCmdFillBuffer")) - return (PFN_vkVoidFunction)vkCmdFillBuffer; - if (!strcmp(funcName, "vkCmdClearColorImage")) - return (PFN_vkVoidFunction)vkCmdClearColorImage; - if (!strcmp(funcName, "vkCmdClearDepthStencilImage")) - return (PFN_vkVoidFunction)vkCmdClearDepthStencilImage; - if (!strcmp(funcName, "vkCmdClearAttachments")) - return (PFN_vkVoidFunction)vkCmdClearAttachments; - if (!strcmp(funcName, "vkCmdResolveImage")) - return (PFN_vkVoidFunction)vkCmdResolveImage; - if (!strcmp(funcName, "vkCmdSetEvent")) - return (PFN_vkVoidFunction)vkCmdSetEvent; - if (!strcmp(funcName, "vkCmdResetEvent")) - return (PFN_vkVoidFunction)vkCmdResetEvent; - if (!strcmp(funcName, "vkCmdWaitEvents")) - return (PFN_vkVoidFunction)vkCmdWaitEvents; - if (!strcmp(funcName, "vkCmdPipelineBarrier")) - return (PFN_vkVoidFunction)vkCmdPipelineBarrier; - if (!strcmp(funcName, "vkCmdBeginQuery")) - return (PFN_vkVoidFunction)vkCmdBeginQuery; - if (!strcmp(funcName, "vkCmdEndQuery")) - return (PFN_vkVoidFunction)vkCmdEndQuery; - if (!strcmp(funcName, "vkCmdResetQueryPool")) - return (PFN_vkVoidFunction)vkCmdResetQueryPool; - if (!strcmp(funcName, "vkCmdWriteTimestamp")) - return (PFN_vkVoidFunction)vkCmdWriteTimestamp; - if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) - return (PFN_vkVoidFunction)vkCmdCopyQueryPoolResults; - if (!strcmp(funcName, "vkCmdPushConstants")) - return (PFN_vkVoidFunction)vkCmdPushConstants; - if (!strcmp(funcName, "vkCmdBeginRenderPass")) - return (PFN_vkVoidFunction)vkCmdBeginRenderPass; - if (!strcmp(funcName, "vkCmdNextSubpass")) - return (PFN_vkVoidFunction)vkCmdNextSubpass; - if (!strcmp(funcName, "vkCmdEndRenderPass")) - return (PFN_vkVoidFunction)vkCmdEndRenderPass; - if (!strcmp(funcName, "vkCmdExecuteCommands")) - return (PFN_vkVoidFunction)vkCmdExecuteCommands; + if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties")) return (PFN_vkVoidFunction)vkGetPhysicalDeviceMemoryProperties; + if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) return (PFN_vkVoidFunction)vkEnumerateDeviceLayerProperties; + if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) return (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties; + if (!strcmp(funcName, "vkCreateDevice")) return (PFN_vkVoidFunction)vkCreateDevice; + if (!strcmp(funcName, "vkGetDeviceProcAddr")) return (PFN_vkVoidFunction)vkGetDeviceProcAddr; + if (!strcmp(funcName, "vkDestroyDevice")) return (PFN_vkVoidFunction)vkDestroyDevice; + if (!strcmp(funcName, "vkGetDeviceQueue")) return (PFN_vkVoidFunction)vkGetDeviceQueue; + if (!strcmp(funcName, "vkQueueSubmit")) return (PFN_vkVoidFunction)vkQueueSubmit; + if (!strcmp(funcName, "vkQueueWaitIdle")) return (PFN_vkVoidFunction)vkQueueWaitIdle; + if (!strcmp(funcName, "vkDeviceWaitIdle")) return (PFN_vkVoidFunction)vkDeviceWaitIdle; + if (!strcmp(funcName, "vkAllocateMemory")) return (PFN_vkVoidFunction)vkAllocateMemory; + if (!strcmp(funcName, "vkFreeMemory")) return (PFN_vkVoidFunction)vkFreeMemory; + if (!strcmp(funcName, "vkMapMemory")) return (PFN_vkVoidFunction)vkMapMemory; + if (!strcmp(funcName, "vkUnmapMemory")) return (PFN_vkVoidFunction)vkUnmapMemory; + if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) return (PFN_vkVoidFunction)vkFlushMappedMemoryRanges; + if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) return (PFN_vkVoidFunction)vkInvalidateMappedMemoryRanges; + if (!strcmp(funcName, "vkGetDeviceMemoryCommitment")) return (PFN_vkVoidFunction)vkGetDeviceMemoryCommitment; + if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements")) return (PFN_vkVoidFunction)vkGetImageSparseMemoryRequirements; + if (!strcmp(funcName, "vkGetImageMemoryRequirements")) return (PFN_vkVoidFunction)vkGetImageMemoryRequirements; + if (!strcmp(funcName, "vkGetBufferMemoryRequirements")) return (PFN_vkVoidFunction)vkGetBufferMemoryRequirements; + if (!strcmp(funcName, "vkBindImageMemory")) return (PFN_vkVoidFunction)vkBindImageMemory; + if (!strcmp(funcName, "vkBindBufferMemory")) return (PFN_vkVoidFunction)vkBindBufferMemory; + if (!strcmp(funcName, "vkQueueBindSparse")) return (PFN_vkVoidFunction)vkQueueBindSparse; + if (!strcmp(funcName, "vkCreateFence")) return (PFN_vkVoidFunction)vkCreateFence; + if (!strcmp(funcName, "vkDestroyFence")) return (PFN_vkVoidFunction)vkDestroyFence; + if (!strcmp(funcName, "vkGetFenceStatus")) return (PFN_vkVoidFunction)vkGetFenceStatus; + if (!strcmp(funcName, "vkResetFences")) return (PFN_vkVoidFunction)vkResetFences; + if (!strcmp(funcName, "vkWaitForFences")) return (PFN_vkVoidFunction)vkWaitForFences; + if (!strcmp(funcName, "vkCreateSemaphore")) return (PFN_vkVoidFunction)vkCreateSemaphore; + if (!strcmp(funcName, "vkDestroySemaphore")) return (PFN_vkVoidFunction)vkDestroySemaphore; + if (!strcmp(funcName, "vkCreateEvent")) return (PFN_vkVoidFunction)vkCreateEvent; + if (!strcmp(funcName, "vkDestroyEvent")) return (PFN_vkVoidFunction)vkDestroyEvent; + if (!strcmp(funcName, "vkGetEventStatus")) return (PFN_vkVoidFunction)vkGetEventStatus; + if (!strcmp(funcName, "vkSetEvent")) return (PFN_vkVoidFunction)vkSetEvent; + if (!strcmp(funcName, "vkResetEvent")) return (PFN_vkVoidFunction)vkResetEvent; + if (!strcmp(funcName, "vkCreateQueryPool")) return (PFN_vkVoidFunction)vkCreateQueryPool; + if (!strcmp(funcName, "vkDestroyQueryPool")) return (PFN_vkVoidFunction)vkDestroyQueryPool; + if (!strcmp(funcName, "vkGetQueryPoolResults")) return (PFN_vkVoidFunction)vkGetQueryPoolResults; + if (!strcmp(funcName, "vkCreateBuffer")) return (PFN_vkVoidFunction)vkCreateBuffer; + if (!strcmp(funcName, "vkDestroyBuffer")) return (PFN_vkVoidFunction)vkDestroyBuffer; + if (!strcmp(funcName, "vkCreateBufferView")) return (PFN_vkVoidFunction)vkCreateBufferView; + if (!strcmp(funcName, "vkDestroyBufferView")) return (PFN_vkVoidFunction)vkDestroyBufferView; + if (!strcmp(funcName, "vkCreateImage")) return (PFN_vkVoidFunction)vkCreateImage; + if (!strcmp(funcName, "vkDestroyImage")) return (PFN_vkVoidFunction)vkDestroyImage; + if (!strcmp(funcName, "vkGetImageSubresourceLayout")) return (PFN_vkVoidFunction)vkGetImageSubresourceLayout; + if (!strcmp(funcName, "vkCreateImageView")) return (PFN_vkVoidFunction)vkCreateImageView; + if (!strcmp(funcName, "vkDestroyImageView")) return (PFN_vkVoidFunction)vkDestroyImageView; + if (!strcmp(funcName, "vkCreateShaderModule")) return (PFN_vkVoidFunction)vkCreateShaderModule; + if (!strcmp(funcName, "vkDestroyShaderModule")) return (PFN_vkVoidFunction)vkDestroyShaderModule; + if (!strcmp(funcName, "vkCreatePipelineCache")) return (PFN_vkVoidFunction)vkCreatePipelineCache; + if (!strcmp(funcName, "vkDestroyPipelineCache")) return (PFN_vkVoidFunction)vkDestroyPipelineCache; + if (!strcmp(funcName, "vkGetPipelineCacheData")) return (PFN_vkVoidFunction)vkGetPipelineCacheData; + if (!strcmp(funcName, "vkMergePipelineCaches")) return (PFN_vkVoidFunction)vkMergePipelineCaches; + if (!strcmp(funcName, "vkCreateGraphicsPipelines")) return (PFN_vkVoidFunction)vkCreateGraphicsPipelines; + if (!strcmp(funcName, "vkCreateComputePipelines")) return (PFN_vkVoidFunction)vkCreateComputePipelines; + if (!strcmp(funcName, "vkDestroyPipeline")) return (PFN_vkVoidFunction)vkDestroyPipeline; + if (!strcmp(funcName, "vkCreatePipelineLayout")) return (PFN_vkVoidFunction)vkCreatePipelineLayout; + if (!strcmp(funcName, "vkDestroyPipelineLayout")) return (PFN_vkVoidFunction)vkDestroyPipelineLayout; + if (!strcmp(funcName, "vkCreateSampler")) return (PFN_vkVoidFunction)vkCreateSampler; + if (!strcmp(funcName, "vkDestroySampler")) return (PFN_vkVoidFunction)vkDestroySampler; + if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) return (PFN_vkVoidFunction)vkCreateDescriptorSetLayout; + if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) return (PFN_vkVoidFunction)vkDestroyDescriptorSetLayout; + if (!strcmp(funcName, "vkCreateDescriptorPool")) return (PFN_vkVoidFunction)vkCreateDescriptorPool; + if (!strcmp(funcName, "vkDestroyDescriptorPool")) return (PFN_vkVoidFunction)vkDestroyDescriptorPool; + if (!strcmp(funcName, "vkResetDescriptorPool")) return (PFN_vkVoidFunction)vkResetDescriptorPool; + if (!strcmp(funcName, "vkAllocateDescriptorSets")) return (PFN_vkVoidFunction)vkAllocateDescriptorSets; + if (!strcmp(funcName, "vkFreeDescriptorSets")) return (PFN_vkVoidFunction)vkFreeDescriptorSets; + if (!strcmp(funcName, "vkUpdateDescriptorSets")) return (PFN_vkVoidFunction)vkUpdateDescriptorSets; + if (!strcmp(funcName, "vkCreateFramebuffer")) return (PFN_vkVoidFunction)vkCreateFramebuffer; + if (!strcmp(funcName, "vkDestroyFramebuffer")) return (PFN_vkVoidFunction)vkDestroyFramebuffer; + if (!strcmp(funcName, "vkCreateRenderPass")) return (PFN_vkVoidFunction)vkCreateRenderPass; + if (!strcmp(funcName, "vkDestroyRenderPass")) return (PFN_vkVoidFunction)vkDestroyRenderPass; + if (!strcmp(funcName, "vkGetRenderAreaGranularity")) return (PFN_vkVoidFunction)vkGetRenderAreaGranularity; + if (!strcmp(funcName, "vkCreateCommandPool")) return (PFN_vkVoidFunction)vkCreateCommandPool; + if (!strcmp(funcName, "vkDestroyCommandPool")) return (PFN_vkVoidFunction)vkDestroyCommandPool; + if (!strcmp(funcName, "vkResetCommandPool")) return (PFN_vkVoidFunction)vkResetCommandPool; + if (!strcmp(funcName, "vkAllocateCommandBuffers")) return (PFN_vkVoidFunction)vkAllocateCommandBuffers; + if (!strcmp(funcName, "vkFreeCommandBuffers")) return (PFN_vkVoidFunction)vkFreeCommandBuffers; + if (!strcmp(funcName, "vkBeginCommandBuffer")) return (PFN_vkVoidFunction)vkBeginCommandBuffer; + if (!strcmp(funcName, "vkEndCommandBuffer")) return (PFN_vkVoidFunction)vkEndCommandBuffer; + if (!strcmp(funcName, "vkResetCommandBuffer")) return (PFN_vkVoidFunction)vkResetCommandBuffer; + if (!strcmp(funcName, "vkCmdBindPipeline")) return (PFN_vkVoidFunction)vkCmdBindPipeline; + if (!strcmp(funcName, "vkCmdBindDescriptorSets")) return (PFN_vkVoidFunction)vkCmdBindDescriptorSets; + if (!strcmp(funcName, "vkCmdBindVertexBuffers")) return (PFN_vkVoidFunction)vkCmdBindVertexBuffers; + if (!strcmp(funcName, "vkCmdBindIndexBuffer")) return (PFN_vkVoidFunction)vkCmdBindIndexBuffer; + if (!strcmp(funcName, "vkCmdSetViewport")) return (PFN_vkVoidFunction)vkCmdSetViewport; + if (!strcmp(funcName, "vkCmdSetScissor")) return (PFN_vkVoidFunction)vkCmdSetScissor; + if (!strcmp(funcName, "vkCmdSetLineWidth")) return (PFN_vkVoidFunction)vkCmdSetLineWidth; + if (!strcmp(funcName, "vkCmdSetDepthBias")) return (PFN_vkVoidFunction)vkCmdSetDepthBias; + if (!strcmp(funcName, "vkCmdSetBlendConstants")) return (PFN_vkVoidFunction)vkCmdSetBlendConstants; + if (!strcmp(funcName, "vkCmdSetDepthBounds")) return (PFN_vkVoidFunction)vkCmdSetDepthBounds; + if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) return (PFN_vkVoidFunction)vkCmdSetStencilCompareMask; + if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) return (PFN_vkVoidFunction)vkCmdSetStencilWriteMask; + if (!strcmp(funcName, "vkCmdSetStencilReference")) return (PFN_vkVoidFunction)vkCmdSetStencilReference; + if (!strcmp(funcName, "vkCmdDraw")) return (PFN_vkVoidFunction)vkCmdDraw; + if (!strcmp(funcName, "vkCmdDrawIndexed")) return (PFN_vkVoidFunction)vkCmdDrawIndexed; + if (!strcmp(funcName, "vkCmdDrawIndirect")) return (PFN_vkVoidFunction)vkCmdDrawIndirect; + if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) return (PFN_vkVoidFunction)vkCmdDrawIndexedIndirect; + if (!strcmp(funcName, "vkCmdDispatch")) return (PFN_vkVoidFunction)vkCmdDispatch; + if (!strcmp(funcName, "vkCmdDispatchIndirect")) return (PFN_vkVoidFunction)vkCmdDispatchIndirect; + if (!strcmp(funcName, "vkCmdCopyBuffer")) return (PFN_vkVoidFunction)vkCmdCopyBuffer; + if (!strcmp(funcName, "vkCmdCopyImage")) return (PFN_vkVoidFunction)vkCmdCopyImage; + if (!strcmp(funcName, "vkCmdBlitImage")) return (PFN_vkVoidFunction)vkCmdBlitImage; + if (!strcmp(funcName, "vkCmdCopyBufferToImage")) return (PFN_vkVoidFunction)vkCmdCopyBufferToImage; + if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) return (PFN_vkVoidFunction)vkCmdCopyImageToBuffer; + if (!strcmp(funcName, "vkCmdUpdateBuffer")) return (PFN_vkVoidFunction)vkCmdUpdateBuffer; + if (!strcmp(funcName, "vkCmdFillBuffer")) return (PFN_vkVoidFunction)vkCmdFillBuffer; + if (!strcmp(funcName, "vkCmdClearColorImage")) return (PFN_vkVoidFunction)vkCmdClearColorImage; + if (!strcmp(funcName, "vkCmdClearDepthStencilImage")) return (PFN_vkVoidFunction)vkCmdClearDepthStencilImage; + if (!strcmp(funcName, "vkCmdClearAttachments")) return (PFN_vkVoidFunction)vkCmdClearAttachments; + if (!strcmp(funcName, "vkCmdResolveImage")) return (PFN_vkVoidFunction)vkCmdResolveImage; + if (!strcmp(funcName, "vkCmdSetEvent")) return (PFN_vkVoidFunction)vkCmdSetEvent; + if (!strcmp(funcName, "vkCmdResetEvent")) return (PFN_vkVoidFunction)vkCmdResetEvent; + if (!strcmp(funcName, "vkCmdWaitEvents")) return (PFN_vkVoidFunction)vkCmdWaitEvents; + if (!strcmp(funcName, "vkCmdPipelineBarrier")) return (PFN_vkVoidFunction)vkCmdPipelineBarrier; + if (!strcmp(funcName, "vkCmdBeginQuery")) return (PFN_vkVoidFunction)vkCmdBeginQuery; + if (!strcmp(funcName, "vkCmdEndQuery")) return (PFN_vkVoidFunction)vkCmdEndQuery; + if (!strcmp(funcName, "vkCmdResetQueryPool")) return (PFN_vkVoidFunction)vkCmdResetQueryPool; + if (!strcmp(funcName, "vkCmdWriteTimestamp")) return (PFN_vkVoidFunction)vkCmdWriteTimestamp; + if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) return (PFN_vkVoidFunction)vkCmdCopyQueryPoolResults; + if (!strcmp(funcName, "vkCmdPushConstants")) return (PFN_vkVoidFunction)vkCmdPushConstants; + if (!strcmp(funcName, "vkCmdBeginRenderPass")) return (PFN_vkVoidFunction)vkCmdBeginRenderPass; + if (!strcmp(funcName, "vkCmdNextSubpass")) return (PFN_vkVoidFunction)vkCmdNextSubpass; + if (!strcmp(funcName, "vkCmdEndRenderPass")) return (PFN_vkVoidFunction)vkCmdEndRenderPass; + if (!strcmp(funcName, "vkCmdExecuteCommands")) return (PFN_vkVoidFunction)vkCmdExecuteCommands; // Instance extensions void *addr; - if (debug_report_instance_gpa(inst, funcName, &addr)) - return addr; + if (debug_report_instance_gpa(inst, funcName, &addr)) return addr; - if (wsi_swapchain_instance_gpa(inst, funcName, &addr)) - return addr; + if (wsi_swapchain_instance_gpa(inst, funcName, &addr)) return addr; - if (extension_instance_gpa(inst, funcName, &addr)) - return addr; + if (extension_instance_gpa(inst, funcName, &addr)) return addr; // Unknown physical device extensions - if (loader_phys_dev_ext_gpa(inst, funcName, true, &addr, NULL)) - return addr; + if (loader_phys_dev_ext_gpa(inst, funcName, true, &addr, NULL)) return addr; // Unknown device extensions addr = loader_dev_ext_gpa(inst, funcName); @@ -318,34 +180,25 @@ static inline void *trampolineGetProcAddr(struct loader_instance *inst, } static inline void *globalGetProcAddr(const char *name) { - if (!name || name[0] != 'v' || name[1] != 'k') - return NULL; + if (!name || name[0] != 'v' || name[1] != 'k') return NULL; name += 2; - if (!strcmp(name, "CreateInstance")) - return (void *)vkCreateInstance; - if (!strcmp(name, "EnumerateInstanceExtensionProperties")) - return (void *)vkEnumerateInstanceExtensionProperties; - if (!strcmp(name, "EnumerateInstanceLayerProperties")) - return (void *)vkEnumerateInstanceLayerProperties; + if (!strcmp(name, "CreateInstance")) return (void *)vkCreateInstance; + if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return (void *)vkEnumerateInstanceExtensionProperties; + if (!strcmp(name, "EnumerateInstanceLayerProperties")) return (void *)vkEnumerateInstanceLayerProperties; return NULL; } static inline void *loader_non_passthrough_gdpa(const char *name) { - if (!name || name[0] != 'v' || name[1] != 'k') - return NULL; + if (!name || name[0] != 'v' || name[1] != 'k') return NULL; name += 2; - if (!strcmp(name, "GetDeviceProcAddr")) - return (void *)vkGetDeviceProcAddr; - if (!strcmp(name, "DestroyDevice")) - return (void *)vkDestroyDevice; - if (!strcmp(name, "GetDeviceQueue")) - return (void *)vkGetDeviceQueue; - if (!strcmp(name, "AllocateCommandBuffers")) - return (void *)vkAllocateCommandBuffers; + if (!strcmp(name, "GetDeviceProcAddr")) return (void *)vkGetDeviceProcAddr; + if (!strcmp(name, "DestroyDevice")) return (void *)vkDestroyDevice; + if (!strcmp(name, "GetDeviceQueue")) return (void *)vkGetDeviceQueue; + if (!strcmp(name, "AllocateCommandBuffers")) return (void *)vkAllocateCommandBuffers; return NULL; } diff --git a/third_party/vulkan/loader/loader.c b/third_party/vulkan/loader/loader.c index 24758f4a8..a32ae372b 100644 --- a/third_party/vulkan/loader/loader.c +++ b/third_party/vulkan/loader/loader.c @@ -30,29 +30,32 @@ #include #include #include +#include #include #if defined(_WIN32) #include "dirent_on_windows.h" -#else // _WIN32 +#else // _WIN32 #include -#endif // _WIN32 +#endif // _WIN32 #include "vk_loader_platform.h" #include "loader.h" #include "gpa_helper.h" -#include "table_ops.h" #include "debug_report.h" #include "wsi.h" -#include "extensions.h" #include "vulkan/vk_icd.h" #include "cJSON.h" #include "murmurhash.h" -#if defined(__GNUC__) -#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 17)) -#define secure_getenv __secure_getenv -#endif -#endif +// This is a CMake generated file with #defines for any functions/includes +// that it found present. This is currently necessary to properly determine +// if secure_getenv or __secure_getenv are present +#if !defined(VULKAN_NON_CMAKE_BUILD) +#include "loader_cmake_config.h" +#endif // !defined(VULKAN_NON_CMAKE_BUILD) + +// Generated file containing all the extension data +#include "vk_loader_extensions.c" struct loader_struct loader = {0}; // TLS for instance for alloc/free callbacks @@ -75,7 +78,7 @@ enum loader_debug { }; uint32_t g_loader_debug = 0; -uint32_t g_loader_log_msgs = 0; +uint32_t g_loader_log_msgs = 0x0E; // thread safety lock for accessing global data structures such as "loader" // all entrypoints on the instance chain need to be locked except GPA @@ -85,171 +88,17 @@ loader_platform_thread_mutex loader_json_lock; const char *std_validation_str = "VK_LAYER_LUNARG_standard_validation"; -// This table contains the loader's instance dispatch table, which contains -// default functions if no instance layers are activated. This contains -// pointers to "terminator functions". -const VkLayerInstanceDispatchTable instance_disp = { - .GetInstanceProcAddr = vkGetInstanceProcAddr, - .DestroyInstance = terminator_DestroyInstance, - .EnumeratePhysicalDevices = terminator_EnumeratePhysicalDevices, - .GetPhysicalDeviceFeatures = terminator_GetPhysicalDeviceFeatures, - .GetPhysicalDeviceFormatProperties = - terminator_GetPhysicalDeviceFormatProperties, - .GetPhysicalDeviceImageFormatProperties = - terminator_GetPhysicalDeviceImageFormatProperties, - .GetPhysicalDeviceProperties = terminator_GetPhysicalDeviceProperties, - .GetPhysicalDeviceQueueFamilyProperties = - terminator_GetPhysicalDeviceQueueFamilyProperties, - .GetPhysicalDeviceMemoryProperties = - terminator_GetPhysicalDeviceMemoryProperties, - .EnumerateDeviceExtensionProperties = - terminator_EnumerateDeviceExtensionProperties, - .EnumerateDeviceLayerProperties = terminator_EnumerateDeviceLayerProperties, - .GetPhysicalDeviceSparseImageFormatProperties = - terminator_GetPhysicalDeviceSparseImageFormatProperties, - .DestroySurfaceKHR = terminator_DestroySurfaceKHR, - .GetPhysicalDeviceSurfaceSupportKHR = - terminator_GetPhysicalDeviceSurfaceSupportKHR, - .GetPhysicalDeviceSurfaceCapabilitiesKHR = - terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR, - .GetPhysicalDeviceSurfaceFormatsKHR = - terminator_GetPhysicalDeviceSurfaceFormatsKHR, - .GetPhysicalDeviceSurfacePresentModesKHR = - terminator_GetPhysicalDeviceSurfacePresentModesKHR, -#ifdef VK_USE_PLATFORM_MIR_KHR - .CreateMirSurfaceKHR = terminator_CreateMirSurfaceKHR, - .GetPhysicalDeviceMirPresentationSupportKHR = - terminator_GetPhysicalDeviceMirPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - .CreateWaylandSurfaceKHR = terminator_CreateWaylandSurfaceKHR, - .GetPhysicalDeviceWaylandPresentationSupportKHR = - terminator_GetPhysicalDeviceWaylandPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - .CreateWin32SurfaceKHR = terminator_CreateWin32SurfaceKHR, - .GetPhysicalDeviceWin32PresentationSupportKHR = - terminator_GetPhysicalDeviceWin32PresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - .CreateXcbSurfaceKHR = terminator_CreateXcbSurfaceKHR, - .GetPhysicalDeviceXcbPresentationSupportKHR = - terminator_GetPhysicalDeviceXcbPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - .CreateXlibSurfaceKHR = terminator_CreateXlibSurfaceKHR, - .GetPhysicalDeviceXlibPresentationSupportKHR = - terminator_GetPhysicalDeviceXlibPresentationSupportKHR, -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - .CreateAndroidSurfaceKHR = terminator_CreateAndroidSurfaceKHR, -#endif - .GetPhysicalDeviceDisplayPropertiesKHR = - terminator_GetPhysicalDeviceDisplayPropertiesKHR, - .GetPhysicalDeviceDisplayPlanePropertiesKHR = - terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR, - .GetDisplayPlaneSupportedDisplaysKHR = - terminator_GetDisplayPlaneSupportedDisplaysKHR, - .GetDisplayModePropertiesKHR = terminator_GetDisplayModePropertiesKHR, - .CreateDisplayModeKHR = terminator_CreateDisplayModeKHR, - .GetDisplayPlaneCapabilitiesKHR = terminator_GetDisplayPlaneCapabilitiesKHR, - .CreateDisplayPlaneSurfaceKHR = terminator_CreateDisplayPlaneSurfaceKHR, - - // KHR_get_physical_device_properties2 - .GetPhysicalDeviceFeatures2KHR = terminator_GetPhysicalDeviceFeatures2KHR, - .GetPhysicalDeviceProperties2KHR = - terminator_GetPhysicalDeviceProperties2KHR, - .GetPhysicalDeviceFormatProperties2KHR = - terminator_GetPhysicalDeviceFormatProperties2KHR, - .GetPhysicalDeviceImageFormatProperties2KHR = - terminator_GetPhysicalDeviceImageFormatProperties2KHR, - .GetPhysicalDeviceQueueFamilyProperties2KHR = - terminator_GetPhysicalDeviceQueueFamilyProperties2KHR, - .GetPhysicalDeviceMemoryProperties2KHR = - terminator_GetPhysicalDeviceMemoryProperties2KHR, - .GetPhysicalDeviceSparseImageFormatProperties2KHR = - terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR, - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - .AcquireXlibDisplayEXT = terminator_AcquireXlibDisplayEXT, - .GetRandROutputDisplayEXT = terminator_GetRandROutputDisplayEXT, -#endif - - // EXT_debug_report - .CreateDebugReportCallbackEXT = terminator_CreateDebugReportCallback, - .DestroyDebugReportCallbackEXT = terminator_DestroyDebugReportCallback, - .DebugReportMessageEXT = terminator_DebugReportMessage, - - // EXT_direct_mode_display - .ReleaseDisplayEXT = terminator_ReleaseDisplayEXT, - - // EXT_display_surface_counter - .GetPhysicalDeviceSurfaceCapabilities2EXT = - terminator_GetPhysicalDeviceSurfaceCapabilities2EXT, - - // NV_external_memory_capabilities - .GetPhysicalDeviceExternalImageFormatPropertiesNV = - terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV, - - // NVX_device_generated_commands - .GetPhysicalDeviceGeneratedCommandsPropertiesNVX = - terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX, -}; - -// A null-terminated list of all of the instance extensions supported by the -// loader -static const char *const LOADER_INSTANCE_EXTENSIONS[] = { - VK_KHR_SURFACE_EXTENSION_NAME, - VK_KHR_DISPLAY_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_XLIB_KHR - VK_KHR_XLIB_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - VK_KHR_XCB_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - VK_KHR_MIR_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - VK_KHR_WIN32_SURFACE_EXTENSION_NAME, -#endif - VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME, -#endif - VK_EXT_DEBUG_REPORT_EXTENSION_NAME, - VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, - VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, - VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME, -#ifdef VK_USE_PLATFORM_VI_NN - VK_NN_VI_SURFACE_EXTENSION_NAME, -#endif - VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, - NULL}; - LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init); -void *loader_instance_heap_alloc(const struct loader_instance *instance, - size_t size, - VkSystemAllocationScope alloc_scope) { +void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) { void *pMemory = NULL; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (instance && instance->alloc_callbacks.pfnAllocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ - pMemory = instance->alloc_callbacks.pfnAllocation( - instance->alloc_callbacks.pUserData, size, sizeof(uint64_t), - alloc_scope); + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. + pMemory = instance->alloc_callbacks.pfnAllocation(instance->alloc_callbacks.pUserData, size, sizeof(uint64_t), alloc_scope); } else { #endif pMemory = malloc(size); @@ -257,15 +106,13 @@ void *loader_instance_heap_alloc(const struct loader_instance *instance, return pMemory; } -void loader_instance_heap_free(const struct loader_instance *instance, - void *pMemory) { +void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory) { if (pMemory != NULL) { #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (instance && instance->alloc_callbacks.pfnFree) { - instance->alloc_callbacks.pfnFree( - instance->alloc_callbacks.pUserData, pMemory); + instance->alloc_callbacks.pfnFree(instance->alloc_callbacks.pUserData, pMemory); } else { #endif free(pMemory); @@ -273,8 +120,7 @@ void loader_instance_heap_free(const struct loader_instance *instance, } } -void *loader_instance_heap_realloc(const struct loader_instance *instance, - void *pMemory, size_t orig_size, size_t size, +void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size, VkSystemAllocationScope alloc_scope) { void *pNewMem = NULL; if (pMemory == NULL || orig_size == 0) { @@ -284,12 +130,10 @@ void *loader_instance_heap_realloc(const struct loader_instance *instance, #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) #else } else if (instance && instance->alloc_callbacks.pfnReallocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ - pNewMem = instance->alloc_callbacks.pfnReallocation( - instance->alloc_callbacks.pUserData, pMemory, size, - sizeof(uint64_t), alloc_scope); + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. + pNewMem = instance->alloc_callbacks.pfnReallocation(instance->alloc_callbacks.pUserData, pMemory, size, sizeof(uint64_t), + alloc_scope); #endif } else { pNewMem = realloc(pMemory, size); @@ -298,27 +142,20 @@ void *loader_instance_heap_realloc(const struct loader_instance *instance, } void *loader_instance_tls_heap_alloc(size_t size) { - return loader_instance_heap_alloc(tls_instance, size, - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + return loader_instance_heap_alloc(tls_instance, size, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); } -void loader_instance_tls_heap_free(void *pMemory) { - loader_instance_heap_free(tls_instance, pMemory); -} +void loader_instance_tls_heap_free(void *pMemory) { loader_instance_heap_free(tls_instance, pMemory); } -void *loader_device_heap_alloc(const struct loader_device *device, size_t size, - VkSystemAllocationScope alloc_scope) { +void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope alloc_scope) { void *pMemory = NULL; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (device && device->alloc_callbacks.pfnAllocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ - pMemory = device->alloc_callbacks.pfnAllocation( - device->alloc_callbacks.pUserData, size, sizeof(uint64_t), - alloc_scope); + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. + pMemory = device->alloc_callbacks.pfnAllocation(device->alloc_callbacks.pUserData, size, sizeof(uint64_t), alloc_scope); } else { #endif pMemory = malloc(size); @@ -326,15 +163,13 @@ void *loader_device_heap_alloc(const struct loader_device *device, size_t size, return pMemory; } -void loader_device_heap_free(const struct loader_device *device, - void *pMemory) { +void loader_device_heap_free(const struct loader_device *device, void *pMemory) { if (pMemory != NULL) { #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (device && device->alloc_callbacks.pfnFree) { - device->alloc_callbacks.pfnFree(device->alloc_callbacks.pUserData, - pMemory); + device->alloc_callbacks.pfnFree(device->alloc_callbacks.pUserData, pMemory); } else { #endif free(pMemory); @@ -342,8 +177,7 @@ void loader_device_heap_free(const struct loader_device *device, } } -void *loader_device_heap_realloc(const struct loader_device *device, - void *pMemory, size_t orig_size, size_t size, +void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size, VkSystemAllocationScope alloc_scope) { void *pNewMem = NULL; if (pMemory == NULL || orig_size == 0) { @@ -353,12 +187,10 @@ void *loader_device_heap_realloc(const struct loader_device *device, #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) #else } else if (device && device->alloc_callbacks.pfnReallocation) { - /* These are internal structures, so it's best to align everything to - * the largest unit size which is the size of a uint64_t. - */ - pNewMem = device->alloc_callbacks.pfnReallocation( - device->alloc_callbacks.pUserData, pMemory, size, sizeof(uint64_t), - alloc_scope); + // These are internal structures, so it's best to align everything to + // the largest unit size which is the size of a uint64_t. + pNewMem = device->alloc_callbacks.pfnReallocation(device->alloc_callbacks.pUserData, pMemory, size, sizeof(uint64_t), + alloc_scope); #endif } else { pNewMem = realloc(pMemory, size); @@ -369,15 +201,31 @@ void *loader_device_heap_realloc(const struct loader_device *device, // Environment variables #if defined(__linux__) -static inline char *loader_getenv(const char *name, - const struct loader_instance *inst) { +static inline char *loader_getenv(const char *name, const struct loader_instance *inst) { // No allocation of memory necessary for Linux, but we should at least touch // the inst pointer to get rid of compiler warnings. (void)inst; return getenv(name); } -static inline void loader_free_getenv(char *val, - const struct loader_instance *inst) { + + +static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) { + // No allocation of memory necessary for Linux, but we should at least touch + // the inst pointer to get rid of compiler warnings. + (void)inst; + +#ifdef HAVE_SECURE_GETENV + return secure_getenv(name); +#elif defined(HAVE___SECURE_GETENV) + return __secure_getenv(name); +#else +#pragma message("Warning: Falling back to non-secure getenv for environmental lookups! Consider" \ + " updating to a different libc.") + return loader_getenv(name, inst); +#endif +} + +static inline void loader_free_getenv(char *val, const struct loader_instance *inst) { // No freeing of memory necessary for Linux, but we should at least touch // the val and inst pointers to get rid of compiler warnings. (void)val; @@ -386,8 +234,7 @@ static inline void loader_free_getenv(char *val, #elif defined(WIN32) -static inline char *loader_getenv(const char *name, - const struct loader_instance *inst) { +static inline char *loader_getenv(const char *name, const struct loader_instance *inst) { char *retVal; DWORD valSize; @@ -395,14 +242,12 @@ static inline char *loader_getenv(const char *name, // valSize DOES include the null terminator, so for any set variable // will always be at least 1. If it's 0, the variable wasn't set. - if (valSize == 0) - return NULL; + if (valSize == 0) return NULL; // Allocate the space necessary for the registry entry if (NULL != inst && NULL != inst->alloc_callbacks.pfnAllocation) { - retVal = (char *)inst->alloc_callbacks.pfnAllocation( - inst->alloc_callbacks.pUserData, valSize, sizeof(char *), - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + retVal = (char *)inst->alloc_callbacks.pfnAllocation(inst->alloc_callbacks.pUserData, valSize, sizeof(char *), + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); } else { retVal = (char *)malloc(valSize); } @@ -414,8 +259,12 @@ static inline char *loader_getenv(const char *name, return retVal; } -static inline void loader_free_getenv(char *val, - const struct loader_instance *inst) { +static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) { + // No secure version for Winddows as far as I know + return loader_getenv(name, inst); +} + +static inline void loader_free_getenv(char *val, const struct loader_instance *inst) { if (NULL != inst && NULL != inst->alloc_callbacks.pfnFree) { inst->alloc_callbacks.pfnFree(inst->alloc_callbacks.pUserData, val); } else { @@ -425,15 +274,13 @@ static inline void loader_free_getenv(char *val, #else -static inline char *loader_getenv(const char *name, - const struct loader_instance *inst) { +static inline char *loader_getenv(const char *name, const struct loader_instance *inst) { // stub func (void)inst; (void)name; return NULL; } -static inline void loader_free_getenv(char *val, - const struct loader_instance *inst) { +static inline void loader_free_getenv(char *val, const struct loader_instance *inst) { // stub func (void)val; (void)inst; @@ -441,8 +288,7 @@ static inline void loader_free_getenv(char *val, #endif -void loader_log(const struct loader_instance *inst, VkFlags msg_type, - int32_t msg_code, const char *format, ...) { +void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...) { char msg[512]; char cmd_line_msg[512]; uint16_t cmd_line_size = sizeof(cmd_line_msg); @@ -457,9 +303,8 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, va_end(ap); if (inst) { - util_DebugReportMessage( - inst, msg_type, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, - (uint64_t)(uintptr_t)inst, 0, msg_code, "loader", msg); + util_DebugReportMessage(inst, msg_type, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, (uint64_t)(uintptr_t)inst, 0, msg_code, + "loader", msg); } if (!(msg_type & g_loader_log_msgs)) { @@ -470,43 +315,43 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, va_start(ap, format); if ((msg_type & LOADER_INFO_BIT) != 0) { - strcat(cmd_line_msg, "INFO"); + strncat(cmd_line_msg, "INFO", cmd_line_size); cmd_line_size -= 4; } if ((msg_type & LOADER_WARN_BIT) != 0) { if (cmd_line_size != sizeof(cmd_line_msg)) { - strcat(cmd_line_msg, " | "); + strncat(cmd_line_msg, " | ", cmd_line_size); cmd_line_size -= 3; } - strcat(cmd_line_msg, "WARNING"); + strncat(cmd_line_msg, "WARNING", cmd_line_size); cmd_line_size -= 7; } if ((msg_type & LOADER_PERF_BIT) != 0) { if (cmd_line_size != sizeof(cmd_line_msg)) { - strcat(cmd_line_msg, " | "); + strncat(cmd_line_msg, " | ", cmd_line_size); cmd_line_size -= 3; } - strcat(cmd_line_msg, "PERF"); + strncat(cmd_line_msg, "PERF", cmd_line_size); cmd_line_size -= 4; } if ((msg_type & LOADER_ERROR_BIT) != 0) { if (cmd_line_size != sizeof(cmd_line_msg)) { - strcat(cmd_line_msg, " | "); + strncat(cmd_line_msg, " | ", cmd_line_size); cmd_line_size -= 3; } - strcat(cmd_line_msg, "ERROR"); + strncat(cmd_line_msg, "ERROR", cmd_line_size); cmd_line_size -= 5; } if ((msg_type & LOADER_DEBUG_BIT) != 0) { if (cmd_line_size != sizeof(cmd_line_msg)) { - strcat(cmd_line_msg, " | "); + strncat(cmd_line_msg, " | ", cmd_line_size); cmd_line_size -= 3; } - strcat(cmd_line_msg, "DEBUG"); + strncat(cmd_line_msg, "DEBUG", cmd_line_size); cmd_line_size -= 5; } if (cmd_line_size != sizeof(cmd_line_msg)) { - strcat(cmd_line_msg, ": "); + strncat(cmd_line_msg, ": ", cmd_line_size); cmd_line_size -= 2; } strncat(cmd_line_msg, msg, cmd_line_size); @@ -519,9 +364,7 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, fputc('\n', stderr); } -VKAPI_ATTR VkResult VKAPI_CALL vkSetInstanceDispatch(VkInstance instance, - void *object) { - +VKAPI_ATTR VkResult VKAPI_CALL vkSetInstanceDispatch(VkInstance instance, void *object) { struct loader_instance *inst = loader_get_instance(instance); if (!inst) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -533,11 +376,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkSetInstanceDispatch(VkInstance instance, return VK_SUCCESS; } -VKAPI_ATTR VkResult VKAPI_CALL vkSetDeviceDispatch(VkDevice device, - void *object) { +VKAPI_ATTR VkResult VKAPI_CALL vkSetDeviceDispatch(VkDevice device, void *object) { struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, NULL); + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL); if (NULL == icd_term) { return VK_ERROR_INITIALIZATION_FAILED; @@ -562,15 +403,14 @@ static char *loader_get_next_path(char *path); // // *reg_data contains a string list of filenames as pointer. // When done using the returned string list, the caller should free the pointer. -VkResult loaderGetRegistryFiles(const struct loader_instance *inst, - char *location, char **reg_data) { +VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *location, bool use_secondary_hive, char **reg_data) { LONG rtn_value; - HKEY hive, key; + HKEY hive = DEFAULT_VK_REGISTRY_HIVE, key; DWORD access_flags; char name[2048]; char *loc = location; char *next; - DWORD idx = 0; + DWORD idx; DWORD name_size = sizeof(name); DWORD value; DWORD total_size = 4096; @@ -585,57 +425,59 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, while (*loc) { next = loader_get_next_path(loc); - hive = DEFAULT_VK_REGISTRY_HIVE; access_flags = KEY_QUERY_VALUE; rtn_value = RegOpenKeyEx(hive, loc, 0, access_flags, &key); - if (ERROR_SUCCESS != rtn_value) { - // We still couldn't find the key, so give up: - loc = next; - continue; + if (ERROR_SUCCESS == rtn_value) { + idx = 0; + while ((rtn_value = RegEnumValue(key, idx++, name, &name_size, NULL, NULL, (LPBYTE)&value, &value_size)) == + ERROR_SUCCESS) { + if (value_size == sizeof(value) && value == 0) { + if (NULL == *reg_data) { + *reg_data = loader_instance_heap_alloc(inst, total_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == *reg_data) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loaderGetRegistryFiles: Failed to allocate " + "space for registry data for key %s", + name); + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + *reg_data[0] = '\0'; + } else if (strlen(*reg_data) + name_size + 1 > total_size) { + *reg_data = loader_instance_heap_realloc(inst, *reg_data, total_size, total_size * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == *reg_data) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loaderGetRegistryFiles: Failed to reallocate " + "space for registry value of size %d for key %s", + total_size * 2, name); + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + total_size *= 2; + } + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "Located json file \"%s\" from registry \"%s\\%s\"", name, + hive == DEFAULT_VK_REGISTRY_HIVE ? DEFAULT_VK_REGISTRY_HIVE_STR : SECONDARY_VK_REGISTRY_HIVE_STR, + location); + if (strlen(*reg_data) == 0) { + (void)snprintf(*reg_data, name_size + 1, "%s", name); + } else { + (void)snprintf(*reg_data + strlen(*reg_data), name_size + 2, "%c%s", PATH_SEPARATOR, name); + } + found = true; + } + name_size = 2048; + } } - while ((rtn_value = RegEnumValue(key, idx++, name, &name_size, NULL, - NULL, (LPBYTE)&value, &value_size)) == - ERROR_SUCCESS) { - if (value_size == sizeof(value) && value == 0) { - if (NULL == *reg_data) { - *reg_data = loader_instance_heap_alloc( - inst, total_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == *reg_data) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetRegistryFiles: Failed to allocate " - "space for registry data for key %s", - name); - result = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - *reg_data[0] = '\0'; - } else if (strlen(*reg_data) + name_size + 1 > total_size) { - *reg_data = loader_instance_heap_realloc( - inst, *reg_data, total_size, total_size * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == *reg_data) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loaderGetRegistryFiles: Failed to reallocate " - "space for registry value of size %d for key %s", - total_size * 2, name); - result = VK_ERROR_OUT_OF_HOST_MEMORY; - goto out; - } - total_size *= 2; - } - if (strlen(*reg_data) == 0) { - (void)snprintf(*reg_data, name_size + 1, "%s", name); - } else { - (void)snprintf(*reg_data + strlen(*reg_data), name_size + 2, - "%c%s", PATH_SEPARATOR, name); - } - found = true; - } - name_size = 2048; + // Advance the location - if the next location is in the secondary hive, then reset the locations and advance the hive + if (use_secondary_hive && (hive == DEFAULT_VK_REGISTRY_HIVE) && (*next == '\0')) { + loc = location; + hive = SECONDARY_VK_REGISTRY_HIVE; + } else { + loc = next; } - loc = next; } if (!found) { @@ -647,22 +489,19 @@ out: return result; } -#endif // WIN32 - -/** - * Combine path elements, separating each element with the platform-specific - * directory separator, and save the combined string to a destination buffer, - * not exceeding the given length. Path elements are given as variadic args, - * with a NULL element terminating the list. - * - * \returns the total length of the combined string, not including an ASCII - * NUL termination character. This length may exceed the available storage: - * in this case, the written string will be truncated to avoid a buffer - * overrun, and the return value will greater than or equal to the storage - * size. A NULL argument may be provided as the destination buffer in order - * to determine the required string length without actually writing a string. - */ +#endif // WIN32 +// Combine path elements, separating each element with the platform-specific +// directory separator, and save the combined string to a destination buffer, +// not exceeding the given length. Path elements are given as variable args, +// with a NULL element terminating the list. +// +// \returns the total length of the combined string, not including an ASCII +// NUL termination character. This length may exceed the available storage: +// in this case, the written string will be truncated to avoid a buffer +// overrun, and the return value will greater than or equal to the storage +// size. A NULL argument may be provided as the destination buffer in order +// to determine the required string length without actually writing a string. static size_t loader_platform_combine_path(char *dest, size_t len, ...) { size_t required_len = 0; va_list ap; @@ -675,8 +514,7 @@ static size_t loader_platform_combine_path(char *dest, size_t len, ...) { // This path element is not the first non-empty element; prepend // a directory separator if space allows if (dest && required_len + 1 < len) { - (void)snprintf(dest + required_len, len - required_len, "%c", - DIRECTORY_SYMBOL); + (void)snprintf(dest + required_len, len - required_len, "%c", DIRECTORY_SYMBOL); } required_len++; } @@ -697,10 +535,7 @@ static size_t loader_platform_combine_path(char *dest, size_t len, ...) { return required_len; } -/** - * Given string of three part form "maj.min.pat" convert to a vulkan version - * number. - */ +// Given string of three part form "maj.min.pat" convert to a vulkan version number. static uint32_t loader_make_version(char *vers_str) { uint32_t vers = 0, major = 0, minor = 0, patch = 0; char *vers_tok; @@ -725,92 +560,64 @@ static uint32_t loader_make_version(char *vers_str) { return VK_MAKE_VERSION(major, minor, patch); } -bool compare_vk_extension_properties(const VkExtensionProperties *op1, - const VkExtensionProperties *op2) { +bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2) { return strcmp(op1->extensionName, op2->extensionName) == 0 ? true : false; } -/** - * Search the given ext_array for an extension - * matching the given vk_ext_prop - */ -bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, - const uint32_t count, +// Search the given ext_array for an extension matching the given vk_ext_prop +bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count, const VkExtensionProperties *ext_array) { for (uint32_t i = 0; i < count; i++) { - if (compare_vk_extension_properties(vk_ext_prop, &ext_array[i])) - return true; + if (compare_vk_extension_properties(vk_ext_prop, &ext_array[i])) return true; } return false; } -/** - * Search the given ext_list for an extension - * matching the given vk_ext_prop - */ -bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, - const struct loader_extension_list *ext_list) { +// Search the given ext_list for an extension matching the given vk_ext_prop +bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list) { for (uint32_t i = 0; i < ext_list->count; i++) { - if (compare_vk_extension_properties(&ext_list->list[i], vk_ext_prop)) - return true; + if (compare_vk_extension_properties(&ext_list->list[i], vk_ext_prop)) return true; } return false; } -/** - * Search the given ext_list for a device extension matching the given ext_prop - */ -bool has_vk_dev_ext_property( - const VkExtensionProperties *ext_prop, - const struct loader_device_extension_list *ext_list) { +// Search the given ext_list for a device extension matching the given ext_prop +bool has_vk_dev_ext_property(const VkExtensionProperties *ext_prop, const struct loader_device_extension_list *ext_list) { for (uint32_t i = 0; i < ext_list->count; i++) { - if (compare_vk_extension_properties(&ext_list->list[i].props, ext_prop)) - return true; + if (compare_vk_extension_properties(&ext_list->list[i].props, ext_prop)) return true; } return false; } -/* - * Search the given layer list for a layer matching the given layer name - */ -static struct loader_layer_properties * -loader_get_layer_property(const char *name, - const struct loader_layer_list *layer_list) { +// Search the given layer list for a layer matching the given layer name +static struct loader_layer_properties *loader_get_layer_property(const char *name, const struct loader_layer_list *layer_list) { for (uint32_t i = 0; i < layer_list->count; i++) { const VkLayerProperties *item = &layer_list->list[i].info; - if (strcmp(name, item->layerName) == 0) - return &layer_list->list[i]; + if (strcmp(name, item->layerName) == 0) return &layer_list->list[i]; } return NULL; } -/** - * Get the next unused layer property in the list. Init the property to zero. - */ -static struct loader_layer_properties * -loader_get_next_layer_property(const struct loader_instance *inst, - struct loader_layer_list *layer_list) { +// Get the next unused layer property in the list. Init the property to zero. +static struct loader_layer_properties *loader_get_next_layer_property(const struct loader_instance *inst, + struct loader_layer_list *layer_list) { if (layer_list->capacity == 0) { - layer_list->list = loader_instance_heap_alloc( - inst, sizeof(struct loader_layer_properties) * 64, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + layer_list->list = + loader_instance_heap_alloc(inst, sizeof(struct loader_layer_properties) * 64, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (layer_list->list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_next_layer_property: Out of memory can " "not add any layer properties to list"); return NULL; } - memset(layer_list->list, 0, - sizeof(struct loader_layer_properties) * 64); + memset(layer_list->list, 0, sizeof(struct loader_layer_properties) * 64); layer_list->capacity = sizeof(struct loader_layer_properties) * 64; } - // ensure enough room to add an entry - if ((layer_list->count + 1) * sizeof(struct loader_layer_properties) > - layer_list->capacity) { - layer_list->list = loader_instance_heap_realloc( - inst, layer_list->list, layer_list->capacity, - layer_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + // Ensure enough room to add an entry + if ((layer_list->count + 1) * sizeof(struct loader_layer_properties) > layer_list->capacity) { + layer_list->list = loader_instance_heap_realloc(inst, layer_list->list, layer_list->capacity, layer_list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (layer_list->list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_next_layer_property: realloc failed for " @@ -824,31 +631,22 @@ loader_get_next_layer_property(const struct loader_instance *inst, return &(layer_list->list[layer_list->count - 1]); } -/** - * Remove all layer properties entrys from the list - */ -void loader_delete_layer_properties(const struct loader_instance *inst, - struct loader_layer_list *layer_list) { +// Remove all layer properties entries from the list +void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list) { uint32_t i, j; struct loader_device_extension_list *dev_ext_list; - if (!layer_list) - return; + if (!layer_list) return; for (i = 0; i < layer_list->count; i++) { - loader_destroy_generic_list( - inst, (struct loader_generic_list *)&layer_list->list[i] - .instance_extension_list); + loader_destroy_generic_list(inst, (struct loader_generic_list *)&layer_list->list[i].instance_extension_list); dev_ext_list = &layer_list->list[i].device_extension_list; - if (dev_ext_list->capacity > 0 && NULL != dev_ext_list->list && - dev_ext_list->list->entrypoint_count > 0) { + if (dev_ext_list->capacity > 0 && NULL != dev_ext_list->list && dev_ext_list->list->entrypoint_count > 0) { for (j = 0; j < dev_ext_list->list->entrypoint_count; j++) { - loader_instance_heap_free(inst, - dev_ext_list->list->entrypoints[j]); + loader_instance_heap_free(inst, dev_ext_list->list->entrypoints[j]); } loader_instance_heap_free(inst, dev_ext_list->list->entrypoints); } - loader_destroy_generic_list(inst, - (struct loader_generic_list *)dev_ext_list); + loader_destroy_generic_list(inst, (struct loader_generic_list *)dev_ext_list); } layer_list->count = 0; @@ -858,16 +656,15 @@ void loader_delete_layer_properties(const struct loader_instance *inst, } } -static VkResult loader_add_instance_extensions( - const struct loader_instance *inst, - const PFN_vkEnumerateInstanceExtensionProperties fp_get_props, - const char *lib_name, struct loader_extension_list *ext_list) { +static VkResult loader_add_instance_extensions(const struct loader_instance *inst, + const PFN_vkEnumerateInstanceExtensionProperties fp_get_props, const char *lib_name, + struct loader_extension_list *ext_list) { uint32_t i, count = 0; VkExtensionProperties *ext_props; VkResult res = VK_SUCCESS; if (!fp_get_props) { - /* No EnumerateInstanceExtensionProperties defined */ + // No EnumerateInstanceExtensionProperties defined goto out; } @@ -881,7 +678,7 @@ static VkResult loader_add_instance_extensions( } if (count == 0) { - /* No ExtensionProperties to report */ + // No ExtensionProperties to report goto out; } @@ -903,16 +700,12 @@ static VkResult loader_add_instance_extensions( for (i = 0; i < count; i++) { char spec_version[64]; - bool ext_unsupported = - wsi_unsupported_instance_extension(&ext_props[i]); + bool ext_unsupported = wsi_unsupported_instance_extension(&ext_props[i]); if (!ext_unsupported) { - (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", - VK_MAJOR(ext_props[i].specVersion), - VK_MINOR(ext_props[i].specVersion), - VK_PATCH(ext_props[i].specVersion)); - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Instance Extension: %s (%s) version %s", - ext_props[i].extensionName, lib_name, spec_version); + (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", VK_MAJOR(ext_props[i].specVersion), + VK_MINOR(ext_props[i].specVersion), VK_PATCH(ext_props[i].specVersion)); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Instance Extension: %s (%s) version %s", ext_props[i].extensionName, + lib_name, spec_version); res = loader_add_to_ext_list(inst, ext_list, 1, &ext_props[i]); if (res != VK_SUCCESS) { @@ -929,20 +722,15 @@ out: return res; } -/* - * Initialize ext_list with the physical device extensions. - * The extension properties are passed as inputs in count and ext_props. - */ -static VkResult -loader_init_device_extensions(const struct loader_instance *inst, - struct loader_physical_device_term *phys_dev_term, - uint32_t count, VkExtensionProperties *ext_props, - struct loader_extension_list *ext_list) { +// Initialize ext_list with the physical device extensions. +// The extension properties are passed as inputs in count and ext_props. +static VkResult loader_init_device_extensions(const struct loader_instance *inst, struct loader_physical_device_term *phys_dev_term, + uint32_t count, VkExtensionProperties *ext_props, + struct loader_extension_list *ext_list) { VkResult res; uint32_t i; - res = loader_init_generic_list(inst, (struct loader_generic_list *)ext_list, - sizeof(VkExtensionProperties)); + res = loader_init_generic_list(inst, (struct loader_generic_list *)ext_list, sizeof(VkExtensionProperties)); if (VK_SUCCESS != res) { return res; } @@ -950,34 +738,26 @@ loader_init_device_extensions(const struct loader_instance *inst, for (i = 0; i < count; i++) { char spec_version[64]; - (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", - VK_MAJOR(ext_props[i].specVersion), - VK_MINOR(ext_props[i].specVersion), - VK_PATCH(ext_props[i].specVersion)); - loader_log( - inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Device Extension: %s (%s) version %s", ext_props[i].extensionName, - phys_dev_term->this_icd_term->scanned_icd->lib_name, spec_version); + (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", VK_MAJOR(ext_props[i].specVersion), + VK_MINOR(ext_props[i].specVersion), VK_PATCH(ext_props[i].specVersion)); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Device Extension: %s (%s) version %s", ext_props[i].extensionName, + phys_dev_term->this_icd_term->scanned_icd->lib_name, spec_version); res = loader_add_to_ext_list(inst, ext_list, 1, &ext_props[i]); - if (res != VK_SUCCESS) - return res; + if (res != VK_SUCCESS) return res; } return VK_SUCCESS; } VkResult loader_add_device_extensions(const struct loader_instance *inst, - PFN_vkEnumerateDeviceExtensionProperties - fpEnumerateDeviceExtensionProperties, - VkPhysicalDevice physical_device, - const char *lib_name, + PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties, + VkPhysicalDevice physical_device, const char *lib_name, struct loader_extension_list *ext_list) { uint32_t i, count; VkResult res; VkExtensionProperties *ext_props; - res = fpEnumerateDeviceExtensionProperties(physical_device, NULL, &count, - NULL); + res = fpEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL); if (res == VK_SUCCESS && count > 0) { ext_props = loader_stack_alloc(count * sizeof(VkExtensionProperties)); if (!ext_props) { @@ -986,21 +766,17 @@ VkResult loader_add_device_extensions(const struct loader_instance *inst, " for device extension properties."); return VK_ERROR_OUT_OF_HOST_MEMORY; } - res = fpEnumerateDeviceExtensionProperties(physical_device, NULL, - &count, ext_props); + res = fpEnumerateDeviceExtensionProperties(physical_device, NULL, &count, ext_props); if (res != VK_SUCCESS) { return res; } for (i = 0; i < count; i++) { char spec_version[64]; - (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", - VK_MAJOR(ext_props[i].specVersion), - VK_MINOR(ext_props[i].specVersion), - VK_PATCH(ext_props[i].specVersion)); - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Device Extension: %s (%s) version %s", - ext_props[i].extensionName, lib_name, spec_version); + (void)snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", VK_MAJOR(ext_props[i].specVersion), + VK_MINOR(ext_props[i].specVersion), VK_PATCH(ext_props[i].specVersion)); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Device Extension: %s (%s) version %s", ext_props[i].extensionName, + lib_name, spec_version); res = loader_add_to_ext_list(inst, ext_list, 1, &ext_props[i]); if (res != VK_SUCCESS) { return res; @@ -1017,14 +793,11 @@ VkResult loader_add_device_extensions(const struct loader_instance *inst, return VK_SUCCESS; } -VkResult loader_init_generic_list(const struct loader_instance *inst, - struct loader_generic_list *list_info, - size_t element_size) { +VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size) { size_t capacity = 32 * element_size; list_info->count = 0; list_info->capacity = 0; - list_info->list = loader_instance_heap_alloc( - inst, capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list_info->list = loader_instance_heap_alloc(inst, capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list_info->list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_init_generic_list: Failed to allocate space " @@ -1036,30 +809,21 @@ VkResult loader_init_generic_list(const struct loader_instance *inst, return VK_SUCCESS; } -void loader_destroy_generic_list(const struct loader_instance *inst, - struct loader_generic_list *list) { +void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list) { loader_instance_heap_free(inst, list->list); list->count = 0; list->capacity = 0; } -/* - * Append non-duplicate extension properties defined in props - * to the given ext_list. - * Return - * Vk_SUCCESS on success - */ -VkResult loader_add_to_ext_list(const struct loader_instance *inst, - struct loader_extension_list *ext_list, - uint32_t prop_list_count, - const VkExtensionProperties *props) { +// Append non-duplicate extension properties defined in props to the given ext_list. +// Return - Vk_SUCCESS on success +VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list, + uint32_t prop_list_count, const VkExtensionProperties *props) { uint32_t i; const VkExtensionProperties *cur_ext; if (ext_list->list == NULL || ext_list->capacity == 0) { - VkResult res = loader_init_generic_list( - inst, (struct loader_generic_list *)ext_list, - sizeof(VkExtensionProperties)); + VkResult res = loader_init_generic_list(inst, (struct loader_generic_list *)ext_list, sizeof(VkExtensionProperties)); if (VK_SUCCESS != res) { return res; } @@ -1075,12 +839,9 @@ VkResult loader_add_to_ext_list(const struct loader_instance *inst, // add to list at end // check for enough capacity - if (ext_list->count * sizeof(VkExtensionProperties) >= - ext_list->capacity) { - - ext_list->list = loader_instance_heap_realloc( - inst, ext_list->list, ext_list->capacity, - ext_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (ext_list->count * sizeof(VkExtensionProperties) >= ext_list->capacity) { + ext_list->list = loader_instance_heap_realloc(inst, ext_list->list, ext_list->capacity, ext_list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (ext_list->list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -1093,29 +854,20 @@ VkResult loader_add_to_ext_list(const struct loader_instance *inst, ext_list->capacity *= 2; } - memcpy(&ext_list->list[ext_list->count], cur_ext, - sizeof(VkExtensionProperties)); + memcpy(&ext_list->list[ext_list->count], cur_ext, sizeof(VkExtensionProperties)); ext_list->count++; } return VK_SUCCESS; } -/* - * Append one extension property defined in props with entrypoints - * defined in entrys to the given ext_list. Do not append if a duplicate - * Return - * Vk_SUCCESS on success - */ -VkResult -loader_add_to_dev_ext_list(const struct loader_instance *inst, - struct loader_device_extension_list *ext_list, - const VkExtensionProperties *props, - uint32_t entry_count, char **entrys) { +// Append one extension property defined in props with entrypoints defined in entries to the given +// ext_list. Do not append if a duplicate. +// Return - Vk_SUCCESS on success +VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list, + const VkExtensionProperties *props, uint32_t entry_count, char **entrys) { uint32_t idx; if (ext_list->list == NULL || ext_list->capacity == 0) { - VkResult res = loader_init_generic_list( - inst, (struct loader_generic_list *)ext_list, - sizeof(struct loader_dev_ext_props)); + VkResult res = loader_init_generic_list(inst, (struct loader_generic_list *)ext_list, sizeof(struct loader_dev_ext_props)); if (VK_SUCCESS != res) { return res; } @@ -1130,10 +882,8 @@ loader_add_to_dev_ext_list(const struct loader_instance *inst, // add to list at end // check for enough capacity if (idx * sizeof(struct loader_dev_ext_props) >= ext_list->capacity) { - - ext_list->list = loader_instance_heap_realloc( - inst, ext_list->list, ext_list->capacity, ext_list->capacity * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + ext_list->list = loader_instance_heap_realloc(inst, ext_list->list, ext_list->capacity, ext_list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (ext_list->list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -1146,12 +896,10 @@ loader_add_to_dev_ext_list(const struct loader_instance *inst, ext_list->capacity *= 2; } - memcpy(&ext_list->list[idx].props, props, - sizeof(struct loader_dev_ext_props)); + memcpy(&ext_list->list[idx].props, props, sizeof(struct loader_dev_ext_props)); ext_list->list[idx].entrypoint_count = entry_count; ext_list->list[idx].entrypoints = - loader_instance_heap_alloc(inst, sizeof(char *) * entry_count, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + loader_instance_heap_alloc(inst, sizeof(char *) * entry_count, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (ext_list->list[idx].entrypoints == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_to_dev_ext_list: Failed to allocate space " @@ -1161,12 +909,11 @@ loader_add_to_dev_ext_list(const struct loader_instance *inst, return VK_ERROR_OUT_OF_HOST_MEMORY; } for (uint32_t i = 0; i < entry_count; i++) { - ext_list->list[idx].entrypoints[i] = loader_instance_heap_alloc( - inst, strlen(entrys[i]) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + ext_list->list[idx].entrypoints[i] = + loader_instance_heap_alloc(inst, strlen(entrys[i]) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (ext_list->list[idx].entrypoints[i] == NULL) { for (uint32_t j = 0; j < i; j++) { - loader_instance_heap_free(inst, - ext_list->list[idx].entrypoints[j]); + loader_instance_heap_free(inst, ext_list->list[idx].entrypoints[j]); } loader_instance_heap_free(inst, ext_list->list[idx].entrypoints); ext_list->list[idx].entrypoint_count = 0; @@ -1184,16 +931,11 @@ loader_add_to_dev_ext_list(const struct loader_instance *inst, return VK_SUCCESS; } -/** - * Search the given search_list for any layers in the props list. - * Add these to the output layer_list. Don't add duplicates to the output - * layer_list. - */ -static VkResult -loader_add_layer_names_to_list(const struct loader_instance *inst, - struct loader_layer_list *output_list, - uint32_t name_count, const char *const *names, - const struct loader_layer_list *search_list) { +// Search the given search_list for any layers in the props list. Add these to the +// output layer_list. Don't add duplicates to the output layer_list. +static VkResult loader_add_layer_names_to_list(const struct loader_instance *inst, struct loader_layer_list *output_list, + uint32_t name_count, const char *const *names, + const struct loader_layer_list *search_list) { struct loader_layer_properties *layer_prop; VkResult err = VK_SUCCESS; @@ -1215,14 +957,10 @@ loader_add_layer_names_to_list(const struct loader_instance *inst, return err; } -/* - * Manage lists of VkLayerProperties - */ -static bool loader_init_layer_list(const struct loader_instance *inst, - struct loader_layer_list *list) { +// Manage lists of VkLayerProperties +static bool loader_init_layer_list(const struct loader_instance *inst, struct loader_layer_list *list) { list->capacity = 32 * sizeof(struct loader_layer_properties); - list->list = loader_instance_heap_alloc( - inst, list->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list->list = loader_instance_heap_alloc(inst, list->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list->list == NULL) { return false; } @@ -1231,8 +969,7 @@ static bool loader_init_layer_list(const struct loader_instance *inst, return true; } -void loader_destroy_layer_list(const struct loader_instance *inst, - struct loader_device *device, +void loader_destroy_layer_list(const struct loader_instance *inst, struct loader_device *device, struct loader_layer_list *layer_list) { if (device) { loader_device_heap_free(device, layer_list->list); @@ -1243,38 +980,24 @@ void loader_destroy_layer_list(const struct loader_instance *inst, layer_list->capacity = 0; } -/* - * Search the given layer list for a list - * matching the given VkLayerProperties - */ -bool has_vk_layer_property(const VkLayerProperties *vk_layer_prop, - const struct loader_layer_list *list) { +// Search the given layer list for a list matching the given VkLayerProperties +bool has_vk_layer_property(const VkLayerProperties *vk_layer_prop, const struct loader_layer_list *list) { for (uint32_t i = 0; i < list->count; i++) { - if (strcmp(vk_layer_prop->layerName, list->list[i].info.layerName) == 0) - return true; + if (strcmp(vk_layer_prop->layerName, list->list[i].info.layerName) == 0) return true; } return false; } -/* - * Search the given layer list for a layer - * matching the given name - */ +// Search the given layer list for a layer matching the given name bool has_layer_name(const char *name, const struct loader_layer_list *list) { for (uint32_t i = 0; i < list->count; i++) { - if (strcmp(name, list->list[i].info.layerName) == 0) - return true; + if (strcmp(name, list->list[i].info.layerName) == 0) return true; } return false; } -/* - * Append non-duplicate layer properties defined in prop_list - * to the given layer_info list - */ -VkResult loader_add_to_layer_list(const struct loader_instance *inst, - struct loader_layer_list *list, - uint32_t prop_list_count, +// Append non-duplicate layer properties defined in prop_list to the given layer_info list +VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count, const struct loader_layer_properties *props) { uint32_t i; struct loader_layer_properties *layer; @@ -1283,8 +1006,7 @@ VkResult loader_add_to_layer_list(const struct loader_instance *inst, loader_init_layer_list(inst, list); } - if (list->list == NULL) - return VK_SUCCESS; + if (list->list == NULL) return VK_SUCCESS; for (i = 0; i < prop_list_count; i++) { layer = (struct loader_layer_properties *)&props[i]; @@ -1296,12 +1018,9 @@ VkResult loader_add_to_layer_list(const struct loader_instance *inst, // add to list at end // check for enough capacity - if (list->count * sizeof(struct loader_layer_properties) >= - list->capacity) { - - list->list = loader_instance_heap_realloc( - inst, list->list, list->capacity, list->capacity * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (list->count * sizeof(struct loader_layer_properties) >= list->capacity) { + list->list = loader_instance_heap_realloc(inst, list->list, list->capacity, list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == list->list) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_to_layer_list: Realloc failed for " @@ -1312,33 +1031,24 @@ VkResult loader_add_to_layer_list(const struct loader_instance *inst, list->capacity *= 2; } - memcpy(&list->list[list->count], layer, - sizeof(struct loader_layer_properties)); + memcpy(&list->list[list->count], layer, sizeof(struct loader_layer_properties)); list->count++; } return VK_SUCCESS; } -/** - * Search the search_list for any layer with a name - * that matches the given name and a type that matches the given type - * Add all matching layers to the found_list - * Do not add if found loader_layer_properties is already - * on the found_list. - */ -void loader_find_layer_name_add_list( - const struct loader_instance *inst, const char *name, - const enum layer_type type, const struct loader_layer_list *search_list, - struct loader_layer_list *found_list) { +// Search the search_list for any layer with a name that matches the given name and a type +// that matches the given type. Add all matching layers to the found_list. +// Do not add if found loader_layer_properties is already on the found_list. +void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type type, + const struct loader_layer_list *search_list, struct loader_layer_list *found_list) { bool found = false; for (uint32_t i = 0; i < search_list->count; i++) { struct loader_layer_properties *layer_prop = &search_list->list[i]; - if (0 == strcmp(layer_prop->info.layerName, name) && - (layer_prop->type & type)) { - /* Found a layer with the same name, add to found_list */ - if (VK_SUCCESS == - loader_add_to_layer_list(inst, found_list, 1, layer_prop)) { + if (0 == strcmp(layer_prop->info.layerName, name) && (layer_prop->type & type)) { + // Found a layer with the same name, add to found_list + if (VK_SUCCESS == loader_add_to_layer_list(inst, found_list, 1, layer_prop)) { found = true; } } @@ -1351,104 +1061,95 @@ void loader_find_layer_name_add_list( } } -static VkExtensionProperties * -get_extension_property(const char *name, - const struct loader_extension_list *list) { +static VkExtensionProperties *get_extension_property(const char *name, const struct loader_extension_list *list) { for (uint32_t i = 0; i < list->count; i++) { - if (strcmp(name, list->list[i].extensionName) == 0) - return &list->list[i]; + if (strcmp(name, list->list[i].extensionName) == 0) return &list->list[i]; } return NULL; } -static VkExtensionProperties * -get_dev_extension_property(const char *name, - const struct loader_device_extension_list *list) { +static VkExtensionProperties *get_dev_extension_property(const char *name, const struct loader_device_extension_list *list) { for (uint32_t i = 0; i < list->count; i++) { - if (strcmp(name, list->list[i].props.extensionName) == 0) - return &list->list[i].props; + if (strcmp(name, list->list[i].props.extensionName) == 0) return &list->list[i].props; } return NULL; } -/* - * For Instance extensions implemented within the loader (i.e. DEBUG_REPORT - * the extension must provide two entry points for the loader to use: - * - "trampoline" entry point - this is the address returned by GetProcAddr - * and will always do what's necessary to support a global call. - * - "terminator" function - this function will be put at the end of the - * instance chain and will contain the necessary logic to call / process - * the extension for the appropriate ICDs that are available. - * There is no generic mechanism for including these functions, the references - * must be placed into the appropriate loader entry points. - * GetInstanceProcAddr: call extension GetInstanceProcAddr to check for - * GetProcAddr requests - * loader_coalesce_extensions(void) - add extension records to the list of - * global - * extension available to the app. - * instance_disp - add function pointer for terminator function to this array. - * The extension itself should be in a separate file that will be - * linked directly with the loader. - */ - -VkResult loader_get_icd_loader_instance_extensions( - const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list, - struct loader_extension_list *inst_exts) { +// For Instance extensions implemented within the loader (i.e. DEBUG_REPORT +// the extension must provide two entry points for the loader to use: +// - "trampoline" entry point - this is the address returned by GetProcAddr +// and will always do what's necessary to support a +// global call. +// - "terminator" function - this function will be put at the end of the +// instance chain and will contain the necessary logic +// to call / process the extension for the appropriate +// ICDs that are available. +// There is no generic mechanism for including these functions, the references +// must be placed into the appropriate loader entry points. +// GetInstanceProcAddr: call extension GetInstanceProcAddr to check for GetProcAddr +// requests +// loader_coalesce_extensions(void) - add extension records to the list of global +// extension available to the app. +// instance_disp - add function pointer for terminator function +// to this array. +// The extension itself should be in a separate file that will be linked directly +// with the loader. +VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list, + struct loader_extension_list *inst_exts) { struct loader_extension_list icd_exts; VkResult res = VK_SUCCESS; + char *env_value; + bool filter_extensions = true; - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Build ICD instance extension list"); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Build ICD instance extension list"); + + // Check if a user wants to disable the instance extension filtering behavior + env_value = loader_getenv("VK_LOADER_DISABLE_INST_EXT_FILTER", inst); + if (NULL != env_value && atoi(env_value) != 0) { + filter_extensions = false; + } + loader_free_getenv(env_value, inst); // traverse scanned icd list adding non-duplicate extensions to the list for (uint32_t i = 0; i < icd_tramp_list->count; i++) { - res = loader_init_generic_list(inst, - (struct loader_generic_list *)&icd_exts, - sizeof(VkExtensionProperties)); + res = loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); if (VK_SUCCESS != res) { goto out; } - res = loader_add_instance_extensions( - inst, icd_tramp_list->scanned_list[i] - .EnumerateInstanceExtensionProperties, - icd_tramp_list->scanned_list[i].lib_name, &icd_exts); + res = loader_add_instance_extensions(inst, icd_tramp_list->scanned_list[i].EnumerateInstanceExtensionProperties, + icd_tramp_list->scanned_list[i].lib_name, &icd_exts); if (VK_SUCCESS == res) { - // Remove any extensions not recognized by the loader - for (int32_t j = 0; j < (int32_t)icd_exts.count; j++) { - - // See if the extension is in the list of supported extensions - bool found = false; - for (uint32_t k = 0; LOADER_INSTANCE_EXTENSIONS[k] != NULL; - k++) { - if (strcmp(icd_exts.list[j].extensionName, - LOADER_INSTANCE_EXTENSIONS[k]) == 0) { - found = true; - break; + if (filter_extensions) { + // Remove any extensions not recognized by the loader + for (int32_t j = 0; j < (int32_t)icd_exts.count; j++) { + // See if the extension is in the list of supported extensions + bool found = false; + for (uint32_t k = 0; LOADER_INSTANCE_EXTENSIONS[k] != NULL; k++) { + if (strcmp(icd_exts.list[j].extensionName, LOADER_INSTANCE_EXTENSIONS[k]) == 0) { + found = true; + break; + } } - } - // If it isn't in the list, remove it - if (!found) { - for (uint32_t k = j + 1; k < icd_exts.count; k++) { - icd_exts.list[k - 1] = icd_exts.list[k]; + // If it isn't in the list, remove it + if (!found) { + for (uint32_t k = j + 1; k < icd_exts.count; k++) { + icd_exts.list[k - 1] = icd_exts.list[k]; + } + --icd_exts.count; + --j; } - --icd_exts.count; - --j; } } - res = loader_add_to_ext_list(inst, inst_exts, icd_exts.count, - icd_exts.list); + res = loader_add_to_ext_list(inst, inst_exts, icd_exts.count, icd_exts.list); } - loader_destroy_generic_list(inst, - (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(inst, (struct loader_generic_list *)&icd_exts); if (VK_SUCCESS != res) { goto out; } }; - // Traverse loader's extensions, adding non-duplicate extensions to the list debug_report_add_instance_extensions(inst, inst_exts); @@ -1456,23 +1157,15 @@ out: return res; } -struct loader_icd_term * -loader_get_icd_and_device(const VkDevice device, - struct loader_device **found_dev, - uint32_t *icd_index) { +struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index) { *found_dev = NULL; - uint32_t index = 0; - for (struct loader_instance *inst = loader.instances; inst; - inst = inst->next) { - for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term; - icd_term = icd_term->next) { - for (struct loader_device *dev = icd_term->logical_device_list; dev; - dev = dev->next) + for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) { + uint32_t index = 0; + for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { + for (struct loader_device *dev = icd_term->logical_device_list; dev; dev = dev->next) // Value comparison of device prevents object wrapping by layers - if (loader_get_dispatch(dev->icd_device) == - loader_get_dispatch(device) || - loader_get_dispatch(dev->chain_device) == - loader_get_dispatch(device)) { + if (loader_get_dispatch(dev->icd_device) == loader_get_dispatch(device) || + loader_get_dispatch(dev->chain_device) == loader_get_dispatch(device)) { *found_dev = dev; if (NULL != icd_index) { *icd_index = index; @@ -1485,8 +1178,7 @@ loader_get_icd_and_device(const VkDevice device, return NULL; } -void loader_destroy_logical_device(const struct loader_instance *inst, - struct loader_device *dev, +void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev, const VkAllocationCallbacks *pAllocator) { if (pAllocator) { dev->alloc_callbacks = *pAllocator; @@ -1497,17 +1189,14 @@ void loader_destroy_logical_device(const struct loader_instance *inst, loader_device_heap_free(dev, dev); } -struct loader_device * -loader_create_logical_device(const struct loader_instance *inst, - const VkAllocationCallbacks *pAllocator) { +struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator) { struct loader_device *new_dev; #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) { #else if (pAllocator) { - new_dev = (struct loader_device *)pAllocator->pfnAllocation( - pAllocator->pUserData, sizeof(struct loader_device), sizeof(int *), - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); + new_dev = (struct loader_device *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(struct loader_device), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); } else { #endif new_dev = (struct loader_device *)malloc(sizeof(struct loader_device)); @@ -1528,21 +1217,16 @@ loader_create_logical_device(const struct loader_instance *inst, return new_dev; } -void loader_add_logical_device(const struct loader_instance *inst, - struct loader_icd_term *icd_term, - struct loader_device *dev) { +void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, struct loader_device *dev) { dev->next = icd_term->logical_device_list; icd_term->logical_device_list = dev; } -void loader_remove_logical_device(const struct loader_instance *inst, - struct loader_icd_term *icd_term, - struct loader_device *found_dev, - const VkAllocationCallbacks *pAllocator) { +void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, + struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator) { struct loader_device *dev, *prev_dev; - if (!icd_term || !found_dev) - return; + if (!icd_term || !found_dev) return; prev_dev = NULL; dev = icd_term->logical_device_list; @@ -1558,8 +1242,7 @@ void loader_remove_logical_device(const struct loader_instance *inst, loader_destroy_logical_device(inst, found_dev, pAllocator); } -static void loader_icd_destroy(struct loader_instance *ptr_inst, - struct loader_icd_term *icd_term, +static void loader_icd_destroy(struct loader_instance *ptr_inst, struct loader_icd_term *icd_term, const VkAllocationCallbacks *pAllocator) { ptr_inst->total_icd_count--; for (struct loader_device *dev = icd_term->logical_device_list; dev;) { @@ -1571,12 +1254,10 @@ static void loader_icd_destroy(struct loader_instance *ptr_inst, loader_instance_heap_free(ptr_inst, icd_term); } -static struct loader_icd_term * -loader_icd_create(const struct loader_instance *inst) { +static struct loader_icd_term *loader_icd_create(const struct loader_instance *inst) { struct loader_icd_term *icd_term; - icd_term = loader_instance_heap_alloc(inst, sizeof(struct loader_icd_term), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + icd_term = loader_instance_heap_alloc(inst, sizeof(struct loader_icd_term), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (!icd_term) { return NULL; } @@ -1586,9 +1267,7 @@ loader_icd_create(const struct loader_instance *inst) { return icd_term; } -static struct loader_icd_term * -loader_icd_add(struct loader_instance *ptr_inst, - const struct loader_scanned_icd *scanned_icd) { +static struct loader_icd_term *loader_icd_add(struct loader_instance *ptr_inst, const struct loader_scanned_icd *scanned_icd) { struct loader_icd_term *icd_term; icd_term = loader_icd_create(ptr_inst); @@ -1599,7 +1278,7 @@ loader_icd_add(struct loader_instance *ptr_inst, icd_term->scanned_icd = scanned_icd; icd_term->this_instance = ptr_inst; - /* prepend to the list */ + // Prepend to the list icd_term->next = ptr_inst->icd_terms; ptr_inst->icd_terms = icd_term; ptr_inst->total_icd_count++; @@ -1607,18 +1286,13 @@ loader_icd_add(struct loader_instance *ptr_inst, return icd_term; } -/** - * Determine the ICD interface version to use. - * @param icd - * @param pVersion Output parameter indicating which version to use or 0 if - * the negotiation API is not supported by the ICD - * @return bool indicating true if the selected interface version is supported - * by the loader, false indicates the version is not supported - */ -bool loader_get_icd_interface_version( - PFN_vkNegotiateLoaderICDInterfaceVersion fp_negotiate_icd_version, - uint32_t *pVersion) { - +// Determine the ICD interface version to use. +// @param icd +// @param pVersion Output parameter indicating which version to use or 0 if +// the negotiation API is not supported by the ICD +// @return bool indicating true if the selected interface version is supported +// by the loader, false indicates the version is not supported +bool loader_get_icd_interface_version(PFN_vkNegotiateLoaderICDInterfaceVersion fp_negotiate_icd_version, uint32_t *pVersion) { if (fp_negotiate_icd_version == NULL) { // ICD does not support the negotiation API, it supports version 0 or 1 // calling code must determine if it is version 0 or 1 @@ -1646,14 +1320,11 @@ bool loader_get_icd_interface_version( return true; } -void loader_scanned_icd_clear(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list) { - if (icd_tramp_list->capacity == 0) - return; +void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list) { + if (icd_tramp_list->capacity == 0) return; for (uint32_t i = 0; i < icd_tramp_list->count; i++) { loader_platform_close_library(icd_tramp_list->scanned_list[i].handle); - loader_instance_heap_free(inst, - icd_tramp_list->scanned_list[i].lib_name); + loader_instance_heap_free(inst, icd_tramp_list->scanned_list[i].lib_name); } loader_instance_heap_free(inst, icd_tramp_list->scanned_list); icd_tramp_list->capacity = 0; @@ -1661,28 +1332,22 @@ void loader_scanned_icd_clear(const struct loader_instance *inst, icd_tramp_list->scanned_list = NULL; } -static VkResult -loader_scanned_icd_init(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list) { +static VkResult loader_scanned_icd_init(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list) { VkResult err = VK_SUCCESS; loader_scanned_icd_clear(inst, icd_tramp_list); icd_tramp_list->capacity = 8 * sizeof(struct loader_scanned_icd); - icd_tramp_list->scanned_list = loader_instance_heap_alloc( - inst, icd_tramp_list->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + icd_tramp_list->scanned_list = loader_instance_heap_alloc(inst, icd_tramp_list->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == icd_tramp_list->scanned_list) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_scanned_icd_init: Realloc failed for layer list when " - "attempting to add new layer"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_scanned_icd_init: Realloc failed for layer list when " + "attempting to add new layer"); err = VK_ERROR_OUT_OF_HOST_MEMORY; } return err; } -static VkResult -loader_scanned_icd_add(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list, - const char *filename, uint32_t api_version) { +static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list, + const char *filename, uint32_t api_version) { loader_platform_dl_handle handle; PFN_vkCreateInstance fp_create_inst; PFN_vkEnumerateInstanceExtensionProperties fp_get_inst_ext_props; @@ -1693,21 +1358,18 @@ loader_scanned_icd_add(const struct loader_instance *inst, uint32_t interface_vers; VkResult res = VK_SUCCESS; - /* TODO implement smarter opening/closing of libraries. For now this - * function leaves libraries open and the scanned_icd_clear closes them */ + // TODO implement smarter opening/closing of libraries. For now this + // function leaves libraries open and the scanned_icd_clear closes them handle = loader_platform_open_library(filename); if (NULL == handle) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - loader_platform_open_library_error(filename)); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, loader_platform_open_library_error(filename)); goto out; } // Get and settle on an ICD interface version - fp_negotiate_icd_version = loader_platform_get_proc_address( - handle, "vk_icdNegotiateLoaderICDInterfaceVersion"); + fp_negotiate_icd_version = loader_platform_get_proc_address(handle, "vk_icdNegotiateLoaderICDInterfaceVersion"); - if (!loader_get_icd_interface_version(fp_negotiate_icd_version, - &interface_vers)) { + if (!loader_get_icd_interface_version(fp_negotiate_icd_version, &interface_vers)) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: ICD %s doesn't support interface" " version compatible with loader, skip this ICD.", @@ -1715,16 +1377,14 @@ loader_scanned_icd_add(const struct loader_instance *inst, goto out; } - fp_get_proc_addr = - loader_platform_get_proc_address(handle, "vk_icdGetInstanceProcAddr"); + fp_get_proc_addr = loader_platform_get_proc_address(handle, "vk_icdGetInstanceProcAddr"); if (NULL == fp_get_proc_addr) { assert(interface_vers == 0); // Use deprecated interface from version 0 - fp_get_proc_addr = - loader_platform_get_proc_address(handle, "vkGetInstanceProcAddr"); + fp_get_proc_addr = loader_platform_get_proc_address(handle, "vkGetInstanceProcAddr"); if (NULL == fp_get_proc_addr) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_scanned_icd_add: Attempt to retreive either " + "loader_scanned_icd_add: Attempt to retrieve either " "\'vkGetInstanceProcAddr\' or " "\'vk_icdGetInstanceProcAddr\' from ICD %s failed.", filename); @@ -1736,8 +1396,7 @@ loader_scanned_icd_add(const struct loader_instance *inst, "\'vk_icdGetInstanceProcAddr\' for ICD %s", filename); } - fp_create_inst = - loader_platform_get_proc_address(handle, "vkCreateInstance"); + fp_create_inst = loader_platform_get_proc_address(handle, "vkCreateInstance"); if (NULL == fp_create_inst) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: Failed querying " @@ -1746,8 +1405,7 @@ loader_scanned_icd_add(const struct loader_instance *inst, filename); goto out; } - fp_get_inst_ext_props = loader_platform_get_proc_address( - handle, "vkEnumerateInstanceExtensionProperties"); + fp_get_inst_ext_props = loader_platform_get_proc_address(handle, "vkEnumerateInstanceExtensionProperties"); if (NULL == fp_get_inst_ext_props) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: Could not get \'vkEnumerate" @@ -1762,8 +1420,7 @@ loader_scanned_icd_add(const struct loader_instance *inst, interface_vers = 1; } - fp_create_inst = - (PFN_vkCreateInstance)fp_get_proc_addr(NULL, "vkCreateInstance"); + fp_create_inst = (PFN_vkCreateInstance)fp_get_proc_addr(NULL, "vkCreateInstance"); if (NULL == fp_create_inst) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: Could not get " @@ -1773,8 +1430,7 @@ loader_scanned_icd_add(const struct loader_instance *inst, goto out; } fp_get_inst_ext_props = - (PFN_vkEnumerateInstanceExtensionProperties)fp_get_proc_addr( - NULL, "vkEnumerateInstanceExtensionProperties"); + (PFN_vkEnumerateInstanceExtensionProperties)fp_get_proc_addr(NULL, "vkEnumerateInstanceExtensionProperties"); if (NULL == fp_get_inst_ext_props) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: Could not get \'vkEnumerate" @@ -1783,17 +1439,14 @@ loader_scanned_icd_add(const struct loader_instance *inst, filename); goto out; } - fp_get_phys_dev_proc_addr = - loader_platform_get_proc_address(handle, "vk_icdGetPhysicalDeviceProcAddr"); + fp_get_phys_dev_proc_addr = loader_platform_get_proc_address(handle, "vk_icdGetPhysicalDeviceProcAddr"); } // check for enough capacity - if ((icd_tramp_list->count * sizeof(struct loader_scanned_icd)) >= - icd_tramp_list->capacity) { - - icd_tramp_list->scanned_list = loader_instance_heap_realloc( - inst, icd_tramp_list->scanned_list, icd_tramp_list->capacity, - icd_tramp_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if ((icd_tramp_list->count * sizeof(struct loader_scanned_icd)) >= icd_tramp_list->capacity) { + icd_tramp_list->scanned_list = + loader_instance_heap_realloc(inst, icd_tramp_list->scanned_list, icd_tramp_list->capacity, icd_tramp_list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == icd_tramp_list->scanned_list) { res = VK_ERROR_OUT_OF_HOST_MEMORY; loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -1811,17 +1464,13 @@ loader_scanned_icd_add(const struct loader_instance *inst, new_scanned_icd->api_version = api_version; new_scanned_icd->GetInstanceProcAddr = fp_get_proc_addr; new_scanned_icd->GetPhysicalDeviceProcAddr = fp_get_phys_dev_proc_addr; - new_scanned_icd->EnumerateInstanceExtensionProperties = - fp_get_inst_ext_props; + new_scanned_icd->EnumerateInstanceExtensionProperties = fp_get_inst_ext_props; new_scanned_icd->CreateInstance = fp_create_inst; new_scanned_icd->interface_version = interface_vers; - new_scanned_icd->lib_name = (char *)loader_instance_heap_alloc( - inst, strlen(filename) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + new_scanned_icd->lib_name = (char *)loader_instance_heap_alloc(inst, strlen(filename) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == new_scanned_icd->lib_name) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_scanned_icd_add: Out of memory can't add ICD %s", - filename); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_scanned_icd_add: Out of memory can't add ICD %s", filename); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } @@ -1833,117 +1482,14 @@ out: return res; } -static bool loader_icd_init_entrys(struct loader_icd_term *icd_term, - VkInstance inst, - const PFN_vkGetInstanceProcAddr fp_gipa) { -/* initialize entrypoint function pointers */ - -#define LOOKUP_GIPA(func, required) \ - do { \ - icd_term->func = (PFN_vk##func)fp_gipa(inst, "vk" #func); \ - if (!icd_term->func && required) { \ - loader_log((struct loader_instance *)inst, \ - VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \ - loader_platform_get_proc_address_error("vk" #func)); \ - return false; \ - } \ - } while (0) - - LOOKUP_GIPA(GetDeviceProcAddr, true); - LOOKUP_GIPA(DestroyInstance, true); - LOOKUP_GIPA(EnumeratePhysicalDevices, true); - LOOKUP_GIPA(GetPhysicalDeviceFeatures, true); - LOOKUP_GIPA(GetPhysicalDeviceFormatProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties, true); - LOOKUP_GIPA(CreateDevice, true); - LOOKUP_GIPA(GetPhysicalDeviceProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties, true); - LOOKUP_GIPA(EnumerateDeviceExtensionProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties, true); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceSupportKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilitiesKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormatsKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSurfacePresentModesKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceDisplayPropertiesKHR, false); - LOOKUP_GIPA(GetDisplayModePropertiesKHR, false); - LOOKUP_GIPA(CreateDisplayPlaneSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceDisplayPlanePropertiesKHR, false); - LOOKUP_GIPA(GetDisplayPlaneSupportedDisplaysKHR, false); - LOOKUP_GIPA(CreateDisplayModeKHR, false); - LOOKUP_GIPA(GetDisplayPlaneCapabilitiesKHR, false); - LOOKUP_GIPA(DestroySurfaceKHR, false); - LOOKUP_GIPA(CreateSwapchainKHR, false); -#ifdef VK_USE_PLATFORM_WIN32_KHR - LOOKUP_GIPA(CreateWin32SurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceWin32PresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - LOOKUP_GIPA(CreateXcbSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceXcbPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - LOOKUP_GIPA(CreateXlibSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceXlibPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - LOOKUP_GIPA(CreateMirSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceMirPresentationSupportKHR, false); -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - LOOKUP_GIPA(CreateWaylandSurfaceKHR, false); - LOOKUP_GIPA(GetPhysicalDeviceWaylandPresentationSupportKHR, false); -#endif - LOOKUP_GIPA(CreateSharedSwapchainsKHR, false); - - // KHR_get_physical_device_properties2 - LOOKUP_GIPA(GetPhysicalDeviceFeatures2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceFormatProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties2KHR, false); - LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties2KHR, false); - // EXT_debug_marker (items needing a trampoline/terminator) - LOOKUP_GIPA(DebugMarkerSetObjectTagEXT, false); - LOOKUP_GIPA(DebugMarkerSetObjectNameEXT, false); - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - LOOKUP_GIPA(AcquireXlibDisplayEXT, false); - LOOKUP_GIPA(GetRandROutputDisplayEXT, false); -#endif - - // EXT_debug_report - LOOKUP_GIPA(CreateDebugReportCallbackEXT, false); - LOOKUP_GIPA(DestroyDebugReportCallbackEXT, false); - LOOKUP_GIPA(DebugReportMessageEXT, false); - - // EXT_direct_mode_display - LOOKUP_GIPA(ReleaseDisplayEXT, false); - - // EXT_display_surface_counter - LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilities2EXT, false); - - // NV_external_memory_capabilities - LOOKUP_GIPA(GetPhysicalDeviceExternalImageFormatPropertiesNV, false); - // NVX_device_generated_commands - LOOKUP_GIPA(GetPhysicalDeviceGeneratedCommandsPropertiesNVX, false); - -#undef LOOKUP_GIPA - - return true; -} - static void loader_debug_init(void) { char *env, *orig; - if (g_loader_debug > 0) - return; + if (g_loader_debug > 0) return; g_loader_debug = 0; - /* parse comma-separated debug options */ + // Parse comma-separated debug options orig = env = loader_getenv("VK_LOADER_DEBUG", NULL); while (env) { char *p = strchr(env, ','); @@ -1966,8 +1512,7 @@ static void loader_debug_init(void) { g_loader_log_msgs |= VK_DEBUG_REPORT_INFORMATION_BIT_EXT; } else if (strncmp(env, "perf", len) == 0) { g_loader_debug |= LOADER_PERF_BIT; - g_loader_log_msgs |= - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + g_loader_log_msgs |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; } else if (strncmp(env, "error", len) == 0) { g_loader_debug |= LOADER_ERROR_BIT; g_loader_log_msgs |= VK_DEBUG_REPORT_ERROR_BIT_EXT; @@ -1977,8 +1522,7 @@ static void loader_debug_init(void) { } } - if (!p) - break; + if (!p) break; env = p + 1; } @@ -1996,8 +1540,7 @@ void loader_initialize(void) { // initial cJSON to use alloc callbacks cJSON_Hooks alloc_fns = { - .malloc_fn = loader_instance_tls_heap_alloc, - .free_fn = loader_instance_tls_heap_free, + .malloc_fn = loader_instance_tls_heap_alloc, .free_fn = loader_instance_tls_heap_free, }; cJSON_InitHooks(&alloc_fns); } @@ -2007,20 +1550,17 @@ struct loader_manifest_files { char **filename_list; }; -/** - * Get next file or dirname given a string list or registry key path - * - * \returns - * A pointer to first char in the next path. - * The next path (or NULL) in the list is returned in next_path. - * Note: input string is modified in some cases. PASS IN A COPY! - */ +// Get next file or dirname given a string list or registry key path +// +// \returns +// A pointer to first char in the next path. +// The next path (or NULL) in the list is returned in next_path. +// Note: input string is modified in some cases. PASS IN A COPY! static char *loader_get_next_path(char *path) { uint32_t len; char *next; - if (path == NULL) - return NULL; + if (path == NULL) return NULL; next = strchr(path, PATH_SEPARATOR); if (next == NULL) { len = (uint32_t)strlen(path); @@ -2033,16 +1573,12 @@ static char *loader_get_next_path(char *path) { return next; } -/** - * Given a path which is absolute or relative, expand the path if relative or - * leave the path unmodified if absolute. The base path to prepend to relative - * paths is given in rel_base. - * - * \returns - * A string in out_fullpath of the full absolute path - */ -static void loader_expand_path(const char *path, const char *rel_base, - size_t out_size, char *out_fullpath) { +// Given a path which is absolute or relative, expand the path if relative or +// leave the path unmodified if absolute. The base path to prepend to relative +// paths is given in rel_base. +// +// @return - A string in out_fullpath of the full absolute path +static void loader_expand_path(const char *path, const char *rel_base, size_t out_size, char *out_fullpath) { if (loader_platform_is_path_absolute(path)) { // do not prepend a base to an absolute path rel_base = ""; @@ -2051,16 +1587,11 @@ static void loader_expand_path(const char *path, const char *rel_base, loader_platform_combine_path(out_fullpath, out_size, rel_base, path, NULL); } -/** - * Given a filename (file) and a list of paths (dir), try to find an existing - * file in the paths. If filename already is a path then no - * searching in the given paths. - * - * \returns - * A string in out_fullpath of either the full path or file. - */ -static void loader_get_fullpath(const char *file, const char *dirs, - size_t out_size, char *out_fullpath) { +// Given a filename (file) and a list of paths (dir), try to find an existing +// file in the paths. If filename already is a path then no searching in the given paths. +// +// @return - A string in out_fullpath of either the full path or file. +static void loader_get_fullpath(const char *file, const char *dirs, size_t out_size, char *out_fullpath) { if (!loader_platform_is_path(file) && *dirs) { char *dirs_copy, *dir, *next_dir; @@ -2068,10 +1599,8 @@ static void loader_get_fullpath(const char *file, const char *dirs, strcpy(dirs_copy, dirs); // find if file exists after prepending paths in given list - for (dir = dirs_copy; *dir && (next_dir = loader_get_next_path(dir)); - dir = next_dir) { - loader_platform_combine_path(out_fullpath, out_size, dir, file, - NULL); + for (dir = dirs_copy; *dir && (next_dir = loader_get_next_path(dir)); dir = next_dir) { + loader_platform_combine_path(out_fullpath, out_size, dir, file, NULL); if (loader_platform_file_exists(out_fullpath)) { return; } @@ -2081,23 +1610,18 @@ static void loader_get_fullpath(const char *file, const char *dirs, (void)snprintf(out_fullpath, out_size, "%s", file); } -/** - * Read a JSON file into a buffer. - * - * \returns - * A pointer to a cJSON object representing the JSON parse tree. - * This returned buffer should be freed by caller. - */ -static VkResult loader_get_json(const struct loader_instance *inst, - const char *filename, cJSON **json) { +// Read a JSON file into a buffer. +// +// @return - A pointer to a cJSON object representing the JSON parse tree. +// This returned buffer should be freed by caller. +static VkResult loader_get_json(const struct loader_instance *inst, const char *filename, cJSON **json) { FILE *file = NULL; char *json_buf; size_t len; VkResult res = VK_SUCCESS; if (NULL == json) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_get_json: Received invalid JSON file"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_json: Received invalid JSON file"); res = VK_ERROR_INITIALIZATION_FAILED; goto out; } @@ -2106,8 +1630,7 @@ static VkResult loader_get_json(const struct loader_instance *inst, file = fopen(filename, "rb"); if (!file) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_get_json: Failed to open JSON file %s", filename); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_json: Failed to open JSON file %s", filename); res = VK_ERROR_INITIALIZATION_FAILED; goto out; } @@ -2124,14 +1647,13 @@ static VkResult loader_get_json(const struct loader_instance *inst, goto out; } if (fread(json_buf, sizeof(char), len, file) != len) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_get_json: Failed to read JSON file %s.", filename); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_json: Failed to read JSON file %s.", filename); res = VK_ERROR_INITIALIZATION_FAILED; goto out; } json_buf[len] = '\0'; - // parse text from file + // Parse text from file *json = cJSON_Parse(json_buf); if (*json == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -2151,18 +1673,13 @@ out: return res; } -/** - * Do a deep copy of the loader_layer_properties structure. - */ -VkResult loader_copy_layer_properties(const struct loader_instance *inst, - struct loader_layer_properties *dst, +// Do a deep copy of the loader_layer_properties structure. +VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst, struct loader_layer_properties *src) { uint32_t cnt, i; memcpy(dst, src, sizeof(*src)); dst->instance_extension_list.list = loader_instance_heap_alloc( - inst, - sizeof(VkExtensionProperties) * src->instance_extension_list.count, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + inst, sizeof(VkExtensionProperties) * src->instance_extension_list.count, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == dst->instance_extension_list.list) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_copy_layer_properties: Failed to allocate space " @@ -2170,14 +1687,10 @@ VkResult loader_copy_layer_properties(const struct loader_instance *inst, src->instance_extension_list.count); return VK_ERROR_OUT_OF_HOST_MEMORY; } - dst->instance_extension_list.capacity = - sizeof(VkExtensionProperties) * src->instance_extension_list.count; - memcpy(dst->instance_extension_list.list, src->instance_extension_list.list, - dst->instance_extension_list.capacity); + dst->instance_extension_list.capacity = sizeof(VkExtensionProperties) * src->instance_extension_list.count; + memcpy(dst->instance_extension_list.list, src->instance_extension_list.list, dst->instance_extension_list.capacity); dst->device_extension_list.list = loader_instance_heap_alloc( - inst, - sizeof(struct loader_dev_ext_props) * src->device_extension_list.count, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + inst, sizeof(struct loader_dev_ext_props) * src->device_extension_list.count, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == dst->device_extension_list.list) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_copy_layer_properties: Failed to allocate space " @@ -2185,20 +1698,14 @@ VkResult loader_copy_layer_properties(const struct loader_instance *inst, src->device_extension_list.count); return VK_ERROR_OUT_OF_HOST_MEMORY; } - memset(dst->device_extension_list.list, 0, - sizeof(struct loader_dev_ext_props) * - src->device_extension_list.count); + memset(dst->device_extension_list.list, 0, sizeof(struct loader_dev_ext_props) * src->device_extension_list.count); - dst->device_extension_list.capacity = - sizeof(struct loader_dev_ext_props) * src->device_extension_list.count; - memcpy(dst->device_extension_list.list, src->device_extension_list.list, - dst->device_extension_list.capacity); - if (src->device_extension_list.count > 0 && - src->device_extension_list.list->entrypoint_count > 0) { + dst->device_extension_list.capacity = sizeof(struct loader_dev_ext_props) * src->device_extension_list.count; + memcpy(dst->device_extension_list.list, src->device_extension_list.list, dst->device_extension_list.capacity); + if (src->device_extension_list.count > 0 && src->device_extension_list.list->entrypoint_count > 0) { cnt = src->device_extension_list.list->entrypoint_count; dst->device_extension_list.list->entrypoints = - loader_instance_heap_alloc(inst, sizeof(char *) * cnt, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + loader_instance_heap_alloc(inst, sizeof(char *) * cnt, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == dst->device_extension_list.list->entrypoints) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_copy_layer_properties: Failed to allocate space " @@ -2206,15 +1713,11 @@ VkResult loader_copy_layer_properties(const struct loader_instance *inst, cnt); return VK_ERROR_OUT_OF_HOST_MEMORY; } - memset(dst->device_extension_list.list->entrypoints, 0, - sizeof(char *) * cnt); + memset(dst->device_extension_list.list->entrypoints, 0, sizeof(char *) * cnt); for (i = 0; i < cnt; i++) { - dst->device_extension_list.list->entrypoints[i] = - loader_instance_heap_alloc( - inst, - strlen(src->device_extension_list.list->entrypoints[i]) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + dst->device_extension_list.list->entrypoints[i] = loader_instance_heap_alloc( + inst, strlen(src->device_extension_list.list->entrypoints[i]) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == dst->device_extension_list.list->entrypoints[i]) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_copy_layer_properties: Failed to " @@ -2223,79 +1726,59 @@ VkResult loader_copy_layer_properties(const struct loader_instance *inst, i); return VK_ERROR_OUT_OF_HOST_MEMORY; } - strcpy(dst->device_extension_list.list->entrypoints[i], - src->device_extension_list.list->entrypoints[i]); + strcpy(dst->device_extension_list.list->entrypoints[i], src->device_extension_list.list->entrypoints[i]); } } return VK_SUCCESS; } -static bool -loader_find_layer_name_list(const char *name, - const struct loader_layer_list *layer_list) { - if (!layer_list) - return false; +static bool loader_find_layer_name_list(const char *name, const struct loader_layer_list *layer_list) { + if (!layer_list) return false; for (uint32_t j = 0; j < layer_list->count; j++) - if (!strcmp(name, layer_list->list[j].info.layerName)) - return true; + if (!strcmp(name, layer_list->list[j].info.layerName)) return true; return false; } -static bool loader_find_layer_name(const char *name, uint32_t layer_count, - const char **layer_list) { - if (!layer_list) - return false; +static bool loader_find_layer_name(const char *name, uint32_t layer_count, const char **layer_list) { + if (!layer_list) return false; for (uint32_t j = 0; j < layer_count; j++) - if (!strcmp(name, layer_list[j])) - return true; + if (!strcmp(name, layer_list[j])) return true; return false; } -bool loader_find_layer_name_array( - const char *name, uint32_t layer_count, - const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]) { - if (!layer_list) - return false; +bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]) { + if (!layer_list) return false; for (uint32_t j = 0; j < layer_count; j++) - if (!strcmp(name, layer_list[j])) - return true; + if (!strcmp(name, layer_list[j])) return true; return false; } -/** - * Searches through an array of layer names (ppp_layer_names) looking for a - * layer key_name. - * If not found then simply returns updating nothing. - * Otherwise, it uses expand_count, expand_names adding them to layer names. - * Any duplicate (pre-existing) expand_names in layer names are removed. - * Order is otherwise preserved, with the layer key_name being replaced by the - * expand_names. - * @param inst - * @param layer_count - * @param ppp_layer_names - */ -VkResult loader_expand_layer_names( - struct loader_instance *inst, const char *key_name, uint32_t expand_count, - const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], - uint32_t *layer_count, char const *const **ppp_layer_names) { - +// Searches through an array of layer names (ppp_layer_names) looking for a +// layer key_name. +// If not found then simply returns updating nothing. +// Otherwise, it uses expand_count, expand_names adding them to layer names. +// Any duplicate (pre-existing) expand_names in layer names are removed. +// Order is otherwise preserved, with the layer key_name being replaced by the +// expand_names. +// @param inst +// @param layer_count +// @param ppp_layer_names +VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key_name, uint32_t expand_count, + const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], uint32_t *layer_count, + char const *const **ppp_layer_names) { char const *const *pp_src_layers = *ppp_layer_names; - if (!loader_find_layer_name(key_name, *layer_count, - (char const **)pp_src_layers)) { + if (!loader_find_layer_name(key_name, *layer_count, (char const **)pp_src_layers)) { inst->activated_layers_are_std_val = false; - return VK_SUCCESS; // didn't find the key_name in the list. + return VK_SUCCESS; // didn't find the key_name in the list. } - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Found meta layer %s, replacing with actual layer group", - key_name); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Found meta layer %s, replacing with actual layer group", key_name); inst->activated_layers_are_std_val = true; - char const **pp_dst_layers = loader_instance_heap_alloc( - inst, (expand_count + *layer_count - 1) * sizeof(char const *), - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + char const **pp_dst_layers = loader_instance_heap_alloc(inst, (expand_count + *layer_count - 1) * sizeof(char const *), + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); if (NULL == pp_dst_layers) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_expand_layer_names:: Failed to allocate space for " @@ -2307,16 +1790,14 @@ VkResult loader_expand_layer_names( // expand_names. uint32_t src_index, dst_index = 0; for (src_index = 0; src_index < *layer_count; src_index++) { - if (loader_find_layer_name_array(pp_src_layers[src_index], expand_count, - expand_names)) { + if (loader_find_layer_name_array(pp_src_layers[src_index], expand_count, expand_names)) { continue; } if (!strcmp(pp_src_layers[src_index], key_name)) { // insert all expand_names in place of key_name uint32_t expand_index; - for (expand_index = 0; expand_index < expand_count; - expand_index++) { + for (expand_index = 0; expand_index < expand_count; expand_index++) { pp_dst_layers[dst_index++] = expand_names[expand_index]; } continue; @@ -2331,10 +1812,9 @@ VkResult loader_expand_layer_names( return VK_SUCCESS; } -void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, - const VkInstanceCreateInfo *orig, +void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, const VkInstanceCreateInfo *orig, VkInstanceCreateInfo *ours) { - /* Free the layer names array iff we had to reallocate it */ + // Free the layer names array iff we had to reallocate it if (orig->ppEnabledLayerNames != ours->ppEnabledLayerNames) { loader_instance_heap_free(inst, (void *)ours->ppEnabledLayerNames); } @@ -2343,46 +1823,37 @@ void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, void loader_init_std_validation_props(struct loader_layer_properties *props) { memset(props, 0, sizeof(struct loader_layer_properties)); props->type = VK_LAYER_TYPE_META_EXPLICT; - strncpy(props->info.description, "LunarG Standard Validation Layer", - sizeof(props->info.description)); + strncpy(props->info.description, "LunarG Standard Validation Layer", sizeof(props->info.description)); props->info.implementationVersion = 1; - strncpy(props->info.layerName, std_validation_str, - sizeof(props->info.layerName)); + strncpy(props->info.layerName, std_validation_str, sizeof(props->info.layerName)); // TODO what about specVersion? for now insert loader's built version props->info.specVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION); } -/** - * Searches through the existing instance layer lists looking for - * the set of required layer names. If found then it adds a meta property to the - * layer list. - * Assumes the required layers are the same for both instance and device lists. - * @param inst - * @param layer_count number of layers in layer_names - * @param layer_names array of required layer names - * @param layer_instance_list - */ -static void loader_add_layer_property_meta( - const struct loader_instance *inst, uint32_t layer_count, - const char layer_names[][VK_MAX_EXTENSION_NAME_SIZE], - struct loader_layer_list *layer_instance_list) { +// Searches through the existing instance layer lists looking for +// the set of required layer names. If found then it adds a meta property to the +// layer list. +// Assumes the required layers are the same for both instance and device lists. +// @param inst +// @param layer_count number of layers in layer_names +// @param layer_names array of required layer names +// @param layer_instance_list +static void loader_add_layer_property_meta(const struct loader_instance *inst, uint32_t layer_count, + const char layer_names[][VK_MAX_EXTENSION_NAME_SIZE], + struct loader_layer_list *layer_instance_list) { uint32_t i; bool found; struct loader_layer_list *layer_list; - if (0 == layer_count || (!layer_instance_list)) - return; - if (layer_instance_list && (layer_count > layer_instance_list->count)) - return; + if (0 == layer_count || (!layer_instance_list)) return; + if (layer_instance_list && (layer_count > layer_instance_list->count)) return; layer_list = layer_instance_list; found = true; - if (layer_list == NULL) - return; + if (layer_list == NULL) return; for (i = 0; i < layer_count; i++) { - if (loader_find_layer_name_list(layer_names[i], layer_list)) - continue; + if (loader_find_layer_name_list(layer_names[i], layer_list)) continue; found = false; break; } @@ -2399,47 +1870,41 @@ static void loader_add_layer_property_meta( } // This structure is used to store the json file version -// in a more managable way. +// in a more manageable way. typedef struct { uint16_t major; uint16_t minor; uint16_t patch; } layer_json_version; -static void -loader_read_json_layer(const struct loader_instance *inst, - struct loader_layer_list *layer_instance_list, - cJSON *layer_node, layer_json_version version, - cJSON *item, cJSON *disable_environment, - bool is_implicit, char *filename) { +static void loader_read_json_layer(const struct loader_instance *inst, struct loader_layer_list *layer_instance_list, + cJSON *layer_node, layer_json_version version, cJSON *item, cJSON *disable_environment, + bool is_implicit, char *filename) { char *temp; char *name, *type, *library_path, *api_version; char *implementation_version, *description; cJSON *ext_item; VkExtensionProperties ext_prop; -/* - * The following are required in the "layer" object: - * (required) "name" - * (required) "type" - * (required) “library_path” - * (required) “api_version” - * (required) “implementation_version” - * (required) “description” - * (required for implicit layers) “disable_environment” - */ - -#define GET_JSON_OBJECT(node, var) \ - { \ - var = cJSON_GetObjectItem(node, #var); \ - if (var == NULL) { \ - layer_node = layer_node->next; \ - loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \ - "Didn't find required layer object %s in manifest " \ - "JSON file, skipping this layer", \ - #var); \ - return; \ - } \ +// The following are required in the "layer" object: +// (required) "name" +// (required) "type" +// (required) “library_path” +// (required) “api_version” +// (required) “implementation_version” +// (required) “description” +// (required for implicit layers) “disable_environment” +#define GET_JSON_OBJECT(node, var) \ + { \ + var = cJSON_GetObjectItem(node, #var); \ + if (var == NULL) { \ + layer_node = layer_node->next; \ + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \ + "Didn't find required layer object %s in manifest " \ + "JSON file, skipping this layer", \ + #var); \ + return; \ + } \ } #define GET_JSON_ITEM(node, var) \ { \ @@ -2481,8 +1946,7 @@ loader_read_json_layer(const struct loader_instance *inst, // Add list entry struct loader_layer_properties *props = NULL; if (!strcmp(type, "DEVICE")) { - loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "Device layers are deprecated skipping this layer"); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Device layers are deprecated skipping this layer"); layer_node = layer_node->next; return; } @@ -2498,8 +1962,7 @@ loader_read_json_layer(const struct loader_instance *inst, // Error already triggered in loader_get_next_layer_property. return; } - props->type = (is_implicit) ? VK_LAYER_TYPE_INSTANCE_IMPLICIT - : VK_LAYER_TYPE_INSTANCE_EXPLICIT; + props->type = (is_implicit) ? VK_LAYER_TYPE_INSTANCE_IMPLICIT : VK_LAYER_TYPE_INSTANCE_EXPLICIT; } if (props == NULL) { @@ -2520,59 +1983,48 @@ loader_read_json_layer(const struct loader_instance *inst, loader_expand_path(library_path, rel_base, MAX_STRING_SIZE, fullpath); } else { // A filename which is assumed in a system directory - loader_get_fullpath(library_path, DEFAULT_VK_LAYERS_PATH, - MAX_STRING_SIZE, fullpath); + loader_get_fullpath(library_path, DEFAULT_VK_LAYERS_PATH, MAX_STRING_SIZE, fullpath); } props->info.specVersion = loader_make_version(api_version); props->info.implementationVersion = atoi(implementation_version); - strncpy((char *)props->info.description, description, - sizeof(props->info.description)); + strncpy((char *)props->info.description, description, sizeof(props->info.description)); props->info.description[sizeof(props->info.description) - 1] = '\0'; if (is_implicit) { if (!disable_environment || !disable_environment->child) { - loader_log( - inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "Didn't find required layer child value disable_environment" - "in manifest JSON file, skipping this layer"); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "Didn't find required layer child value disable_environment" + "in manifest JSON file, skipping this layer"); layer_node = layer_node->next; return; } - strncpy(props->disable_env_var.name, disable_environment->child->string, - sizeof(props->disable_env_var.name)); - props->disable_env_var.name[sizeof(props->disable_env_var.name) - 1] = - '\0'; - strncpy(props->disable_env_var.value, - disable_environment->child->valuestring, - sizeof(props->disable_env_var.value)); - props->disable_env_var.value[sizeof(props->disable_env_var.value) - 1] = - '\0'; + strncpy(props->disable_env_var.name, disable_environment->child->string, sizeof(props->disable_env_var.name)); + props->disable_env_var.name[sizeof(props->disable_env_var.name) - 1] = '\0'; + strncpy(props->disable_env_var.value, disable_environment->child->valuestring, sizeof(props->disable_env_var.value)); + props->disable_env_var.value[sizeof(props->disable_env_var.value) - 1] = '\0'; } -/** -* Now get all optional items and objects and put in list: -* functions -* instance_extensions -* device_extensions -* enable_environment (implicit layers only) -*/ -#define GET_JSON_OBJECT(node, var) \ +// Now get all optional items and objects and put in list: +// functions +// instance_extensions +// device_extensions +// enable_environment (implicit layers only) +#define GET_JSON_OBJECT(node, var) \ { var = cJSON_GetObjectItem(node, #var); } -#define GET_JSON_ITEM(node, var) \ - { \ - item = cJSON_GetObjectItem(node, #var); \ - if (item != NULL) { \ - temp = cJSON_Print(item); \ - if (temp != NULL) { \ - temp[strlen(temp) - 1] = '\0'; \ - var = loader_stack_alloc(strlen(temp) + 1); \ - strcpy(var, &temp[1]); \ - cJSON_Free(temp); \ - } \ - } \ +#define GET_JSON_ITEM(node, var) \ + { \ + item = cJSON_GetObjectItem(node, #var); \ + if (item != NULL) { \ + temp = cJSON_Print(item); \ + if (temp != NULL) { \ + temp[strlen(temp) - 1] = '\0'; \ + var = loader_stack_alloc(strlen(temp) + 1); \ + strcpy(var, &temp[1]); \ + cJSON_Free(temp); \ + } \ + } \ } - cJSON *instance_extensions, *device_extensions, *functions, - *enable_environment; + cJSON *instance_extensions, *device_extensions, *functions, *enable_environment; cJSON *entrypoints = NULL; char *vkGetInstanceProcAddr = NULL; char *vkGetDeviceProcAddr = NULL; @@ -2591,19 +2043,16 @@ loader_read_json_layer(const struct loader_instance *inst, if (version.major > 1 || version.minor >= 1) { GET_JSON_ITEM(functions, vkNegotiateLoaderLayerInterfaceVersion) if (vkNegotiateLoaderLayerInterfaceVersion != NULL) - strncpy(props->functions.str_negotiate_interface, - vkNegotiateLoaderLayerInterfaceVersion, + strncpy(props->functions.str_negotiate_interface, vkNegotiateLoaderLayerInterfaceVersion, sizeof(props->functions.str_negotiate_interface)); - props->functions.str_negotiate_interface - [sizeof(props->functions.str_negotiate_interface) - 1] = '\0'; + props->functions.str_negotiate_interface[sizeof(props->functions.str_negotiate_interface) - 1] = '\0'; } else { props->functions.str_negotiate_interface[0] = '\0'; } GET_JSON_ITEM(functions, vkGetInstanceProcAddr) GET_JSON_ITEM(functions, vkGetDeviceProcAddr) if (vkGetInstanceProcAddr != NULL) { - strncpy(props->functions.str_gipa, vkGetInstanceProcAddr, - sizeof(props->functions.str_gipa)); + strncpy(props->functions.str_gipa, vkGetInstanceProcAddr, sizeof(props->functions.str_gipa)); if (version.major > 1 || version.minor >= 1) { loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Indicating layer-specific vkGetInstanceProcAddr " @@ -2616,8 +2065,7 @@ loader_read_json_layer(const struct loader_instance *inst, } props->functions.str_gipa[sizeof(props->functions.str_gipa) - 1] = '\0'; if (vkGetDeviceProcAddr != NULL) { - strncpy(props->functions.str_gdpa, vkGetDeviceProcAddr, - sizeof(props->functions.str_gdpa)); + strncpy(props->functions.str_gdpa, vkGetDeviceProcAddr, sizeof(props->functions.str_gdpa)); if (version.major > 1 || version.minor >= 1) { loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Indicating layer-specific vkGetDeviceProcAddr " @@ -2643,10 +2091,8 @@ loader_read_json_layer(const struct loader_instance *inst, ext_item = cJSON_GetArrayItem(instance_extensions, i); GET_JSON_ITEM(ext_item, name) if (name != NULL) { - strncpy(ext_prop.extensionName, name, - sizeof(ext_prop.extensionName)); - ext_prop.extensionName[sizeof(ext_prop.extensionName) - 1] = - '\0'; + strncpy(ext_prop.extensionName, name, sizeof(ext_prop.extensionName)); + ext_prop.extensionName[sizeof(ext_prop.extensionName) - 1] = '\0'; } GET_JSON_ITEM(ext_item, spec_version) if (NULL != spec_version) { @@ -2654,11 +2100,9 @@ loader_read_json_layer(const struct loader_instance *inst, } else { ext_prop.specVersion = 0; } - bool ext_unsupported = - wsi_unsupported_instance_extension(&ext_prop); + bool ext_unsupported = wsi_unsupported_instance_extension(&ext_prop); if (!ext_unsupported) { - loader_add_to_ext_list(inst, &props->instance_extension_list, 1, - &ext_prop); + loader_add_to_ext_list(inst, &props->instance_extension_list, 1, &ext_prop); } } } @@ -2677,10 +2121,8 @@ loader_read_json_layer(const struct loader_instance *inst, GET_JSON_ITEM(ext_item, name) GET_JSON_ITEM(ext_item, spec_version) if (name != NULL) { - strncpy(ext_prop.extensionName, name, - sizeof(ext_prop.extensionName)); - ext_prop.extensionName[sizeof(ext_prop.extensionName) - 1] = - '\0'; + strncpy(ext_prop.extensionName, name, sizeof(ext_prop.extensionName)); + ext_prop.extensionName[sizeof(ext_prop.extensionName) - 1] = '\0'; } if (NULL != spec_version) { ext_prop.specVersion = atoi(spec_version); @@ -2691,14 +2133,12 @@ loader_read_json_layer(const struct loader_instance *inst, GET_JSON_OBJECT(ext_item, entrypoints) int entry_count; if (entrypoints == NULL) { - loader_add_to_dev_ext_list(inst, &props->device_extension_list, - &ext_prop, 0, NULL); + loader_add_to_dev_ext_list(inst, &props->device_extension_list, &ext_prop, 0, NULL); continue; } entry_count = cJSON_GetArraySize(entrypoints); if (entry_count) { - entry_array = - (char **)loader_stack_alloc(sizeof(char *) * entry_count); + entry_array = (char **)loader_stack_alloc(sizeof(char *) * entry_count); } for (j = 0; j < entry_count; j++) { ext_item = cJSON_GetArrayItem(entrypoints, j); @@ -2714,8 +2154,7 @@ loader_read_json_layer(const struct loader_instance *inst, cJSON_Free(temp); } } - loader_add_to_dev_ext_list(inst, &props->device_extension_list, - &ext_prop, entry_count, entry_array); + loader_add_to_dev_ext_list(inst, &props->device_extension_list, &ext_prop, entry_count, entry_array); } } if (is_implicit) { @@ -2723,16 +2162,10 @@ loader_read_json_layer(const struct loader_instance *inst, // enable_environment is optional if (enable_environment) { - strncpy(props->enable_env_var.name, - enable_environment->child->string, - sizeof(props->enable_env_var.name)); - props->enable_env_var.name[sizeof(props->enable_env_var.name) - 1] = - '\0'; - strncpy(props->enable_env_var.value, - enable_environment->child->valuestring, - sizeof(props->enable_env_var.value)); - props->enable_env_var - .value[sizeof(props->enable_env_var.value) - 1] = '\0'; + strncpy(props->enable_env_var.name, enable_environment->child->string, sizeof(props->enable_env_var.name)); + props->enable_env_var.name[sizeof(props->enable_env_var.name) - 1] = '\0'; + strncpy(props->enable_env_var.value, enable_environment->child->valuestring, sizeof(props->enable_env_var.value)); + props->enable_env_var.value[sizeof(props->enable_env_var.value) - 1] = '\0'; } } #undef GET_JSON_ITEM @@ -2756,28 +2189,24 @@ static inline bool layer_json_supports_layers_tag(const layer_json_version *laye return false; } -/** - * Given a cJSON struct (json) of the top level JSON object from layer manifest - * file, add entry to the layer_list. Fill out the layer_properties in this list - * entry from the input cJSON object. - * - * \returns - * void - * layer_list has a new entry and initialized accordingly. - * If the json input object does not have all the required fields no entry - * is added to the list. - */ -static void -loader_add_layer_properties(const struct loader_instance *inst, - struct loader_layer_list *layer_instance_list, - cJSON *json, bool is_implicit, char *filename) { +// Given a cJSON struct (json) of the top level JSON object from layer manifest +// file, add entry to the layer_list. Fill out the layer_properties in this list +// entry from the input cJSON object. +// +// \returns +// void +// layer_list has a new entry and initialized accordingly. +// If the json input object does not have all the required fields no entry +// is added to the list. +static void loader_add_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_instance_list, + cJSON *json, bool is_implicit, char *filename) { // The following Fields in layer manifest file that are required: // - “file_format_version” // - If more than one "layer" object are used, then the "layers" array is - // requred + // required cJSON *item, *layers_node, *layer_node; - layer_json_version json_version; + layer_json_version json_version = {0, 0, 0}; char *vers_tok; cJSON *disable_environment = NULL; item = cJSON_GetObjectItem(json, "file_format_version"); @@ -2788,8 +2217,7 @@ loader_add_layer_properties(const struct loader_instance *inst, if (NULL == file_vers) { return; } - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Found manifest file %s, version %s", filename, file_vers); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Found manifest file %s, version %s", filename, file_vers); // Get the major/minor/and patch as integers for easier comparison vers_tok = strtok(file_vers, ".\"\n\r"); if (NULL != vers_tok) { @@ -2808,8 +2236,7 @@ loader_add_layer_properties(const struct loader_instance *inst, loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loader_add_layer_properties: %s invalid layer " " manifest file version %d.%d.%d. May cause errors.", - filename, json_version.major, json_version.minor, - json_version.patch); + filename, json_version.major, json_version.minor, json_version.patch); } cJSON_Free(file_vers); @@ -2834,9 +2261,8 @@ loader_add_layer_properties(const struct loader_instance *inst, curLayer, filename); return; } - loader_read_json_layer(inst, layer_instance_list, layer_node, - json_version, item, disable_environment, - is_implicit, filename); + loader_read_json_layer(inst, layer_instance_list, layer_node, json_version, item, disable_environment, is_implicit, + filename); } } else { // Otherwise, try to read in individual layers @@ -2868,9 +2294,8 @@ loader_add_layer_properties(const struct loader_instance *inst, filename); } else { do { - loader_read_json_layer(inst, layer_instance_list, layer_node, - json_version, item, disable_environment, - is_implicit, filename); + loader_read_json_layer(inst, layer_instance_list, layer_node, json_version, item, disable_environment, is_implicit, + filename); layer_node = layer_node->next; } while (layer_node != NULL); } @@ -2878,39 +2303,34 @@ loader_add_layer_properties(const struct loader_instance *inst, return; } -/** - * Find the Vulkan library manifest files. - * - * This function scans the "location" or "env_override" directories/files - * for a list of JSON manifest files. If env_override is non-NULL - * and has a valid value. Then the location is ignored. Otherwise - * location is used to look for manifest files. The location - * is interpreted as Registry path on Windows and a directory path(s) - * on Linux. "home_location" is an additional directory in the users home - * directory to look at. It is expanded into the dir path - * $XDG_DATA_HOME/home_location or $HOME/.local/share/home_location depending - * on environment variables. This "home_location" is only used on Linux. - * - * \returns - * VKResult - * A string list of manifest files to be opened in out_files param. - * List has a pointer to string for each manifest filename. - * When done using the list in out_files, pointers should be freed. - * Location or override string lists can be either files or directories as - *follows: - * | location | override - * -------------------------------- - * Win ICD | files | files - * Win Layer | files | dirs - * Linux ICD | dirs | files - * Linux Layer| dirs | dirs - */ -static VkResult -loader_get_manifest_files(const struct loader_instance *inst, - const char *env_override, const char *source_override, - bool is_layer, bool warn_if_not_present, - const char *location, const char *home_location, - struct loader_manifest_files *out_files) { +// Find the Vulkan library manifest files. +// +// This function scans the "location" or "env_override" directories/files +// for a list of JSON manifest files. If env_override is non-NULL +// and has a valid value. Then the location is ignored. Otherwise +// location is used to look for manifest files. The location +// is interpreted as Registry path on Windows and a directory path(s) +// on Linux. "home_location" is an additional directory in the users home +// directory to look at. It is expanded into the dir path +// $XDG_DATA_HOME/home_location or $HOME/.local/share/home_location depending +// on environment variables. This "home_location" is only used on Linux. +// +// \returns +// VKResult +// A string list of manifest files to be opened in out_files param. +// List has a pointer to string for each manifest filename. +// When done using the list in out_files, pointers should be freed. +// Location or override string lists can be either files or directories as +//follows: +// | location | override +// -------------------------------- +// Win ICD | files | files +// Win Layer | files | dirs +// Linux ICD | dirs | files +// Linux Layer| dirs | dirs +static VkResult loader_get_manifest_files(const struct loader_instance *inst, const char *env_override, const char *source_override, + bool is_layer, bool warn_if_not_present, const char *location, const char *relative_location, + struct loader_manifest_files *out_files) { const char * override = NULL; char *override_getenv = NULL; char *loc, *orig_loc = NULL; @@ -2931,19 +2351,19 @@ loader_get_manifest_files(const struct loader_instance *inst, } else if (env_override != NULL) { #if !defined(_WIN32) if (geteuid() != getuid() || getegid() != getgid()) { - /* Don't allow setuid apps to use the env var: */ + // Don't allow setuid apps to use the env var: env_override = NULL; } #endif if (env_override != NULL) { - override = override_getenv = loader_getenv(env_override, inst); + override = override_getenv = loader_secure_getenv(env_override, inst); } } #if !defined(_WIN32) - if (location == NULL && home_location == NULL) { + if (relative_location == NULL) { #else - home_location = NULL; + relative_location = NULL; if (location == NULL) { #endif loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -2962,26 +2382,115 @@ loader_get_manifest_files(const struct loader_instance *inst, // Make a copy of the input we are using so it is not modified // Also handle getting the location(s) from registry on Windows if (override == NULL) { - loc = loader_stack_alloc(strlen(location) + 1); + size_t loc_size = 0; +#if !defined(_WIN32) + const char *xdgconfdirs = loader_secure_getenv("XDG_CONFIG_DIRS", inst); + const char *xdgdatadirs = loader_secure_getenv("XDG_DATA_DIRS", inst); + if (xdgconfdirs == NULL || xdgconfdirs[0] == '\0') + xdgconfdirs = FALLBACK_CONFIG_DIRS; + if (xdgdatadirs == NULL || xdgdatadirs[0] == '\0') + xdgdatadirs = FALLBACK_DATA_DIRS; + const size_t rel_size = strlen(relative_location); + // Leave space for trailing separators + loc_size += strlen(xdgconfdirs) + strlen(xdgdatadirs) + 2*rel_size + 2; + for (const char *x = xdgconfdirs; *x; ++x) + if (*x == PATH_SEPARATOR) loc_size += rel_size; + for (const char *x = xdgdatadirs; *x; ++x) + if (*x == PATH_SEPARATOR) loc_size += rel_size; + loc_size += strlen(SYSCONFDIR) + rel_size + 1; +#if defined(EXTRASYSCONFDIR) + loc_size += strlen(EXTRASYSCONFDIR) + rel_size + 1; +#endif +#else + loc_size += strlen(location) + 1; +#endif + loc = loader_stack_alloc(loc_size); if (loc == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_manifest_files: Failed to allocate " "%d bytes for manifest file location.", - strlen(location)); + loc_size); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - strcpy(loc, location); + char *loc_write = loc; +#if !defined(_WIN32) + const char *loc_read; + size_t start, stop; + + loc_read = &xdgconfdirs[0]; + start = 0; + while (loc_read[start] != '\0') { + while (loc_read[start] == PATH_SEPARATOR) { + start++; + } + stop = start; + while (loc_read[stop] != PATH_SEPARATOR && loc_read[stop] != '\0') { + stop++; + } + const size_t s = stop - start; + if (s) { + memcpy(loc_write, &loc_read[start], s); + loc_write += s; + memcpy(loc_write, relative_location, rel_size); + loc_write += rel_size; + *loc_write++ = PATH_SEPARATOR; + start = stop; + } + } + + memcpy(loc_write, SYSCONFDIR, strlen(SYSCONFDIR)); + loc_write += strlen(SYSCONFDIR); + memcpy(loc_write, relative_location, rel_size); + loc_write += rel_size; + *loc_write++ = PATH_SEPARATOR; + +#if defined(EXTRASYSCONFDIR) + memcpy(loc_write, EXTRASYSCONFDIR, strlen(EXTRASYSCONFDIR)); + loc_write += strlen(EXTRASYSCONFDIR); + memcpy(loc_write, relative_location, rel_size); + loc_write += rel_size; + *loc_write++ = PATH_SEPARATOR; +#endif + + loc_read = &xdgdatadirs[0]; + start = 0; + while (loc_read[start] != '\0') { + while (loc_read[start] == PATH_SEPARATOR) { + start++; + } + stop = start; + while (loc_read[stop] != PATH_SEPARATOR && loc_read[stop] != '\0') { + stop++; + } + const size_t s = stop - start; + if (s) { + memcpy(loc_write, &loc_read[start], s); + loc_write += s; + memcpy(loc_write, relative_location, rel_size); + loc_write += rel_size; + *loc_write++ = PATH_SEPARATOR; + start = stop; + } + } + + --loc_write; +#else + memcpy(loc_write, location, strlen(location)); + loc_write += strlen(location); +#endif + assert(loc_write - loc < (ptrdiff_t)loc_size); + *loc_write = '\0'; + #if defined(_WIN32) - VkResult reg_result = loaderGetRegistryFiles(inst, loc, ®); + VkResult reg_result = loaderGetRegistryFiles(inst, loc, is_layer, ®); if (VK_SUCCESS != reg_result || NULL == reg) { if (!is_layer) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_manifest_files: Registry lookup failed " "to get ICD manifest files. Possibly missing Vulkan" " driver?"); - if (VK_SUCCESS == reg_result || - VK_ERROR_OUT_OF_HOST_MEMORY == reg_result) { + if (VK_SUCCESS == reg_result || VK_ERROR_OUT_OF_HOST_MEMORY == reg_result) { res = reg_result; } else { res = VK_ERROR_INCOMPATIBLE_DRIVER; @@ -2989,10 +2498,9 @@ loader_get_manifest_files(const struct loader_instance *inst, } else { if (warn_if_not_present) { // This is only a warning for layers - loader_log( - inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_get_manifest_files: Registry lookup failed " - "to get layer manifest files."); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "loader_get_manifest_files: Registry lookup failed " + "to get layer manifest files."); } if (reg_result == VK_ERROR_OUT_OF_HOST_MEMORY) { res = reg_result; @@ -3009,11 +2517,10 @@ loader_get_manifest_files(const struct loader_instance *inst, } else { loc = loader_stack_alloc(strlen(override) + 1); if (loc == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_get_manifest_files: Failed to allocate space for " - "override environment variable of length %d", - strlen(override) + 1); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_get_manifest_files: Failed to allocate space for " + "override environment variable of length %d", + strlen(override) + 1); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } @@ -3021,8 +2528,7 @@ loader_get_manifest_files(const struct loader_instance *inst, } // Print out the paths being searched if debugging is enabled - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Searching the following paths for manifest files: %s\n", loc); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Searching the following paths for manifest files: %s\n", loc); file = loc; while (*file) { @@ -3032,8 +2538,7 @@ loader_get_manifest_files(const struct loader_instance *inst, name = NULL; if (sysdir) { dent = readdir(sysdir); - if (dent == NULL) - break; + if (dent == NULL) break; name = &(dent->d_name[0]); loader_get_fullpath(name, file, sizeof(full_path), full_path); name = full_path; @@ -3061,20 +2566,17 @@ loader_get_manifest_files(const struct loader_instance *inst, #endif } while (name) { - /* Look for files ending with ".json" suffix */ + // Look for files ending with ".json" suffix uint32_t nlen = (uint32_t)strlen(name); const char *suf = name + nlen - 5; if ((nlen > 5) && !strncmp(suf, ".json", 5)) { if (out_files->count == 0) { - out_files->filename_list = loader_instance_heap_alloc( - inst, alloced_count * sizeof(char *), - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + out_files->filename_list = + loader_instance_heap_alloc(inst, alloced_count * sizeof(char *), VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); } else if (out_files->count == alloced_count) { - out_files->filename_list = loader_instance_heap_realloc( - inst, out_files->filename_list, - alloced_count * sizeof(char *), - alloced_count * sizeof(char *) * 2, - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + out_files->filename_list = + loader_instance_heap_realloc(inst, out_files->filename_list, alloced_count * sizeof(char *), + alloced_count * sizeof(char *) * 2, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); alloced_count *= 2; } if (out_files->filename_list == NULL) { @@ -3085,9 +2587,7 @@ loader_get_manifest_files(const struct loader_instance *inst, goto out; } out_files->filename_list[out_files->count] = - loader_instance_heap_alloc( - inst, strlen(name) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + loader_instance_heap_alloc(inst, strlen(name) + 1, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); if (out_files->filename_list[out_files->count] == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_manifest_files: Failed to allocate " @@ -3099,10 +2599,8 @@ loader_get_manifest_files(const struct loader_instance *inst, strcpy(out_files->filename_list[out_files->count], name); out_files->count++; } else if (!list_is_dirs) { - loader_log( - inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "Skipping manifest file %s, file name must end in .json", - name); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Skipping manifest file %s, file name must end in .json", + name); } if (list_is_dirs) { dent = readdir(sysdir); @@ -3122,14 +2620,12 @@ loader_get_manifest_files(const struct loader_instance *inst, } file = next_file; #if !defined(_WIN32) - if (home_location != NULL && - (next_file == NULL || *next_file == '\0') && override == NULL) { - char *xdgdatahome = secure_getenv("XDG_DATA_HOME"); + if (relative_location != NULL && (next_file == NULL || *next_file == '\0') && override == NULL) { + char *xdgdatahome = loader_secure_getenv("XDG_DATA_HOME", inst); size_t len; if (xdgdatahome != NULL) { - - char *home_loc = loader_stack_alloc(strlen(xdgdatahome) + 2 + - strlen(home_location)); + size_t alloc_len = strlen(xdgdatahome) + 2 + strlen(relative_location); + char *home_loc = loader_stack_alloc(alloc_len); if (home_loc == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_get_manifest_files: Failed to allocate " @@ -3139,59 +2635,53 @@ loader_get_manifest_files(const struct loader_instance *inst, } strcpy(home_loc, xdgdatahome); // Add directory separator if needed - if (home_location[0] != DIRECTORY_SYMBOL) { + if (relative_location[0] != DIRECTORY_SYMBOL) { len = strlen(home_loc); home_loc[len] = DIRECTORY_SYMBOL; home_loc[len + 1] = '\0'; } - strcat(home_loc, home_location); + strncat(home_loc, relative_location, alloc_len); file = home_loc; next_file = loader_get_next_path(file); - home_location = NULL; + relative_location = NULL; - loader_log( - inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Searching the following path for manifest files: %s\n", - home_loc); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Searching the following path for manifest files: %s\n", + home_loc); list_is_dirs = true; } else { - - char *home = secure_getenv("HOME"); + char *home = loader_secure_getenv("HOME", inst); if (home != NULL) { - char *home_loc = loader_stack_alloc(strlen(home) + 16 + - strlen(home_location)); + size_t alloc_len = strlen(home) + 16 + strlen(relative_location); + char *home_loc = loader_stack_alloc(alloc_len); if (home_loc == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_get_manifest_files: Failed to allocate " - "space for manifest file Home location"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_get_manifest_files: Failed to allocate " + "space for manifest file Home location"); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - strcpy(home_loc, home); + strncpy(home_loc, home, alloc_len); len = strlen(home); if (home[len] != DIRECTORY_SYMBOL) { home_loc[len] = DIRECTORY_SYMBOL; home_loc[len + 1] = '\0'; } - strcat(home_loc, ".local/share"); + strncat(home_loc, ".local/share", alloc_len); - if (home_location[0] != DIRECTORY_SYMBOL) { + if (relative_location[0] != DIRECTORY_SYMBOL) { len = strlen(home_loc); home_loc[len] = DIRECTORY_SYMBOL; home_loc[len + 1] = '\0'; } - strcat(home_loc, home_location); + strncat(home_loc, relative_location, alloc_len); file = home_loc; next_file = loader_get_next_path(file); - home_location = NULL; + relative_location = NULL; - loader_log( - inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Searching the following path for manifest files: %s\n", - home_loc); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Searching the following path for manifest files: %s\n", + home_loc); list_is_dirs = true; } else { // without knowing HOME, we just.. give up @@ -3228,20 +2718,18 @@ out: void loader_init_icd_lib_list() {} void loader_destroy_icd_lib_list() {} -/** - * Try to find the Vulkan ICD driver(s). - * - * This function scans the default system loader path(s) or path - * specified by the \c VK_ICD_FILENAMES environment variable in - * order to find loadable VK ICDs manifest files. From these - * manifest files it finds the ICD libraries. - * - * \returns - * Vulkan result - * (on result == VK_SUCCESS) a list of icds that were discovered - */ -VkResult loader_icd_scan(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list) { + +// Try to find the Vulkan ICD driver(s). +// +// This function scans the default system loader path(s) or path +// specified by the \c VK_ICD_FILENAMES environment variable in +// order to find loadable VK ICDs manifest files. From these +// manifest files it finds the ICD libraries. +// +// \returns +// Vulkan result +// (on result == VK_SUCCESS) a list of icds that were discovered +VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list) { char *file_str; uint16_t file_major_vers = 0; uint16_t file_minor_vers = 0; @@ -3261,9 +2749,8 @@ VkResult loader_icd_scan(const struct loader_instance *inst, } // Get a list of manifest files for ICDs - res = loader_get_manifest_files(inst, "VK_ICD_FILENAMES", NULL, false, true, - DEFAULT_VK_DRIVERS_INFO, - HOME_VK_DRIVERS_INFO, &manifest_files); + res = loader_get_manifest_files(inst, "VK_ICD_FILENAMES", NULL, false, true, DEFAULT_VK_DRIVERS_INFO, RELATIVE_VK_DRIVERS_INFO, + &manifest_files); if (VK_SUCCESS != res || manifest_files.count == 0) { goto out; } @@ -3276,10 +2763,16 @@ VkResult loader_icd_scan(const struct loader_instance *inst, } res = loader_get_json(inst, file_str, &json); - if (VK_ERROR_OUT_OF_HOST_MEMORY == res) { - break; - } else if (VK_SUCCESS != res || NULL == json) { - continue; + if (NULL == json || res != VK_SUCCESS) { + if (NULL != json) { + cJSON_Delete(json); + json = NULL; + } + if (res == VK_ERROR_OUT_OF_HOST_MEMORY) { + break; + } else { + continue; + } } cJSON *item, *itemICD; @@ -3296,10 +2789,10 @@ VkResult loader_icd_scan(const struct loader_instance *inst, json = NULL; continue; } + char *file_vers = cJSON_Print(item); if (NULL == file_vers) { - // Only reason the print can fail is if there was an allocation - // issue + // Only reason the print can fail is if there was an allocation issue if (num_good_icds == 0) { res = VK_ERROR_OUT_OF_HOST_MEMORY; } @@ -3311,9 +2804,8 @@ VkResult loader_icd_scan(const struct loader_instance *inst, json = NULL; continue; } - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Found ICD manifest file %s, version %s", file_str, - file_vers); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Found ICD manifest file %s, version %s", file_str, file_vers); + // Get the major/minor/and patch as integers for easier comparison vers_tok = strtok(file_vers, ".\"\n\r"); if (NULL != vers_tok) { @@ -3327,11 +2819,14 @@ VkResult loader_icd_scan(const struct loader_instance *inst, } } } - if (file_major_vers != 1 || file_minor_vers != 0 || file_patch_vers > 1) + + if (file_major_vers != 1 || file_minor_vers != 0 || file_patch_vers > 1) { loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loader_icd_scan: Unexpected manifest file version " "(expected 1.0.0 or 1.0.1), may cause errors"); + } cJSON_Free(file_vers); + itemICD = cJSON_GetObjectItem(json, "ICD"); if (itemICD != NULL) { item = cJSON_GetObjectItem(itemICD, "library_path"); @@ -3378,22 +2873,18 @@ VkResult loader_icd_scan(const struct loader_instance *inst, } char fullpath[MAX_STRING_SIZE]; // Print out the paths being searched if debugging is enabled - loader_log( - inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Searching for ICD drivers named %s, using default dir %s", - library_path, DEFAULT_VK_DRIVERS_PATH); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Searching for ICD drivers named %s, using default dir %s", + library_path, DEFAULT_VK_DRIVERS_PATH); if (loader_platform_is_path(library_path)) { // a relative or absolute path char *name_copy = loader_stack_alloc(strlen(file_str) + 1); char *rel_base; strcpy(name_copy, file_str); rel_base = loader_platform_dirname(name_copy); - loader_expand_path(library_path, rel_base, sizeof(fullpath), - fullpath); + loader_expand_path(library_path, rel_base, sizeof(fullpath), fullpath); } else { // a filename which is assumed in a system directory - loader_get_fullpath(library_path, DEFAULT_VK_DRIVERS_PATH, - sizeof(fullpath), fullpath); + loader_get_fullpath(library_path, DEFAULT_VK_DRIVERS_PATH, sizeof(fullpath), fullpath); } uint32_t vers = 0; @@ -3401,11 +2892,10 @@ VkResult loader_icd_scan(const struct loader_instance *inst, if (item != NULL) { temp = cJSON_Print(item); if (NULL == temp) { - loader_log( - inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_icd_scan: Failed retrieving ICD JSON %s" - " \'api_version\' field. Skipping ICD JSON.", - file_str); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "loader_icd_scan: Failed retrieving ICD JSON %s" + " \'api_version\' field. Skipping ICD JSON.", + file_str); // Only reason the print can fail is if there was an // allocation issue @@ -3427,13 +2917,14 @@ VkResult loader_icd_scan(const struct loader_instance *inst, file_str); } - res = loader_scanned_icd_add(inst, icd_tramp_list, fullpath, - vers); + res = loader_scanned_icd_add(inst, icd_tramp_list, fullpath, vers); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_icd_scan: Failed to add ICD JSON %s. " " Skipping ICD JSON.", fullpath); + cJSON_Delete(json); + json = NULL; continue; } num_good_icds++; @@ -3444,11 +2935,10 @@ VkResult loader_icd_scan(const struct loader_instance *inst, file_str); } } else { - loader_log( - inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_icd_scan: Can not find \'ICD\' object in ICD JSON " - "file %s. Skipping ICD JSON", - file_str); + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "loader_icd_scan: Can not find \'ICD\' object in ICD JSON " + "file %s. Skipping ICD JSON", + file_str); } cJSON_Delete(json); @@ -3460,11 +2950,11 @@ out: if (NULL != json) { cJSON_Delete(json); } + if (NULL != manifest_files.filename_list) { for (uint32_t i = 0; i < manifest_files.count; i++) { if (NULL != manifest_files.filename_list[i]) { - loader_instance_heap_free(inst, - manifest_files.filename_list[i]); + loader_instance_heap_free(inst, manifest_files.filename_list[i]); } } loader_instance_heap_free(inst, manifest_files.filename_list); @@ -3472,14 +2962,13 @@ out: if (lockedMutex) { loader_platform_thread_unlock_mutex(&loader_json_lock); } + return res; } -void loader_layer_scan(const struct loader_instance *inst, - struct loader_layer_list *instance_layers) { +void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers) { char *file_str; - struct loader_manifest_files - manifest_files[2]; // [0] = explicit, [1] = implicit + struct loader_manifest_files manifest_files[2]; // [0] = explicit, [1] = implicit cJSON *json; uint32_t implicit; bool lockedMutex = false; @@ -3487,19 +2976,15 @@ void loader_layer_scan(const struct loader_instance *inst, memset(manifest_files, 0, sizeof(struct loader_manifest_files) * 2); // Get a list of manifest files for explicit layers - if (VK_SUCCESS != - loader_get_manifest_files(inst, LAYERS_PATH_ENV, LAYERS_SOURCE_PATH, - true, true, DEFAULT_VK_ELAYERS_INFO, - HOME_VK_ELAYERS_INFO, &manifest_files[0])) { + if (VK_SUCCESS != loader_get_manifest_files(inst, LAYERS_PATH_ENV, LAYERS_SOURCE_PATH, true, true, DEFAULT_VK_ELAYERS_INFO, + RELATIVE_VK_ELAYERS_INFO, &manifest_files[0])) { goto out; } // Get a list of manifest files for any implicit layers // Pass NULL for environment variable override - implicit layers are not // overridden by LAYERS_PATH_ENV - if (VK_SUCCESS != loader_get_manifest_files(inst, NULL, NULL, true, false, - DEFAULT_VK_ILAYERS_INFO, - HOME_VK_ILAYERS_INFO, + if (VK_SUCCESS != loader_get_manifest_files(inst, NULL, NULL, true, false, DEFAULT_VK_ILAYERS_INFO, RELATIVE_VK_ILAYERS_INFO, &manifest_files[1])) { goto out; } @@ -3517,8 +3002,7 @@ void loader_layer_scan(const struct loader_instance *inst, for (implicit = 0; implicit < 2; implicit++) { for (uint32_t i = 0; i < manifest_files[implicit].count; i++) { file_str = manifest_files[implicit].filename_list[i]; - if (file_str == NULL) - continue; + if (file_str == NULL) continue; // parse file into JSON struct VkResult res = loader_get_json(inst, file_str, &json); @@ -3528,16 +3012,14 @@ void loader_layer_scan(const struct loader_instance *inst, continue; } - loader_add_layer_properties(inst, instance_layers, json, - (implicit == 1), file_str); + loader_add_layer_properties(inst, instance_layers, json, (implicit == 1), file_str); cJSON_Delete(json); } } // add a meta layer for validation if the validation layers are all present - loader_add_layer_property_meta(inst, sizeof(std_validation_names) / - sizeof(std_validation_names[0]), - std_validation_names, instance_layers); + loader_add_layer_property_meta(inst, sizeof(std_validation_names) / sizeof(std_validation_names[0]), std_validation_names, + instance_layers); out: @@ -3545,12 +3027,10 @@ out: if (NULL != manifest_files[manFile].filename_list) { for (uint32_t i = 0; i < manifest_files[manFile].count; i++) { if (NULL != manifest_files[manFile].filename_list[i]) { - loader_instance_heap_free( - inst, manifest_files[manFile].filename_list[i]); + loader_instance_heap_free(inst, manifest_files[manFile].filename_list[i]); } } - loader_instance_heap_free(inst, - manifest_files[manFile].filename_list); + loader_instance_heap_free(inst, manifest_files[manFile].filename_list); } } if (lockedMutex) { @@ -3558,8 +3038,7 @@ out: } } -void loader_implicit_layer_scan(const struct loader_instance *inst, - struct loader_layer_list *instance_layers) { +void loader_implicit_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers) { char *file_str; struct loader_manifest_files manifest_files; cJSON *json; @@ -3567,14 +3046,13 @@ void loader_implicit_layer_scan(const struct loader_instance *inst, // Pass NULL for environment variable override - implicit layers are not // overridden by LAYERS_PATH_ENV - VkResult res = loader_get_manifest_files( - inst, NULL, NULL, true, false, DEFAULT_VK_ILAYERS_INFO, - HOME_VK_ILAYERS_INFO, &manifest_files); + VkResult res = + loader_get_manifest_files(inst, NULL, NULL, true, false, DEFAULT_VK_ILAYERS_INFO, RELATIVE_VK_ILAYERS_INFO, &manifest_files); if (VK_SUCCESS != res || manifest_files.count == 0) { return; } - /* cleanup any previously scanned libraries */ + // Cleanup any previously scanned libraries loader_delete_layer_properties(inst, instance_layers); loader_platform_thread_lock_mutex(&loader_json_lock); @@ -3593,8 +3071,7 @@ void loader_implicit_layer_scan(const struct loader_instance *inst, continue; } - loader_add_layer_properties(inst, instance_layers, json, true, - file_str); + loader_add_layer_properties(inst, instance_layers, json, true, file_str); loader_instance_heap_free(inst, file_str); cJSON_Delete(json); @@ -3602,78 +3079,63 @@ void loader_implicit_layer_scan(const struct loader_instance *inst, loader_instance_heap_free(inst, manifest_files.filename_list); // add a meta layer for validation if the validation layers are all present - loader_add_layer_property_meta(inst, sizeof(std_validation_names) / - sizeof(std_validation_names[0]), - std_validation_names, instance_layers); + loader_add_layer_property_meta(inst, sizeof(std_validation_names) / sizeof(std_validation_names[0]), std_validation_names, + instance_layers); loader_platform_thread_unlock_mutex(&loader_json_lock); } -static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -loader_gpdpa_instance_internal(VkInstance inst, const char *pName) { +static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpdpa_instance_internal(VkInstance inst, const char *pName) { // inst is not wrapped if (inst == VK_NULL_HANDLE) { return NULL; } - VkLayerInstanceDispatchTable *disp_table = - *(VkLayerInstanceDispatchTable **)inst; + VkLayerInstanceDispatchTable *disp_table = *(VkLayerInstanceDispatchTable **)inst; void *addr; - if (disp_table == NULL) - return NULL; + if (disp_table == NULL) return NULL; bool found_name; - addr = - loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); + addr = loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); if (found_name) { return addr; } - if (loader_phys_dev_ext_gpa(loader_get_instance(inst), pName, true, NULL, &addr)) - return addr; + if (loader_phys_dev_ext_gpa(loader_get_instance(inst), pName, true, NULL, &addr)) return addr; // Don't call down the chain, this would be an infinite loop - loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_gpdpa_instance_internal() unrecognized name %s", pName); + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loader_gpdpa_instance_internal() unrecognized name %s", pName); return NULL; } -static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -loader_gpdpa_instance_terminator(VkInstance inst, const char *pName) { +static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpdpa_instance_terminator(VkInstance inst, const char *pName) { // inst is not wrapped if (inst == VK_NULL_HANDLE) { return NULL; } - VkLayerInstanceDispatchTable *disp_table = - *(VkLayerInstanceDispatchTable **)inst; + VkLayerInstanceDispatchTable *disp_table = *(VkLayerInstanceDispatchTable **)inst; void *addr; - if (disp_table == NULL) - return NULL; + if (disp_table == NULL) return NULL; bool found_name; - addr = - loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); + addr = loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); if (found_name) { return addr; } // Get the terminator, but don't perform checking since it should already // have been setup if we get here. - if (loader_phys_dev_ext_gpa(loader_get_instance(inst), pName, false, NULL, - &addr)) { + if (loader_phys_dev_ext_gpa(loader_get_instance(inst), pName, false, NULL, &addr)) { return addr; } // Don't call down the chain, this would be an infinite loop - loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_gpdpa_instance_terminator() unrecognized name %s", - pName); + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loader_gpdpa_instance_terminator() unrecognized name %s", pName); return NULL; } -static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -loader_gpa_instance_internal(VkInstance inst, const char *pName) { +static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_instance_internal(VkInstance inst, const char *pName) { if (!strcmp(pName, "vkGetInstanceProcAddr")) { return (PFN_vkVoidFunction)loader_gpa_instance_internal; } @@ -3691,31 +3153,31 @@ loader_gpa_instance_internal(VkInstance inst, const char *pName) { if (inst == VK_NULL_HANDLE) { return NULL; } - VkLayerInstanceDispatchTable *disp_table = - *(VkLayerInstanceDispatchTable **)inst; + VkLayerInstanceDispatchTable *disp_table = *(VkLayerInstanceDispatchTable **)inst; void *addr; - if (disp_table == NULL) - return NULL; + if (disp_table == NULL) return NULL; bool found_name; - addr = - loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); + addr = loader_lookup_instance_dispatch_table(disp_table, pName, &found_name); if (found_name) { return addr; } // Don't call down the chain, this would be an infinite loop - loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "loader_gpa_instance_internal() unrecognized name %s", pName); + loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loader_gpa_instance_internal() unrecognized name %s", pName); return NULL; } -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -loader_gpa_device_internal(VkDevice device, const char *pName) { +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_device_internal(VkDevice device, const char *pName) { struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, NULL); + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL); + + // Return this function if a layer above here is asking for the vkGetDeviceProcAddr. + // This is so we can properly intercept any device commands needing a terminator. + if (!strcmp(pName, "vkGetDeviceProcAddr")) { + return (PFN_vkVoidFunction)loader_gpa_device_internal; + } // NOTE: Device Funcs needing Trampoline/Terminator. // Overrides for device functions needing a trampoline and @@ -3725,81 +3187,55 @@ loader_gpa_device_internal(VkDevice device, const char *pName) { // object before passing the appropriate info along to the ICD. // This is why we also have to override the direct ICD call to // vkGetDeviceProcAddr to intercept those calls. - if (!strcmp(pName, "vkGetDeviceProcAddr")) { - return (PFN_vkVoidFunction)loader_gpa_device_internal; - } else if (!strcmp(pName, "vkCreateSwapchainKHR")) { - return (PFN_vkVoidFunction)terminator_vkCreateSwapchainKHR; - } else if (!strcmp(pName, "vkCreateSharedSwapchainsKHR")) { - return (PFN_vkVoidFunction)terminator_vkCreateSharedSwapchainsKHR; - } else if (!strcmp(pName, "vkDebugMarkerSetObjectTagEXT")) { - return (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectTagEXT; - } else if (!strcmp(pName, "vkDebugMarkerSetObjectNameEXT")) { - return (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectNameEXT; + PFN_vkVoidFunction addr = get_extension_device_proc_terminator(pName); + if (NULL != addr) { + return addr; } - return icd_term->GetDeviceProcAddr(device, pName); + return icd_term->dispatch.GetDeviceProcAddr(device, pName); } -/** - * Initialize device_ext dispatch table entry as follows: - * If dev == NULL find all logical devices created within this instance and - * init the entry (given by idx) in the ext dispatch table. - * If dev != NULL only initialize the entry in the given dev's dispatch table. - * The initialization value is gotten by calling down the device chain with - * GDPA. - * If GDPA returns NULL then don't initialize the dispatch table entry. - */ -static void loader_init_dispatch_dev_ext_entry(struct loader_instance *inst, - struct loader_device *dev, - uint32_t idx, +// Initialize device_ext dispatch table entry as follows: +// If dev == NULL find all logical devices created within this instance and +// init the entry (given by idx) in the ext dispatch table. +// If dev != NULL only initialize the entry in the given dev's dispatch table. +// The initialization value is gotten by calling down the device chain with +// GDPA. +// If GDPA returns NULL then don't initialize the dispatch table entry. +static void loader_init_dispatch_dev_ext_entry(struct loader_instance *inst, struct loader_device *dev, uint32_t idx, const char *funcName) { void *gdpa_value; if (dev != NULL) { - gdpa_value = dev->loader_dispatch.core_dispatch.GetDeviceProcAddr( - dev->chain_device, funcName); - if (gdpa_value != NULL) - dev->loader_dispatch.ext_dispatch.dev_ext[idx] = - (PFN_vkDevExt)gdpa_value; + gdpa_value = dev->loader_dispatch.core_dispatch.GetDeviceProcAddr(dev->chain_device, funcName); + if (gdpa_value != NULL) dev->loader_dispatch.ext_dispatch.dev_ext[idx] = (PFN_vkDevExt)gdpa_value; } else { - for (struct loader_icd_term *icd_term = inst->icd_terms; - icd_term != NULL; icd_term = icd_term->next) { + for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; icd_term = icd_term->next) { struct loader_device *ldev = icd_term->logical_device_list; while (ldev) { - gdpa_value = - ldev->loader_dispatch.core_dispatch.GetDeviceProcAddr( - ldev->chain_device, funcName); - if (gdpa_value != NULL) - ldev->loader_dispatch.ext_dispatch.dev_ext[idx] = - (PFN_vkDevExt)gdpa_value; + gdpa_value = ldev->loader_dispatch.core_dispatch.GetDeviceProcAddr(ldev->chain_device, funcName); + if (gdpa_value != NULL) ldev->loader_dispatch.ext_dispatch.dev_ext[idx] = (PFN_vkDevExt)gdpa_value; ldev = ldev->next; } } } } -/** - * Find all dev extension in the hash table and initialize the dispatch table - * for dev for each of those extension entrypoints found in hash table. - - */ -void loader_init_dispatch_dev_ext(struct loader_instance *inst, - struct loader_device *dev) { +// Find all dev extension in the hash table and initialize the dispatch table +// for dev for each of those extension entrypoints found in hash table. +void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev) { for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) { if (inst->dev_ext_disp_hash[i].func_name != NULL) - loader_init_dispatch_dev_ext_entry(inst, dev, i, - inst->dev_ext_disp_hash[i].func_name); + loader_init_dispatch_dev_ext_entry(inst, dev, i, inst->dev_ext_disp_hash[i].func_name); } } -static bool loader_check_icds_for_dev_ext_address(struct loader_instance *inst, - const char *funcName) { +static bool loader_check_icds_for_dev_ext_address(struct loader_instance *inst, const char *funcName) { struct loader_icd_term *icd_term; icd_term = inst->icd_terms; while (NULL != icd_term) { - if (icd_term->scanned_icd->GetInstanceProcAddr(icd_term->instance, - funcName)) + if (icd_term->scanned_icd->GetInstanceProcAddr(icd_term->instance, funcName)) // this icd supports funcName return true; icd_term = icd_term->next; @@ -3808,20 +3244,15 @@ static bool loader_check_icds_for_dev_ext_address(struct loader_instance *inst, return false; } -static bool loader_check_layer_list_for_dev_ext_address( - const struct loader_layer_list *const layers, const char *funcName) { +static bool loader_check_layer_list_for_dev_ext_address(const struct loader_layer_list *const layers, const char *funcName) { // Iterate over the layers. for (uint32_t layer = 0; layer < layers->count; ++layer) { // Iterate over the extensions. - const struct loader_device_extension_list *const extensions = - &(layers->list[layer].device_extension_list); - for (uint32_t extension = 0; extension < extensions->count; - ++extension) { + const struct loader_device_extension_list *const extensions = &(layers->list[layer].device_extension_list); + for (uint32_t extension = 0; extension < extensions->count; ++extension) { // Iterate over the entry points. - const struct loader_dev_ext_props *const property = - &(extensions->list[extension]); - for (uint32_t entry = 0; entry < property->entrypoint_count; - ++entry) { + const struct loader_dev_ext_props *const property = &(extensions->list[extension]); + for (uint32_t entry = 0; entry < property->entrypoint_count; ++entry) { if (strcmp(property->entrypoints[entry], funcName) == 0) { return true; } @@ -3840,8 +3271,7 @@ static void loader_free_dev_ext_table(struct loader_instance *inst) { memset(inst->dev_ext_disp_hash, 0, sizeof(inst->dev_ext_disp_hash)); } -static bool loader_add_dev_ext_table(struct loader_instance *inst, - uint32_t *ptr_idx, const char *funcName) { +static bool loader_add_dev_ext_table(struct loader_instance *inst, uint32_t *ptr_idx, const char *funcName) { uint32_t i; uint32_t idx = *ptr_idx; struct loader_dispatch_hash_list *list = &inst->dev_ext_disp_hash[idx].list; @@ -3850,9 +3280,7 @@ static bool loader_add_dev_ext_table(struct loader_instance *inst, // no entry here at this idx, so use it assert(list->capacity == 0); inst->dev_ext_disp_hash[idx].func_name = - (char *)loader_instance_heap_alloc( - inst, strlen(funcName) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + (char *)loader_instance_heap_alloc(inst, strlen(funcName) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (inst->dev_ext_disp_hash[idx].func_name == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_dev_ext_table: Failed to allocate memory " @@ -3860,16 +3288,13 @@ static bool loader_add_dev_ext_table(struct loader_instance *inst, funcName); return false; } - strncpy(inst->dev_ext_disp_hash[idx].func_name, funcName, - strlen(funcName) + 1); + strncpy(inst->dev_ext_disp_hash[idx].func_name, funcName, strlen(funcName) + 1); return true; } // check for enough capacity if (list->capacity == 0) { - list->index = - loader_instance_heap_alloc(inst, 8 * sizeof(*(list->index)), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list->index = loader_instance_heap_alloc(inst, 8 * sizeof(*(list->index)), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list->index == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_dev_ext_table: Failed to allocate memory " @@ -3879,9 +3304,8 @@ static bool loader_add_dev_ext_table(struct loader_instance *inst, } list->capacity = 8 * sizeof(*(list->index)); } else if (list->capacity < (list->count + 1) * sizeof(*(list->index))) { - list->index = loader_instance_heap_realloc( - inst, list->index, list->capacity, list->capacity * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list->index = loader_instance_heap_realloc(inst, list->index, list->capacity, list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list->index == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_dev_ext_table: Failed to reallocate memory " @@ -3898,19 +3322,15 @@ static bool loader_add_dev_ext_table(struct loader_instance *inst, if (!inst->dev_ext_disp_hash[i].func_name) { assert(inst->dev_ext_disp_hash[i].list.capacity == 0); inst->dev_ext_disp_hash[i].func_name = - (char *)loader_instance_heap_alloc( - inst, strlen(funcName) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + (char *)loader_instance_heap_alloc(inst, strlen(funcName) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (inst->dev_ext_disp_hash[i].func_name == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_dev_ext_table: Failed to allocate memory " - "for func_name %s", - funcName); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_add_dev_ext_table: Failed to allocate memory " + "for func_name %s", + funcName); return false; } - strncpy(inst->dev_ext_disp_hash[i].func_name, funcName, - strlen(funcName) + 1); + strncpy(inst->dev_ext_disp_hash[i].func_name, funcName, strlen(funcName) + 1); list->index[list->count] = i; list->count++; *ptr_idx = i; @@ -3919,20 +3339,16 @@ static bool loader_add_dev_ext_table(struct loader_instance *inst, i = (i + 1) % MAX_NUM_UNKNOWN_EXTS; } while (i != idx); - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_dev_ext_table: Could not insert into hash table; is " - "it full?"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_add_dev_ext_table: Could not insert into hash table; is " + "it full?"); return false; } -static bool loader_name_in_dev_ext_table(struct loader_instance *inst, - uint32_t *idx, const char *funcName) { +static bool loader_name_in_dev_ext_table(struct loader_instance *inst, uint32_t *idx, const char *funcName) { uint32_t alt_idx; - if (inst->dev_ext_disp_hash[*idx].func_name && - !strcmp(inst->dev_ext_disp_hash[*idx].func_name, funcName)) - return true; + if (inst->dev_ext_disp_hash[*idx].func_name && !strcmp(inst->dev_ext_disp_hash[*idx].func_name, funcName)) return true; // funcName wasn't at the primary spot in the hash table // search the list of secondary locations (shallow search, not deep search) @@ -3947,24 +3363,22 @@ static bool loader_name_in_dev_ext_table(struct loader_instance *inst, return false; } -/** - * This function returns generic trampoline code address for unknown entry - * points. - * Presumably, these unknown entry points (as given by funcName) are device - * extension entrypoints. A hash table is used to keep a list of unknown entry - * points and their mapping to the device extension dispatch table - * (struct loader_dev_ext_dispatch_table). - * \returns - * For a given entry point string (funcName), if an existing mapping is found - * the - * trampoline address for that mapping is returned. Otherwise, this unknown - * entry point - * has not been seen yet. Next check if a layer or ICD supports it. If so then - * a - * new entry in the hash table is initialized and that trampoline address for - * the new entry is returned. Null is returned if the hash table is full or - * if no discovered layer or ICD returns a non-NULL GetProcAddr for it. - */ +// This function returns generic trampoline code address for unknown entry +// points. +// Presumably, these unknown entry points (as given by funcName) are device +// extension entrypoints. A hash table is used to keep a list of unknown entry +// points and their mapping to the device extension dispatch table +// (struct loader_dev_ext_dispatch_table). +// \returns +// For a given entry point string (funcName), if an existing mapping is found +// the +// trampoline address for that mapping is returned. Otherwise, this unknown +// entry point +// has not been seen yet. Next check if a layer or ICD supports it. If so then +// a +// new entry in the hash table is initialized and that trampoline address for +// the new entry is returned. Null is returned if the hash table is full or +// if no discovered layer or ICD returns a non-NULL GetProcAddr for it. void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName) { uint32_t idx; uint32_t seed = 0; @@ -3984,7 +3398,7 @@ void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName) { if (loader_add_dev_ext_table(inst, &idx, funcName)) { // successfully added new table entry - // init any dev dispatch table entrys as needed + // init any dev dispatch table entries as needed loader_init_dispatch_dev_ext_entry(inst, NULL, idx, funcName); return loader_get_dev_ext_trampoline(idx); } @@ -3992,16 +3406,12 @@ void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName) { return NULL; } -static bool -loader_check_icds_for_phys_dev_ext_address(struct loader_instance *inst, - const char *funcName) { +static bool loader_check_icds_for_phys_dev_ext_address(struct loader_instance *inst, const char *funcName) { struct loader_icd_term *icd_term; icd_term = inst->icd_terms; while (NULL != icd_term) { - if (icd_term->scanned_icd->interface_version >= - MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION && - icd_term->scanned_icd->GetPhysicalDeviceProcAddr(icd_term->instance, - funcName)) + if (icd_term->scanned_icd->interface_version >= MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION && + icd_term->scanned_icd->GetPhysicalDeviceProcAddr(icd_term->instance, funcName)) // this icd supports funcName return true; icd_term = icd_term->next; @@ -4010,21 +3420,15 @@ loader_check_icds_for_phys_dev_ext_address(struct loader_instance *inst, return false; } -static bool -loader_check_layer_list_for_phys_dev_ext_address(struct loader_instance *inst, - const char *funcName) { - struct loader_layer_properties *layer_prop_list = - inst->activated_layer_list.list; +static bool loader_check_layer_list_for_phys_dev_ext_address(struct loader_instance *inst, const char *funcName) { + struct loader_layer_properties *layer_prop_list = inst->activated_layer_list.list; for (uint32_t layer = 0; layer < inst->activated_layer_list.count; ++layer) { // If this layer supports the vk_layerGetPhysicalDeviceProcAddr, then call // it and see if it returns a valid pointer for this function name. if (layer_prop_list[layer].interface_version > 1) { - const struct loader_layer_functions *const functions = - &(layer_prop_list[layer].functions); + const struct loader_layer_functions *const functions = &(layer_prop_list[layer].functions); if (NULL != functions->get_physical_device_proc_addr && - NULL != - functions->get_physical_device_proc_addr((VkInstance)inst, - funcName)) { + NULL != functions->get_physical_device_proc_addr((VkInstance)inst, funcName)) { return true; } } @@ -4033,65 +3437,47 @@ loader_check_layer_list_for_phys_dev_ext_address(struct loader_instance *inst, return false; } - static void loader_free_phys_dev_ext_table(struct loader_instance *inst) { for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) { - loader_instance_heap_free(inst, - inst->phys_dev_ext_disp_hash[i].func_name); - loader_instance_heap_free(inst, - inst->phys_dev_ext_disp_hash[i].list.index); + loader_instance_heap_free(inst, inst->phys_dev_ext_disp_hash[i].func_name); + loader_instance_heap_free(inst, inst->phys_dev_ext_disp_hash[i].list.index); } - memset(inst->phys_dev_ext_disp_hash, 0, - sizeof(inst->phys_dev_ext_disp_hash)); + memset(inst->phys_dev_ext_disp_hash, 0, sizeof(inst->phys_dev_ext_disp_hash)); } -static bool loader_add_phys_dev_ext_table(struct loader_instance *inst, - uint32_t *ptr_idx, - const char *funcName) { +static bool loader_add_phys_dev_ext_table(struct loader_instance *inst, uint32_t *ptr_idx, const char *funcName) { uint32_t i; uint32_t idx = *ptr_idx; - struct loader_dispatch_hash_list *list = - &inst->phys_dev_ext_disp_hash[idx].list; + struct loader_dispatch_hash_list *list = &inst->phys_dev_ext_disp_hash[idx].list; if (!inst->phys_dev_ext_disp_hash[idx].func_name) { // no entry here at this idx, so use it assert(list->capacity == 0); inst->phys_dev_ext_disp_hash[idx].func_name = - (char *)loader_instance_heap_alloc( - inst, strlen(funcName) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + (char *)loader_instance_heap_alloc(inst, strlen(funcName) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (inst->phys_dev_ext_disp_hash[idx].func_name == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_phys_dev_ext_table() can't allocate memory for " - "func_name"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_add_phys_dev_ext_table() can't allocate memory for " + "func_name"); return false; } - strncpy(inst->phys_dev_ext_disp_hash[idx].func_name, funcName, - strlen(funcName) + 1); + strncpy(inst->phys_dev_ext_disp_hash[idx].func_name, funcName, strlen(funcName) + 1); return true; } // check for enough capacity if (list->capacity == 0) { - list->index = - loader_instance_heap_alloc(inst, 8 * sizeof(*(list->index)), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list->index = loader_instance_heap_alloc(inst, 8 * sizeof(*(list->index)), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list->index == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_phys_dev_ext_table() can't allocate list memory"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_phys_dev_ext_table() can't allocate list memory"); return false; } list->capacity = 8 * sizeof(*(list->index)); } else if (list->capacity < (list->count + 1) * sizeof(*(list->index))) { - list->index = loader_instance_heap_realloc( - inst, list->index, list->capacity, list->capacity * 2, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + list->index = loader_instance_heap_realloc(inst, list->index, list->capacity, list->capacity * 2, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (list->index == NULL) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_phys_dev_ext_table() can't reallocate list memory"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_add_phys_dev_ext_table() can't reallocate list memory"); return false; } list->capacity *= 2; @@ -4103,17 +3489,14 @@ static bool loader_add_phys_dev_ext_table(struct loader_instance *inst, if (!inst->phys_dev_ext_disp_hash[i].func_name) { assert(inst->phys_dev_ext_disp_hash[i].list.capacity == 0); inst->phys_dev_ext_disp_hash[i].func_name = - (char *)loader_instance_heap_alloc( - inst, strlen(funcName) + 1, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + (char *)loader_instance_heap_alloc(inst, strlen(funcName) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (inst->phys_dev_ext_disp_hash[i].func_name == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_dev_ext_table() can't rallocate " + "loader_add_dev_ext_table() can't reallocate " "func_name memory"); return false; } - strncpy(inst->phys_dev_ext_disp_hash[i].func_name, funcName, - strlen(funcName) + 1); + strncpy(inst->phys_dev_ext_disp_hash[i].func_name, funcName, strlen(funcName) + 1); list->index[list->count] = i; list->count++; *ptr_idx = i; @@ -4122,24 +3505,20 @@ static bool loader_add_phys_dev_ext_table(struct loader_instance *inst, i = (i + 1) % MAX_NUM_UNKNOWN_EXTS; } while (i != idx); - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_add_phys_dev_ext_table() couldn't insert into hash table; is " - "it full?"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_add_phys_dev_ext_table() couldn't insert into hash table; is " + "it full?"); return false; } -static bool loader_name_in_phys_dev_ext_table(struct loader_instance* inst, - uint32_t *idx, const char *funcName) { +static bool loader_name_in_phys_dev_ext_table(struct loader_instance *inst, uint32_t *idx, const char *funcName) { uint32_t alt_idx; - if (inst->phys_dev_ext_disp_hash[*idx].func_name && - !strcmp(inst->phys_dev_ext_disp_hash[*idx].func_name, funcName)) + if (inst->phys_dev_ext_disp_hash[*idx].func_name && !strcmp(inst->phys_dev_ext_disp_hash[*idx].func_name, funcName)) return true; // funcName wasn't at the primary spot in the hash table // search the list of secondary locations (shallow search, not deep search) - for (uint32_t i = 0; i < inst->phys_dev_ext_disp_hash[*idx].list.count; - i++) { + for (uint32_t i = 0; i < inst->phys_dev_ext_disp_hash[*idx].list.count; i++) { alt_idx = inst->phys_dev_ext_disp_hash[*idx].list.index[i]; if (!strcmp(inst->phys_dev_ext_disp_hash[*idx].func_name, funcName)) { *idx = alt_idx; @@ -4166,8 +3545,7 @@ static bool loader_name_in_phys_dev_ext_table(struct loader_instance* inst, // addresses are returned. // Null is returned if the hash table is full or if no discovered layer or // ICD returns a non-NULL GetProcAddr for it. -bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, - bool perform_checking, void **tramp_addr, +bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr, void **term_addr) { uint32_t idx; uint32_t seed = 0; @@ -4188,15 +3566,13 @@ bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, if (!loader_check_icds_for_phys_dev_ext_address(inst, funcName)) { // If we're not checking layers, or we are and it's not in a layer, just // return - if (!perform_checking || - !loader_check_layer_list_for_phys_dev_ext_address(inst, funcName)) { + if (!perform_checking || !loader_check_layer_list_for_phys_dev_ext_address(inst, funcName)) { goto out; } } idx = murmurhash(funcName, strlen(funcName), seed) % MAX_NUM_UNKNOWN_EXTS; - if (perform_checking && - !loader_name_in_phys_dev_ext_table(inst, &idx, funcName)) { + if (perform_checking && !loader_name_in_phys_dev_ext_table(inst, &idx, funcName)) { uint32_t i; bool added = false; @@ -4209,19 +3585,15 @@ bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, // Setup the ICD function pointers struct loader_icd_term *icd_term = inst->icd_terms; while (NULL != icd_term) { - if (MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION <= - icd_term->scanned_icd->interface_version && + if (MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION <= icd_term->scanned_icd->interface_version && NULL != icd_term->scanned_icd->GetPhysicalDeviceProcAddr) { icd_term->phys_dev_ext[idx] = - (PFN_PhysDevExt) - icd_term->scanned_icd->GetPhysicalDeviceProcAddr( - icd_term->instance, funcName); + (PFN_PhysDevExt)icd_term->scanned_icd->GetPhysicalDeviceProcAddr(icd_term->instance, funcName); // Make sure we set the instance dispatch to point to the // loader's terminator now since we can at least handle it // in one ICD. - inst->disp->phys_dev_ext[idx] = - loader_get_phys_dev_ext_termin(idx); + inst->disp->phys_dev_ext[idx] = loader_get_phys_dev_ext_termin(idx); } else { icd_term->phys_dev_ext[idx] = NULL; } @@ -4232,14 +3604,10 @@ bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, // Now, search for the first layer attached and query using it to get // the first entry point. for (i = 0; i < inst->activated_layer_list.count; i++) { - struct loader_layer_properties *layer_prop = - &inst->activated_layer_list.list[i]; - if (layer_prop->interface_version > 1 && - NULL != layer_prop->functions.get_physical_device_proc_addr) { + struct loader_layer_properties *layer_prop = &inst->activated_layer_list.list[i]; + if (layer_prop->interface_version > 1 && NULL != layer_prop->functions.get_physical_device_proc_addr) { inst->disp->phys_dev_ext[idx] = - (PFN_PhysDevExt) - layer_prop->functions.get_physical_device_proc_addr( - (VkInstance)inst, funcName); + (PFN_PhysDevExt)layer_prop->functions.get_physical_device_proc_addr((VkInstance)inst, funcName); if (NULL != inst->disp->phys_dev_ext[idx]) { break; } @@ -4262,15 +3630,13 @@ out: } struct loader_instance *loader_get_instance(const VkInstance instance) { - /* look up the loader_instance in our list by comparing dispatch tables, as - * there is no guarantee the instance is still a loader_instance* after any - * layers which wrap the instance object. - */ + // look up the loader_instance in our list by comparing dispatch tables, as + // there is no guarantee the instance is still a loader_instance* after any + // layers which wrap the instance object. const VkLayerInstanceDispatchTable *disp; struct loader_instance *ptr_instance = NULL; disp = loader_get_instance_layer_dispatch(instance); - for (struct loader_instance *inst = loader.instances; inst; - inst = inst->next) { + for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) { if (&inst->disp->layer_inst_disp == disp) { ptr_instance = inst; break; @@ -4279,39 +3645,28 @@ struct loader_instance *loader_get_instance(const VkInstance instance) { return ptr_instance; } -static loader_platform_dl_handle -loader_open_layer_lib(const struct loader_instance *inst, - const char *chain_type, - struct loader_layer_properties *prop) { - - if ((prop->lib_handle = loader_platform_open_library(prop->lib_name)) == - NULL) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_open_layer_lib: Failed to open library %s", - prop->lib_name); +static loader_platform_dl_handle loader_open_layer_lib(const struct loader_instance *inst, const char *chain_type, + struct loader_layer_properties *prop) { + if ((prop->lib_handle = loader_platform_open_library(prop->lib_name)) == NULL) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_open_layer_lib: Failed to open library %s", prop->lib_name); } else { - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Loading layer library %s", prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Loading layer library %s", prop->lib_name); } return prop->lib_handle; } -static void loader_close_layer_lib(const struct loader_instance *inst, - struct loader_layer_properties *prop) { - +static void loader_close_layer_lib(const struct loader_instance *inst, struct loader_layer_properties *prop) { if (prop->lib_handle) { loader_platform_close_library(prop->lib_handle); - loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Unloading layer library %s", prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Unloading layer library %s", prop->lib_name); prop->lib_handle = NULL; } } -void loader_deactivate_layers(const struct loader_instance *instance, - struct loader_device *device, +void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list) { - /* delete instance list of enabled layers and close any layer libraries */ + // Delete instance list of enabled layers and close any layer libraries for (uint32_t i = 0; i < list->count; i++) { struct loader_layer_properties *layer_prop = &list->list[i]; @@ -4320,22 +3675,17 @@ void loader_deactivate_layers(const struct loader_instance *instance, loader_destroy_layer_list(instance, device, list); } -/** - * Go through the search_list and find any layers which match type. If layer - * type match is found in then add it to ext_list. - */ -static void -loader_add_layer_implicit(const struct loader_instance *inst, - const enum layer_type type, - struct loader_layer_list *list, - const struct loader_layer_list *search_list) { +// Go through the search_list and find any layers which match type. If layer +// type match is found in then add it to ext_list. +static void loader_add_layer_implicit(const struct loader_instance *inst, const enum layer_type type, + struct loader_layer_list *list, const struct loader_layer_list *search_list) { bool enable; char *env_value; uint32_t i; for (i = 0; i < search_list->count; i++) { const struct loader_layer_properties *prop = &search_list->list[i]; if (prop->type & type) { - /* Found an implicit layer, see if it should be enabled */ + // Found an implicit layer, see if it should be enabled enable = false; // if no enable_environment variable is specified, this implicit @@ -4344,9 +3694,8 @@ loader_add_layer_implicit(const struct loader_instance *inst, if (prop->enable_env_var.name[0] == 0) { enable = true; } else { - env_value = loader_getenv(prop->enable_env_var.name, inst); - if (env_value && !strcmp(prop->enable_env_var.value, env_value)) - enable = true; + env_value = loader_secure_getenv(prop->enable_env_var.name, inst); + if (env_value && !strcmp(prop->enable_env_var.value, env_value)) enable = true; loader_free_getenv(env_value, inst); } @@ -4354,7 +3703,7 @@ loader_add_layer_implicit(const struct loader_instance *inst, // environment variables are set, the layer is disabled. Implicit // layers // are required to have a disable_environment variables - env_value = loader_getenv(prop->disable_env_var.name, inst); + env_value = loader_secure_getenv(prop->disable_env_var.name, inst); if (env_value) { enable = false; } @@ -4367,20 +3716,15 @@ loader_add_layer_implicit(const struct loader_instance *inst, } } -/** - * Get the layer name(s) from the env_name environment variable. If layer - * is found in search_list then add it to layer_list. But only add it to - * layer_list if type matches. - */ -static void loader_add_layer_env(struct loader_instance *inst, - const enum layer_type type, - const char *env_name, - struct loader_layer_list *layer_list, - const struct loader_layer_list *search_list) { +// Get the layer name(s) from the env_name environment variable. If layer +// is found in search_list then add it to layer_list. But only add it to +// layer_list if type matches. +static void loader_add_layer_env(struct loader_instance *inst, const enum layer_type type, const char *env_name, + struct loader_layer_list *layer_list, const struct loader_layer_list *search_list) { char *layerEnv; char *next, *name; - layerEnv = loader_getenv(env_name, inst); + layerEnv = loader_secure_getenv(env_name, inst); if (layerEnv == NULL) { return; } @@ -4395,24 +3739,16 @@ static void loader_add_layer_env(struct loader_instance *inst, while (name && *name) { next = loader_get_next_path(name); if (!strcmp(std_validation_str, name)) { - /* add meta list of layers - don't attempt to remove duplicate layers already added by app or - env var - */ - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Expanding meta layer %s found in environment variable", + // Add meta list of layers + // Don't attempt to remove duplicate layers already added by app or env var + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Expanding meta layer %s found in environment variable", std_validation_str); - if (type == VK_LAYER_TYPE_INSTANCE_EXPLICIT) - inst->activated_layers_are_std_val = true; - for (uint32_t i = 0; i < sizeof(std_validation_names) / - sizeof(std_validation_names[0]); - i++) { - loader_find_layer_name_add_list(inst, std_validation_names[i], - type, search_list, layer_list); + if (type == VK_LAYER_TYPE_INSTANCE_EXPLICIT) inst->activated_layers_are_std_val = true; + for (uint32_t i = 0; i < sizeof(std_validation_names) / sizeof(std_validation_names[0]); i++) { + loader_find_layer_name_add_list(inst, std_validation_names[i], type, search_list, layer_list); } } else { - loader_find_layer_name_add_list(inst, name, type, search_list, - layer_list); + loader_find_layer_name_add_list(inst, name, type, search_list, layer_list); } name = next; } @@ -4420,10 +3756,8 @@ static void loader_add_layer_env(struct loader_instance *inst, return; } -VkResult -loader_enable_instance_layers(struct loader_instance *inst, - const VkInstanceCreateInfo *pCreateInfo, - const struct loader_layer_list *instance_layers) { +VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo, + const struct loader_layer_list *instance_layers) { VkResult err; assert(inst && "Cannot have null instance"); @@ -4435,28 +3769,22 @@ loader_enable_instance_layers(struct loader_instance *inst, return VK_ERROR_OUT_OF_HOST_MEMORY; } - /* Add any implicit layers first */ - loader_add_layer_implicit(inst, VK_LAYER_TYPE_INSTANCE_IMPLICIT, - &inst->activated_layer_list, instance_layers); + // Add any implicit layers first + loader_add_layer_implicit(inst, VK_LAYER_TYPE_INSTANCE_IMPLICIT, &inst->activated_layer_list, instance_layers); - /* Add any layers specified via environment variable next */ - loader_add_layer_env(inst, VK_LAYER_TYPE_INSTANCE_EXPLICIT, - "VK_INSTANCE_LAYERS", &inst->activated_layer_list, - instance_layers); + // Add any layers specified via environment variable next + loader_add_layer_env(inst, VK_LAYER_TYPE_INSTANCE_EXPLICIT, "VK_INSTANCE_LAYERS", &inst->activated_layer_list, instance_layers); - /* Add layers specified by the application */ - err = loader_add_layer_names_to_list( - inst, &inst->activated_layer_list, pCreateInfo->enabledLayerCount, - pCreateInfo->ppEnabledLayerNames, instance_layers); + // Add layers specified by the application + err = loader_add_layer_names_to_list(inst, &inst->activated_layer_list, pCreateInfo->enabledLayerCount, + pCreateInfo->ppEnabledLayerNames, instance_layers); return err; } // Determine the layer interface version to use. -bool loader_get_layer_interface_version( - PFN_vkNegotiateLoaderLayerInterfaceVersion fp_negotiate_layer_version, - VkNegotiateLayerInterface *interface_struct) { - +bool loader_get_layer_interface_version(PFN_vkNegotiateLoaderLayerInterfaceVersion fp_negotiate_layer_version, + VkNegotiateLayerInterface *interface_struct) { memset(interface_struct, 0, sizeof(VkNegotiateLayerInterface)); // Base assumption is that all layers are version 1 at least. @@ -4465,8 +3793,7 @@ bool loader_get_layer_interface_version( if (fp_negotiate_layer_version != NULL) { // Layer supports the negotiation API, so call it with the loader's // latest version supported - interface_struct->loaderLayerInterfaceVersion = - CURRENT_LOADER_LAYER_INTERFACE_VERSION; + interface_struct->loaderLayerInterfaceVersion = CURRENT_LOADER_LAYER_INTERFACE_VERSION; VkResult result = fp_negotiate_layer_version(interface_struct); if (result != VK_SUCCESS) { @@ -4476,8 +3803,7 @@ bool loader_get_layer_interface_version( } } - if (interface_struct->loaderLayerInterfaceVersion < - MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION) { + if (interface_struct->loaderLayerInterfaceVersion < MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION) { // Loader no longer supports the layer's latest interface version so // fail loading the layer return false; @@ -4486,28 +3812,24 @@ bool loader_get_layer_interface_version( return true; } -/* - * Given the list of layers to activate in the loader_instance - * structure. This function will add a VkLayerInstanceCreateInfo - * structure to the VkInstanceCreateInfo.pNext pointer. - * Each activated layer will have it's own VkLayerInstanceLink - * structure that tells the layer what Get*ProcAddr to call to - * get function pointers to the next layer down. - * Once the chain info has been created this function will - * execute the CreateInstance call chain. Each layer will - * then have an opportunity in it's CreateInstance function - * to setup it's dispatch table when the lower layer returns - * successfully. - * Each layer can wrap or not-wrap the returned VkInstance object - * as it sees fit. - * The instance chain is terminated by a loader function - * that will call CreateInstance on all available ICD's and - * cache those VkInstance objects for future use. - */ -VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - struct loader_instance *inst, - VkInstance *created_instance) { +// Given the list of layers to activate in the loader_instance +// structure. This function will add a VkLayerInstanceCreateInfo +// structure to the VkInstanceCreateInfo.pNext pointer. +// Each activated layer will have it's own VkLayerInstanceLink +// structure that tells the layer what Get*ProcAddr to call to +// get function pointers to the next layer down. +// Once the chain info has been created this function will +// execute the CreateInstance call chain. Each layer will +// then have an opportunity in it's CreateInstance function +// to setup it's dispatch table when the lower layer returns +// successfully. +// Each layer can wrap or not-wrap the returned VkInstance object +// as it sees fit. +// The instance chain is terminated by a loader function +// that will call CreateInstance on all available ICD's and +// cache those VkInstance objects for future use. +VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, + struct loader_instance *inst, VkInstance *created_instance) { uint32_t activated_layers = 0; VkLayerInstanceCreateInfo chain_info; VkLayerInstanceLink *layer_instance_link_info = NULL; @@ -4522,15 +3844,13 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, memcpy(&loader_create_info, pCreateInfo, sizeof(VkInstanceCreateInfo)); if (inst->activated_layer_list.count > 0) { - chain_info.u.pLayerInfo = NULL; chain_info.pNext = pCreateInfo->pNext; chain_info.sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO; chain_info.function = VK_LAYER_LINK_INFO; loader_create_info.pNext = &chain_info; - layer_instance_link_info = loader_stack_alloc( - sizeof(VkLayerInstanceLink) * inst->activated_layer_list.count); + layer_instance_link_info = loader_stack_alloc(sizeof(VkLayerInstanceLink) * inst->activated_layer_list.count); if (!layer_instance_link_info) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_create_instance_chain: Failed to alloc Instance" @@ -4540,8 +3860,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, // Create instance chain of enabled layers for (int32_t i = inst->activated_layer_list.count - 1; i >= 0; i--) { - struct loader_layer_properties *layer_prop = - &inst->activated_layer_list.list[i]; + struct loader_layer_properties *layer_prop = &inst->activated_layer_list.list[i]; loader_platform_dl_handle lib_handle; lib_handle = loader_open_layer_lib(inst, "instance", layer_prop); @@ -4550,22 +3869,14 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, } if (NULL == layer_prop->functions.negotiate_layer_interface) { - PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_interface = - NULL; + PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_interface = NULL; bool functions_in_interface = false; - if (strlen(layer_prop->functions.str_negotiate_interface) == - 0) { - negotiate_interface = - (PFN_vkNegotiateLoaderLayerInterfaceVersion) - loader_platform_get_proc_address( - lib_handle, - "vkNegotiateLoaderLayerInterfaceVersion"); + if (strlen(layer_prop->functions.str_negotiate_interface) == 0) { + negotiate_interface = (PFN_vkNegotiateLoaderLayerInterfaceVersion)loader_platform_get_proc_address( + lib_handle, "vkNegotiateLoaderLayerInterfaceVersion"); } else { - negotiate_interface = - (PFN_vkNegotiateLoaderLayerInterfaceVersion) - loader_platform_get_proc_address( - lib_handle, - layer_prop->functions.str_negotiate_interface); + negotiate_interface = (PFN_vkNegotiateLoaderLayerInterfaceVersion)loader_platform_get_proc_address( + lib_handle, layer_prop->functions.str_negotiate_interface); } // If we can negotiate an interface version, then we can also @@ -4573,18 +3884,14 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, // that first, and see if we can get all the function pointers // necessary from that one call. if (NULL != negotiate_interface) { - layer_prop->functions.negotiate_layer_interface = - negotiate_interface; + layer_prop->functions.negotiate_layer_interface = negotiate_interface; VkNegotiateLayerInterface interface_struct; - if (loader_get_layer_interface_version(negotiate_interface, - &interface_struct)) { - - // Go ahead and set the properites version to the + if (loader_get_layer_interface_version(negotiate_interface, &interface_struct)) { + // Go ahead and set the properties version to the // correct value. - layer_prop->interface_version = - interface_struct.loaderLayerInterfaceVersion; + layer_prop->interface_version = interface_struct.loaderLayerInterfaceVersion; // If the interface is 2 or newer, we have access to the // new GetPhysicalDeviceProcAddr function, so grab it, @@ -4592,8 +3899,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, // structure. if (interface_struct.loaderLayerInterfaceVersion > 1) { cur_gipa = interface_struct.pfnGetInstanceProcAddr; - cur_gpdpa = - interface_struct.pfnGetPhysicalDeviceProcAddr; + cur_gpdpa = interface_struct.pfnGetPhysicalDeviceProcAddr; if (cur_gipa != NULL) { // We've set the functions, so make sure we // don't do the unnecessary calls later. @@ -4604,19 +3910,14 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, } if (!functions_in_interface) { - if ((cur_gipa = - layer_prop->functions.get_instance_proc_addr) == - NULL) { + if ((cur_gipa = layer_prop->functions.get_instance_proc_addr) == NULL) { if (strlen(layer_prop->functions.str_gipa) == 0) { - cur_gipa = (PFN_vkGetInstanceProcAddr) - loader_platform_get_proc_address( - lib_handle, "vkGetInstanceProcAddr"); - layer_prop->functions.get_instance_proc_addr = - cur_gipa; + cur_gipa = + (PFN_vkGetInstanceProcAddr)loader_platform_get_proc_address(lib_handle, "vkGetInstanceProcAddr"); + layer_prop->functions.get_instance_proc_addr = cur_gipa; } else { - cur_gipa = (PFN_vkGetInstanceProcAddr) - loader_platform_get_proc_address( - lib_handle, layer_prop->functions.str_gipa); + cur_gipa = (PFN_vkGetInstanceProcAddr)loader_platform_get_proc_address(lib_handle, + layer_prop->functions.str_gipa); } if (NULL == cur_gipa) { @@ -4631,31 +3932,25 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, } } - layer_instance_link_info[activated_layers].pNext = - chain_info.u.pLayerInfo; - layer_instance_link_info[activated_layers] - .pfnNextGetInstanceProcAddr = next_gipa; - layer_instance_link_info[activated_layers] - .pfnNextGetPhysicalDeviceProcAddr = next_gpdpa; + layer_instance_link_info[activated_layers].pNext = chain_info.u.pLayerInfo; + layer_instance_link_info[activated_layers].pfnNextGetInstanceProcAddr = next_gipa; + layer_instance_link_info[activated_layers].pfnNextGetPhysicalDeviceProcAddr = next_gpdpa; next_gipa = cur_gipa; if (layer_prop->interface_version > 1 && cur_gpdpa != NULL) { layer_prop->functions.get_physical_device_proc_addr = cur_gpdpa; next_gpdpa = cur_gpdpa; } - chain_info.u.pLayerInfo = - &layer_instance_link_info[activated_layers]; + chain_info.u.pLayerInfo = &layer_instance_link_info[activated_layers]; - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Insert instance layer %s (%s)", - layer_prop->info.layerName, layer_prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Insert instance layer %s (%s)", layer_prop->info.layerName, + layer_prop->lib_name); activated_layers++; } } - PFN_vkCreateInstance fpCreateInstance = - (PFN_vkCreateInstance)next_gipa(*created_instance, "vkCreateInstance"); + PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)next_gipa(*created_instance, "vkCreateInstance"); if (fpCreateInstance) { VkLayerInstanceCreateInfo create_info_disp; @@ -4666,8 +3961,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, create_info_disp.pNext = loader_create_info.pNext; loader_create_info.pNext = &create_info_disp; - res = - fpCreateInstance(&loader_create_info, pAllocator, created_instance); + res = fpCreateInstance(&loader_create_info, pAllocator, created_instance); } else { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_create_instance_chain: Failed to find " @@ -4677,41 +3971,76 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, } if (res == VK_SUCCESS) { - loader_init_instance_core_dispatch_table(&inst->disp->layer_inst_disp, - next_gipa, *created_instance); + loader_init_instance_core_dispatch_table(&inst->disp->layer_inst_disp, next_gipa, *created_instance); inst->instance = *created_instance; } return res; } -void loader_activate_instance_layer_extensions(struct loader_instance *inst, - VkInstance created_inst) { - - loader_init_instance_extension_dispatch_table( - &inst->disp->layer_inst_disp, - inst->disp->layer_inst_disp.GetInstanceProcAddr, created_inst); +void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst) { + loader_init_instance_extension_dispatch_table(&inst->disp->layer_inst_disp, inst->disp->layer_inst_disp.GetInstanceProcAddr, + created_inst); } -VkResult -loader_create_device_chain(const struct loader_physical_device_tramp *pd, - const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - const struct loader_instance *inst, - struct loader_device *dev) { +VkResult loader_create_device_chain(const struct loader_physical_device_tramp *pd, const VkDeviceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst, + struct loader_device *dev) { uint32_t activated_layers = 0; VkLayerDeviceLink *layer_device_link_info; VkLayerDeviceCreateInfo chain_info; VkDeviceCreateInfo loader_create_info; VkResult res; - PFN_vkGetDeviceProcAddr fpGDPA, nextGDPA = loader_gpa_device_internal; - PFN_vkGetInstanceProcAddr fpGIPA, nextGIPA = loader_gpa_instance_internal; + PFN_vkGetDeviceProcAddr fpGDPA = NULL, nextGDPA = loader_gpa_device_internal; + PFN_vkGetInstanceProcAddr fpGIPA = NULL, nextGIPA = loader_gpa_instance_internal; memcpy(&loader_create_info, pCreateInfo, sizeof(VkDeviceCreateInfo)); - layer_device_link_info = loader_stack_alloc( - sizeof(VkLayerDeviceLink) * dev->activated_layer_list.count); + // Before we continue, we need to find out if the KHX_device_group extension is in the enabled list. If it is, we then + // need to look for the corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list. This is because we + // need to replace all the incoming physical device values (which are really loader trampoline physical device values) + // with the layer/ICD version. + if (inst->enabled_known_extensions.khx_device_group_creation == 1) { + struct VkStructureHeader *pNext = (struct VkStructureHeader *)loader_create_info.pNext; + struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&loader_create_info; + while (NULL != pNext) { + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { + VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { + VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkPhysicalDevice *phys_dev_array = NULL; + if (NULL == temp_struct) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); + if (NULL == phys_dev_array) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + // Before calling down, replace the incoming physical device values (which are really loader trampoline + // physical devices) with the next layer (or possibly even the terminator) physical device values. + struct loader_physical_device_tramp *cur_tramp; + for (uint32_t phys_dev = 0; phys_dev < cur_struct->physicalDeviceCount; phys_dev++) { + cur_tramp = (struct loader_physical_device_tramp *)cur_struct->pPhysicalDevices[phys_dev]; + phys_dev_array[phys_dev] = cur_tramp->phys_dev; + } + temp_struct->pPhysicalDevices = phys_dev_array; + + // Replace the old struct in the pNext chain with this one. + pPrev->pNext = (const void *)temp_struct; + pNext = (struct VkStructureHeader *)(temp_struct); + } + break; + } + + pPrev = pNext; + pNext = (struct VkStructureHeader *)(pPrev->pNext); + } + } + + layer_device_link_info = loader_stack_alloc(sizeof(VkLayerDeviceLink) * dev->activated_layer_list.count); if (!layer_device_link_info) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_create_device_chain: Failed to alloc Device objects" @@ -4728,8 +4057,7 @@ loader_create_device_chain(const struct loader_physical_device_tramp *pd, // Create instance chain of enabled layers for (int32_t i = dev->activated_layer_list.count - 1; i >= 0; i--) { - struct loader_layer_properties *layer_prop = - &dev->activated_layer_list.list[i]; + struct loader_layer_properties *layer_prop = &dev->activated_layer_list.list[i]; loader_platform_dl_handle lib_handle; bool functions_in_interface = false; @@ -4738,45 +4066,29 @@ loader_create_device_chain(const struct loader_physical_device_tramp *pd, continue; } - // If we can negotiate an interface version, then we can also - // get everything we need from the one function call, so try - // that first, and see if we can get all the function pointers - // necessary from that one call. + // If we can negotiate an interface version, then we can also get everything we need from the one function + // call, so try that first, and see if we can get all the function pointers necessary from that one call. if (NULL == layer_prop->functions.negotiate_layer_interface) { - PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_interface = - NULL; - if (strlen(layer_prop->functions.str_negotiate_interface) == - 0) { - negotiate_interface = - (PFN_vkNegotiateLoaderLayerInterfaceVersion) - loader_platform_get_proc_address( - lib_handle, - "vkNegotiateLoaderLayerInterfaceVersion"); + PFN_vkNegotiateLoaderLayerInterfaceVersion negotiate_interface = NULL; + if (strlen(layer_prop->functions.str_negotiate_interface) == 0) { + negotiate_interface = (PFN_vkNegotiateLoaderLayerInterfaceVersion)loader_platform_get_proc_address( + lib_handle, "vkNegotiateLoaderLayerInterfaceVersion"); } else { - negotiate_interface = - (PFN_vkNegotiateLoaderLayerInterfaceVersion) - loader_platform_get_proc_address( - lib_handle, - layer_prop->functions.str_negotiate_interface); + negotiate_interface = (PFN_vkNegotiateLoaderLayerInterfaceVersion)loader_platform_get_proc_address( + lib_handle, layer_prop->functions.str_negotiate_interface); } if (NULL != negotiate_interface) { - layer_prop->functions.negotiate_layer_interface = - negotiate_interface; + layer_prop->functions.negotiate_layer_interface = negotiate_interface; VkNegotiateLayerInterface interface_struct; - if (loader_get_layer_interface_version(negotiate_interface, - &interface_struct)) { + if (loader_get_layer_interface_version(negotiate_interface, &interface_struct)) { + // Go ahead and set the properties version to the correct value. + layer_prop->interface_version = interface_struct.loaderLayerInterfaceVersion; - // Go ahead and set the properites version to the - // correct value. - layer_prop->interface_version = - interface_struct.loaderLayerInterfaceVersion; - - // If the interface is 2 or newer, we have access to the - // new GetPhysicalDeviceProcAddr function, so grab it, - // and the other necessary functions, from the structure. + // If the interface is 2 or newer, we have access to the new GetPhysicalDeviceProcAddr + // function, so grab it, and the other necessary functions, from the structure. if (interface_struct.loaderLayerInterfaceVersion > 1) { fpGIPA = interface_struct.pfnGetInstanceProcAddr; fpGDPA = interface_struct.pfnGetDeviceProcAddr; @@ -4791,66 +4103,52 @@ loader_create_device_chain(const struct loader_physical_device_tramp *pd, } if (!functions_in_interface) { - if ((fpGIPA = layer_prop->functions.get_instance_proc_addr) == - NULL) { + if ((fpGIPA = layer_prop->functions.get_instance_proc_addr) == NULL) { if (strlen(layer_prop->functions.str_gipa) == 0) { - fpGIPA = (PFN_vkGetInstanceProcAddr) - loader_platform_get_proc_address( - lib_handle, "vkGetInstanceProcAddr"); + fpGIPA = (PFN_vkGetInstanceProcAddr)loader_platform_get_proc_address(lib_handle, "vkGetInstanceProcAddr"); layer_prop->functions.get_instance_proc_addr = fpGIPA; } else - fpGIPA = (PFN_vkGetInstanceProcAddr) - loader_platform_get_proc_address( - lib_handle, layer_prop->functions.str_gipa); + fpGIPA = + (PFN_vkGetInstanceProcAddr)loader_platform_get_proc_address(lib_handle, layer_prop->functions.str_gipa); if (!fpGIPA) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_create_device_chain: Failed to find " - "\'vkGetInstanceProcAddr\' in layer %s. Skipping" - " layer.", - layer_prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_create_device_chain: Failed to find " + "\'vkGetInstanceProcAddr\' in layer %s. Skipping" + " layer.", + layer_prop->lib_name); continue; } } if ((fpGDPA = layer_prop->functions.get_device_proc_addr) == NULL) { if (strlen(layer_prop->functions.str_gdpa) == 0) { - fpGDPA = (PFN_vkGetDeviceProcAddr) - loader_platform_get_proc_address(lib_handle, - "vkGetDeviceProcAddr"); + fpGDPA = (PFN_vkGetDeviceProcAddr)loader_platform_get_proc_address(lib_handle, "vkGetDeviceProcAddr"); layer_prop->functions.get_device_proc_addr = fpGDPA; } else - fpGDPA = (PFN_vkGetDeviceProcAddr) - loader_platform_get_proc_address( - lib_handle, layer_prop->functions.str_gdpa); + fpGDPA = + (PFN_vkGetDeviceProcAddr)loader_platform_get_proc_address(lib_handle, layer_prop->functions.str_gdpa); if (!fpGDPA) { - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Failed to find vkGetDeviceProcAddr in layer %s", - layer_prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Failed to find vkGetDeviceProcAddr in layer %s", + layer_prop->lib_name); continue; } } } - layer_device_link_info[activated_layers].pNext = - chain_info.u.pLayerInfo; - layer_device_link_info[activated_layers] - .pfnNextGetInstanceProcAddr = nextGIPA; - layer_device_link_info[activated_layers].pfnNextGetDeviceProcAddr = - nextGDPA; + layer_device_link_info[activated_layers].pNext = chain_info.u.pLayerInfo; + layer_device_link_info[activated_layers].pfnNextGetInstanceProcAddr = nextGIPA; + layer_device_link_info[activated_layers].pfnNextGetDeviceProcAddr = nextGDPA; chain_info.u.pLayerInfo = &layer_device_link_info[activated_layers]; nextGIPA = fpGIPA; nextGDPA = fpGDPA; - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "Insert device layer %s (%s)", - layer_prop->info.layerName, layer_prop->lib_name); + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Insert device layer %s (%s)", layer_prop->info.layerName, + layer_prop->lib_name); activated_layers++; } } VkDevice created_device = (VkDevice)dev; - PFN_vkCreateDevice fpCreateDevice = - (PFN_vkCreateDevice)nextGIPA(inst->instance, "vkCreateDevice"); + PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)nextGIPA(inst->instance, "vkCreateDevice"); if (fpCreateDevice) { VkLayerDeviceCreateInfo create_info_disp; @@ -4861,37 +4159,31 @@ loader_create_device_chain(const struct loader_physical_device_tramp *pd, create_info_disp.pNext = loader_create_info.pNext; loader_create_info.pNext = &create_info_disp; - res = fpCreateDevice(pd->phys_dev, &loader_create_info, pAllocator, - &created_device); + res = fpCreateDevice(pd->phys_dev, &loader_create_info, pAllocator, &created_device); if (res != VK_SUCCESS) { return res; } dev->chain_device = created_device; } else { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "loader_create_device_chain: Failed to find \'vkCreateDevice\' " - "in layer %s"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_create_device_chain: Failed to find \'vkCreateDevice\' " + "in layer %s"); // Couldn't find CreateDevice function! return VK_ERROR_INITIALIZATION_FAILED; } // Initialize device dispatch table - loader_init_device_dispatch_table(&dev->loader_dispatch, nextGDPA, - dev->chain_device); + loader_init_device_dispatch_table(&dev->loader_dispatch, nextGDPA, dev->chain_device); return res; } -VkResult loader_validate_layers(const struct loader_instance *inst, - const uint32_t layer_count, - const char *const *ppEnabledLayerNames, - const struct loader_layer_list *list) { +VkResult loader_validate_layers(const struct loader_instance *inst, const uint32_t layer_count, + const char *const *ppEnabledLayerNames, const struct loader_layer_list *list) { struct loader_layer_properties *prop; for (uint32_t i = 0; i < layer_count; i++) { - VkStringErrorFlags result = - vk_string_validate(MaxLoaderStringLength, ppEnabledLayerNames[i]); + VkStringErrorFlags result = vk_string_validate(MaxLoaderStringLength, ppEnabledLayerNames[i]); if (result != VK_STRING_ERROR_NONE) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_validate_layers: Device ppEnabledLayerNames " @@ -4911,18 +4203,14 @@ VkResult loader_validate_layers(const struct loader_instance *inst, return VK_SUCCESS; } -VkResult loader_validate_instance_extensions( - const struct loader_instance *inst, - const struct loader_extension_list *icd_exts, - const struct loader_layer_list *instance_layers, - const VkInstanceCreateInfo *pCreateInfo) { - +VkResult loader_validate_instance_extensions(const struct loader_instance *inst, const struct loader_extension_list *icd_exts, + const struct loader_layer_list *instance_layers, + const VkInstanceCreateInfo *pCreateInfo) { VkExtensionProperties *extension_prop; struct loader_layer_properties *layer_prop; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - VkStringErrorFlags result = vk_string_validate( - MaxLoaderStringLength, pCreateInfo->ppEnabledExtensionNames[i]); + VkStringErrorFlags result = vk_string_validate(MaxLoaderStringLength, pCreateInfo->ppEnabledExtensionNames[i]); if (result != VK_STRING_ERROR_NONE) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "loader_validate_instance_extensions: Instance " @@ -4934,8 +4222,7 @@ VkResult loader_validate_instance_extensions( // See if the extension is in the list of supported extensions bool found = false; for (uint32_t j = 0; LOADER_INSTANCE_EXTENSIONS[j] != NULL; j++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - LOADER_INSTANCE_EXTENSIONS[j]) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], LOADER_INSTANCE_EXTENSIONS[j]) == 0) { found = true; break; } @@ -4950,8 +4237,7 @@ VkResult loader_validate_instance_extensions( return VK_ERROR_EXTENSION_NOT_PRESENT; } - extension_prop = get_extension_property( - pCreateInfo->ppEnabledExtensionNames[i], icd_exts); + extension_prop = get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], icd_exts); if (extension_prop) { continue; @@ -4959,23 +4245,17 @@ VkResult loader_validate_instance_extensions( extension_prop = NULL; - /* Not in global list, search layer extension lists */ + // Not in global list, search layer extension lists for (uint32_t j = 0; j < pCreateInfo->enabledLayerCount; j++) { - layer_prop = loader_get_layer_property( - pCreateInfo->ppEnabledLayerNames[j], instance_layers); + layer_prop = loader_get_layer_property(pCreateInfo->ppEnabledLayerNames[j], instance_layers); if (!layer_prop) { - /* Should NOT get here, loader_validate_layers - * should have already filtered this case out. - */ + // Should NOT get here, loader_validate_layers should have already filtered this case out. continue; } - extension_prop = - get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], - &layer_prop->instance_extension_list); + extension_prop = get_extension_property(pCreateInfo->ppEnabledExtensionNames[i], &layer_prop->instance_extension_list); if (extension_prop) { - /* Found the extension in one of the layers enabled by the app. - */ + // Found the extension in one of the layers enabled by the app. break; } } @@ -4992,23 +4272,19 @@ VkResult loader_validate_instance_extensions( return VK_SUCCESS; } -VkResult loader_validate_device_extensions( - struct loader_physical_device_tramp *phys_dev, - const struct loader_layer_list *activated_device_layers, - const struct loader_extension_list *icd_exts, - const VkDeviceCreateInfo *pCreateInfo) { +VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev, + const struct loader_layer_list *activated_device_layers, + const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo) { VkExtensionProperties *extension_prop; struct loader_layer_properties *layer_prop; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - - VkStringErrorFlags result = vk_string_validate( - MaxLoaderStringLength, pCreateInfo->ppEnabledExtensionNames[i]); + VkStringErrorFlags result = vk_string_validate(MaxLoaderStringLength, pCreateInfo->ppEnabledExtensionNames[i]); if (result != VK_STRING_ERROR_NONE) { - loader_log(phys_dev->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, - 0, "loader_validate_device_extensions: Device " - "ppEnabledExtensionNames contains " - "string that is too long or is badly formed"); + loader_log(phys_dev->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_validate_device_extensions: Device " + "ppEnabledExtensionNames contains " + "string that is too long or is badly formed"); return VK_ERROR_EXTENSION_NOT_PRESENT; } @@ -5023,8 +4299,7 @@ VkResult loader_validate_device_extensions( for (uint32_t j = 0; j < activated_device_layers->count; j++) { layer_prop = &activated_device_layers->list[j]; - extension_prop = get_dev_extension_property( - extension_name, &layer_prop->device_extension_list); + extension_prop = get_dev_extension_property(extension_name, &layer_prop->device_extension_list); if (extension_prop) { // Found the extension in one of the layers enabled by the app. break; @@ -5033,9 +4308,9 @@ VkResult loader_validate_device_extensions( if (!extension_prop) { // Didn't find extension name in any of the device layers, error out - loader_log(phys_dev->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, - 0, "loader_validate_device_extensions: Extension %d " - "not found in enabled layer list extensions.", + loader_log(phys_dev->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "loader_validate_device_extensions: Extension %d " + "not found in enabled layer list extensions.", i); return VK_ERROR_EXTENSION_NOT_PRESENT; } @@ -5045,9 +4320,8 @@ VkResult loader_validate_device_extensions( // Terminator functions for the Instance chain // All named terminator_ -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( - const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { struct loader_icd_term *icd_term; VkExtensionProperties *prop; char **filtered_extension_names = NULL; @@ -5065,8 +4339,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( // No ICD will advertise support for layers. An ICD library could // support a layer, but it would be independent of the actual ICD, // just in the same library. - filtered_extension_names = - loader_stack_alloc(pCreateInfo->enabledExtensionCount * sizeof(char *)); + filtered_extension_names = loader_stack_alloc(pCreateInfo->enabledExtensionCount * sizeof(char *)); if (!filtered_extension_names) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "terminator_CreateInstance: Failed create extension name " @@ -5075,15 +4348,12 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - icd_create_info.ppEnabledExtensionNames = - (const char *const *)filtered_extension_names; + icd_create_info.ppEnabledExtensionNames = (const char *const *)filtered_extension_names; for (uint32_t i = 0; i < ptr_instance->icd_tramp_list.count; i++) { - icd_term = loader_icd_add( - ptr_instance, &ptr_instance->icd_tramp_list.scanned_list[i]); + icd_term = loader_icd_add(ptr_instance, &ptr_instance->icd_tramp_list.scanned_list[i]); if (NULL == icd_term) { - loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, - 0, + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "terminator_CreateInstance: Failed to add ICD %d to ICD " "trampoline list.", i); @@ -5094,13 +4364,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( icd_create_info.enabledExtensionCount = 0; struct loader_extension_list icd_exts; - loader_log(ptr_instance, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, - "Build ICD instance extension list"); - // traverse scanned icd list adding non-duplicate extensions to the - // list - res = loader_init_generic_list(ptr_instance, - (struct loader_generic_list *)&icd_exts, - sizeof(VkExtensionProperties)); + loader_log(ptr_instance, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Build ICD instance extension list"); + // traverse scanned icd list adding non-duplicate extensions to the list + res = loader_init_generic_list(ptr_instance, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); if (VK_ERROR_OUT_OF_HOST_MEMORY == res) { // If out of memory, bail immediately. goto out; @@ -5113,19 +4379,15 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( continue; } - res = loader_add_instance_extensions( - ptr_instance, - icd_term->scanned_icd->EnumerateInstanceExtensionProperties, - icd_term->scanned_icd->lib_name, &icd_exts); + res = loader_add_instance_extensions(ptr_instance, icd_term->scanned_icd->EnumerateInstanceExtensionProperties, + icd_term->scanned_icd->lib_name, &icd_exts); if (VK_SUCCESS != res) { - loader_destroy_generic_list( - ptr_instance, (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&icd_exts); if (VK_ERROR_OUT_OF_HOST_MEMORY == res) { // If out of memory, bail immediately. goto out; } else { - // Something bad happened with this ICD, so free it and try - // the next. + // Something bad happened with this ICD, so free it and try the next. ptr_instance->icd_terms = icd_term->next; icd_term->next = NULL; loader_icd_destroy(ptr_instance, icd_term, pAllocator); @@ -5134,22 +4396,17 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( } for (uint32_t j = 0; j < pCreateInfo->enabledExtensionCount; j++) { - prop = get_extension_property( - pCreateInfo->ppEnabledExtensionNames[j], &icd_exts); + prop = get_extension_property(pCreateInfo->ppEnabledExtensionNames[j], &icd_exts); if (prop) { - filtered_extension_names[icd_create_info - .enabledExtensionCount] = - (char *)pCreateInfo->ppEnabledExtensionNames[j]; + filtered_extension_names[icd_create_info.enabledExtensionCount] = (char *)pCreateInfo->ppEnabledExtensionNames[j]; icd_create_info.enabledExtensionCount++; } } - loader_destroy_generic_list(ptr_instance, - (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&icd_exts); VkResult icd_result = - ptr_instance->icd_tramp_list.scanned_list[i].CreateInstance( - &icd_create_info, pAllocator, &(icd_term->instance)); + ptr_instance->icd_tramp_list.scanned_list[i].CreateInstance(&icd_create_info, pAllocator, &(icd_term->instance)); if (VK_ERROR_OUT_OF_HOST_MEMORY == icd_result) { // If out of memory, bail immediately. res = VK_ERROR_OUT_OF_HOST_MEMORY; @@ -5165,13 +4422,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( continue; } - if (!loader_icd_init_entrys(icd_term, icd_term->instance, - ptr_instance->icd_tramp_list.scanned_list[i] - .GetInstanceProcAddr)) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "terminator_CreateInstance: Failed to CreateInstance and find " - "entrypoints with ICD. Skipping ICD."); + if (!loader_icd_init_entries(icd_term, icd_term->instance, + ptr_instance->icd_tramp_list.scanned_list[i].GetInstanceProcAddr)) { + loader_log(ptr_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "terminator_CreateInstance: Failed to CreateInstance and find " + "entrypoints with ICD. Skipping ICD."); continue; } @@ -5179,11 +4434,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( one_icd_successful = true; } - // If no ICDs were added to instance list and res is unchanged - // from it's initial value, the loader was unable to find - // a suitable ICD. - if (VK_SUCCESS == res && - (ptr_instance->icd_terms == NULL || !one_icd_successful)) { + // If no ICDs were added to instance list and res is unchanged from it's initial value, the loader was unable to + // find a suitable ICD. + if (VK_SUCCESS == res && (ptr_instance->icd_terms == NULL || !one_icd_successful)) { res = VK_ERROR_INCOMPATIBLE_DRIVER; } @@ -5194,7 +4447,7 @@ out: icd_term = ptr_instance->icd_terms; ptr_instance->icd_terms = icd_term->next; if (NULL != icd_term->instance) { - icd_term->DestroyInstance(icd_term->instance, pAllocator); + icd_term->dispatch.DestroyInstance(icd_term->instance, pAllocator); } loader_icd_destroy(ptr_instance, icd_term, pAllocator); } @@ -5203,8 +4456,7 @@ out: return res; } -VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance( - VkInstance instance, const VkAllocationCallbacks *pAllocator) { +VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { struct loader_instance *ptr_instance = loader_instance(instance); if (NULL == ptr_instance) { return; @@ -5230,7 +4482,7 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance( while (NULL != icd_terms) { if (icd_terms->instance) { - icd_terms->DestroyInstance(icd_terms->instance, pAllocator); + icd_terms->dispatch.DestroyInstance(icd_terms->instance, pAllocator); } next_icd_term = icd_terms->next; icd_terms->instance = VK_NULL_HANDLE; @@ -5239,32 +4491,34 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance( icd_terms = next_icd_term; } - loader_delete_layer_properties(ptr_instance, - &ptr_instance->instance_layer_list); + loader_delete_layer_properties(ptr_instance, &ptr_instance->instance_layer_list); loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_tramp_list); - loader_destroy_generic_list( - ptr_instance, (struct loader_generic_list *)&ptr_instance->ext_list); + loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&ptr_instance->ext_list); if (NULL != ptr_instance->phys_devs_term) { for (uint32_t i = 0; i < ptr_instance->phys_dev_count_term; i++) { - loader_instance_heap_free(ptr_instance, - ptr_instance->phys_devs_term[i]); + loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_term[i]); } loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_term); } + if (NULL != ptr_instance->phys_dev_groups_term) { + for (uint32_t i = 0; i < ptr_instance->phys_dev_group_count_term; i++) { + loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_term[i]); + } + loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_term); + } loader_free_dev_ext_table(ptr_instance); loader_free_phys_dev_ext_table(ptr_instance); } -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice( - VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { VkResult res = VK_SUCCESS; struct loader_physical_device_term *phys_dev_term; phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; struct loader_device *dev = (struct loader_device *)*pDevice; - PFN_vkCreateDevice fpCreateDevice = icd_term->CreateDevice; + PFN_vkCreateDevice fpCreateDevice = icd_term->dispatch.CreateDevice; struct loader_extension_list icd_exts; dev->phys_dev_term = phys_dev_term; @@ -5284,60 +4538,95 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice( memcpy(&localCreateInfo, pCreateInfo, sizeof(localCreateInfo)); // NOTE: Need to filter the extensions to only those supported by the ICD. - // No ICD will advertise support for layers. An ICD library could - // support a layer, but it would be independent of the actual ICD, - // just in the same library. + // No ICD will advertise support for layers. An ICD library could support a layer, + // but it would be independent of the actual ICD, just in the same library. char **filtered_extension_names = NULL; - filtered_extension_names = - loader_stack_alloc(pCreateInfo->enabledExtensionCount * sizeof(char *)); - if (NULL == filtered_extension_names) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "terminator_CreateDevice: Failed to create extension name " - "storage for %d extensions %d", - pCreateInfo->enabledExtensionCount); - return VK_ERROR_OUT_OF_HOST_MEMORY; + if (0 < pCreateInfo->enabledExtensionCount) { + filtered_extension_names = loader_stack_alloc(pCreateInfo->enabledExtensionCount * sizeof(char *)); + if (NULL == filtered_extension_names) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "terminator_CreateDevice: Failed to create extension name " + "storage for %d extensions %d", + pCreateInfo->enabledExtensionCount); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } } localCreateInfo.enabledLayerCount = 0; localCreateInfo.ppEnabledLayerNames = NULL; localCreateInfo.enabledExtensionCount = 0; - localCreateInfo.ppEnabledExtensionNames = - (const char *const *)filtered_extension_names; + localCreateInfo.ppEnabledExtensionNames = (const char *const *)filtered_extension_names; // Get the physical device (ICD) extensions - res = loader_init_generic_list(icd_term->this_instance, - (struct loader_generic_list *)&icd_exts, - sizeof(VkExtensionProperties)); + res = loader_init_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); if (VK_SUCCESS != res) { goto out; } - res = loader_add_device_extensions( - icd_term->this_instance, icd_term->EnumerateDeviceExtensionProperties, - phys_dev_term->phys_dev, icd_term->scanned_icd->lib_name, &icd_exts); + res = loader_add_device_extensions(icd_term->this_instance, icd_term->dispatch.EnumerateDeviceExtensionProperties, + phys_dev_term->phys_dev, icd_term->scanned_icd->lib_name, &icd_exts); if (res != VK_SUCCESS) { goto out; } for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { const char *extension_name = pCreateInfo->ppEnabledExtensionNames[i]; - VkExtensionProperties *prop = - get_extension_property(extension_name, &icd_exts); + VkExtensionProperties *prop = get_extension_property(extension_name, &icd_exts); if (prop) { - filtered_extension_names[localCreateInfo.enabledExtensionCount] = - (char *)extension_name; + filtered_extension_names[localCreateInfo.enabledExtensionCount] = (char *)extension_name; localCreateInfo.enabledExtensionCount++; } else { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, - 0, "vkCreateDevice extension %s not available for " - "devices associated with ICD %s", + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkCreateDevice extension %s not available for " + "devices associated with ICD %s", extension_name, icd_term->scanned_icd->lib_name); } } - res = fpCreateDevice(phys_dev_term->phys_dev, &localCreateInfo, pAllocator, - &dev->icd_device); + // Before we continue, If KHX_device_group is the list of enabled and viable extensions, then we then need to look for the + // corresponding VkDeviceGroupDeviceCreateInfoKHX struct in the device list and replace all the physical device values (which + // are really loader physical device terminator values) with the ICD versions. + if (icd_term->this_instance->enabled_known_extensions.khx_device_group_creation == 1) { + struct VkStructureHeader *pNext = (struct VkStructureHeader *)localCreateInfo.pNext; + struct VkStructureHeader *pPrev = (struct VkStructureHeader *)&localCreateInfo; + while (NULL != pNext) { + if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX == pNext->sType) { + VkDeviceGroupDeviceCreateInfoKHX *cur_struct = (VkDeviceGroupDeviceCreateInfoKHX *)pNext; + if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) { + VkDeviceGroupDeviceCreateInfoKHX *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + VkPhysicalDevice *phys_dev_array = NULL; + if (NULL == temp_struct) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHX)); + phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount); + if (NULL == phys_dev_array) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + // Before calling down, replace the incoming physical device values (which are really loader terminator + // physical devices) with the ICDs physical device values. + struct loader_physical_device_term *cur_term; + for (uint32_t phys_dev = 0; phys_dev < cur_struct->physicalDeviceCount; phys_dev++) { + cur_term = (struct loader_physical_device_term *)cur_struct->pPhysicalDevices[phys_dev]; + phys_dev_array[phys_dev] = cur_term->phys_dev; + } + temp_struct->pPhysicalDevices = phys_dev_array; + + // Replace the old struct in the pNext chain with this one. + pPrev->pNext = (const void *)temp_struct; + pNext = (struct VkStructureHeader *)(temp_struct); + } + break; + } + + pPrev = pNext; + pNext = (struct VkStructureHeader *)(pPrev->pNext); + } + } + + res = fpCreateDevice(phys_dev_term->phys_dev, &localCreateInfo, pAllocator, &dev->icd_device); if (res != VK_SUCCESS) { loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "terminator_CreateDevice: Failed in ICD %s vkCreateDevice" @@ -5349,13 +4638,12 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice( *pDevice = dev->icd_device; loader_add_logical_device(icd_term->this_instance, icd_term, dev); - /* Init dispatch pointer in new device object */ + // Init dispatch pointer in new device object loader_init_dispatch(*pDevice, &dev->loader_dispatch); out: if (NULL != icd_exts.list) { - loader_destroy_generic_list(icd_term->this_instance, - (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts); } return res; @@ -5373,31 +4661,38 @@ VkResult setupLoaderTrampPhysDevs(VkInstance instance) { res = VK_ERROR_INITIALIZATION_FAILED; goto out; } + + // Query how many gpus there + res = inst->disp->layer_inst_disp.EnumeratePhysicalDevices(instance, &total_count, NULL); + if (res != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevs: Failed during dispatch call " + "of \'vkEnumeratePhysicalDevices\' to lower layers or " + "loader to get count."); + goto out; + } + + // Really use what the total GPU count is since Optimus and other layers may mess + // the count up. total_count = inst->total_gpu_count; // Create an array for the new physical devices, which will be stored // in the instance for the trampoline code. - new_phys_devs = - (struct loader_physical_device_tramp **)loader_instance_heap_alloc( - inst, - total_count * sizeof(struct loader_physical_device_tramp *), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + new_phys_devs = (struct loader_physical_device_tramp **)loader_instance_heap_alloc( + inst, total_count * sizeof(struct loader_physical_device_tramp *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == new_phys_devs) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "setupLoaderTrampPhysDevs: Failed to allocate new physical device" - " array of size %d", - total_count); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTrampPhysDevs: Failed to allocate new physical device" + " array of size %d", + total_count); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - memset(new_phys_devs, 0, - total_count * sizeof(struct loader_physical_device_tramp *)); + memset(new_phys_devs, 0, total_count * sizeof(struct loader_physical_device_tramp *)); // Create a temporary array (on the stack) to keep track of the // returned VkPhysicalDevice values. - local_phys_devs = - loader_stack_alloc(sizeof(VkPhysicalDevice) * total_count); + local_phys_devs = loader_stack_alloc(sizeof(VkPhysicalDevice) * total_count); if (NULL == local_phys_devs) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTrampPhysDevs: Failed to allocate local " @@ -5408,25 +4703,20 @@ VkResult setupLoaderTrampPhysDevs(VkInstance instance) { } memset(local_phys_devs, 0, sizeof(VkPhysicalDevice) * total_count); - res = inst->disp->layer_inst_disp.EnumeratePhysicalDevices( - instance, &total_count, local_phys_devs); + res = inst->disp->layer_inst_disp.EnumeratePhysicalDevices(instance, &total_count, local_phys_devs); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTrampPhysDevs: Failed during dispatch call " "of \'vkEnumeratePhysicalDevices\' to lower layers or " - "loader."); + "loader to get content."); goto out; } // Copy or create everything to fill the new array of physical devices for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { - // Check if this physical device is already in the old buffer - for (uint32_t old_idx = 0; - old_idx < inst->phys_dev_count_tramp; - old_idx++) { - if (local_phys_devs[new_idx] == - inst->phys_devs_tramp[old_idx]->phys_dev) { + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_count_tramp; old_idx++) { + if (local_phys_devs[new_idx] == inst->phys_devs_tramp[old_idx]->phys_dev) { new_phys_devs[new_idx] = inst->phys_devs_tramp[old_idx]; break; } @@ -5434,10 +4724,8 @@ VkResult setupLoaderTrampPhysDevs(VkInstance instance) { // If this physical device isn't in the old buffer, create it if (NULL == new_phys_devs[new_idx]) { - new_phys_devs[new_idx] = (struct loader_physical_device_tramp *) - loader_instance_heap_alloc( - inst, sizeof(struct loader_physical_device_tramp), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + new_phys_devs[new_idx] = (struct loader_physical_device_tramp *)loader_instance_heap_alloc( + inst, sizeof(struct loader_physical_device_tramp), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == new_phys_devs[new_idx]) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTrampPhysDevs: Failed to allocate " @@ -5478,8 +4766,7 @@ out: } } if (!found) { - loader_instance_heap_free(inst, - inst->phys_devs_tramp[i]); + loader_instance_heap_free(inst, inst->phys_devs_tramp[i]); } } loader_instance_heap_free(inst, inst->phys_devs_tramp); @@ -5498,14 +4785,13 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { struct loader_icd_term *icd_term; struct loader_phys_dev_per_icd *icd_phys_dev_array = NULL; struct loader_physical_device_term **new_phys_devs = NULL; - uint32_t i = 0; inst->total_gpu_count = 0; // Allocate something to store the physical device characteristics // that we read from each ICD. - icd_phys_dev_array = (struct loader_phys_dev_per_icd *)loader_stack_alloc( - sizeof(struct loader_phys_dev_per_icd) * inst->total_icd_count); + icd_phys_dev_array = + (struct loader_phys_dev_per_icd *)loader_stack_alloc(sizeof(struct loader_phys_dev_per_icd) * inst->total_icd_count); if (NULL == icd_phys_dev_array) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Failed to allocate temporary " @@ -5514,47 +4800,40 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - memset(icd_phys_dev_array, 0, - sizeof(struct loader_phys_dev_per_icd) * inst->total_icd_count); + memset(icd_phys_dev_array, 0, sizeof(struct loader_phys_dev_per_icd) * inst->total_icd_count); icd_term = inst->icd_terms; // For each ICD, query the number of physical devices, and then get an // internal value for those physical devices. - while (NULL != icd_term) { - res = icd_term->EnumeratePhysicalDevices( - icd_term->instance, &icd_phys_dev_array[i].count, NULL); + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &icd_phys_dev_array[icd_idx].count, NULL); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Call to " "ICD %d's \'vkEnumeratePhysicalDevices\' failed with" " error 0x%08x", - i, res); + icd_idx, res); goto out; } - icd_phys_dev_array[i].phys_devs = - (VkPhysicalDevice *)loader_stack_alloc(icd_phys_dev_array[i].count * - sizeof(VkPhysicalDevice)); - if (NULL == icd_phys_dev_array[i].phys_devs) { + icd_phys_dev_array[icd_idx].phys_devs = + (VkPhysicalDevice *)loader_stack_alloc(icd_phys_dev_array[icd_idx].count * sizeof(VkPhysicalDevice)); + if (NULL == icd_phys_dev_array[icd_idx].phys_devs) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Failed to allocate temporary " "ICD Physical device array for ICD %d of size %d", - i, inst->total_gpu_count); + icd_idx, inst->total_gpu_count); res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - res = icd_term->EnumeratePhysicalDevices( - icd_term->instance, &(icd_phys_dev_array[i].count), - icd_phys_dev_array[i].phys_devs); + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &(icd_phys_dev_array[icd_idx].count), + icd_phys_dev_array[icd_idx].phys_devs); if (VK_SUCCESS != res) { goto out; } - inst->total_gpu_count += icd_phys_dev_array[i].count; - icd_phys_dev_array[i].this_icd_term = icd_term; - - icd_term = icd_term->next; - i++; + inst->total_gpu_count += icd_phys_dev_array[icd_idx].count; + icd_phys_dev_array[icd_idx].this_icd_term = icd_term; } if (0 == inst->total_gpu_count) { @@ -5565,10 +4844,8 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { goto out; } - new_phys_devs = loader_instance_heap_alloc( - inst, - sizeof(struct loader_physical_device_term *) * inst->total_gpu_count, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + new_phys_devs = loader_instance_heap_alloc(inst, sizeof(struct loader_physical_device_term *) * inst->total_gpu_count, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == new_phys_devs) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Failed to allocate new physical" @@ -5577,22 +4854,16 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - memset(new_phys_devs, 0, sizeof(struct loader_physical_device_term *) * - inst->total_gpu_count); + memset(new_phys_devs, 0, sizeof(struct loader_physical_device_term *) * inst->total_gpu_count); // Copy or create everything to fill the new array of physical devices uint32_t idx = 0; for (uint32_t icd_idx = 0; icd_idx < inst->total_icd_count; icd_idx++) { - for (uint32_t pd_idx = 0; pd_idx < icd_phys_dev_array[icd_idx].count; - pd_idx++) { - + for (uint32_t pd_idx = 0; pd_idx < icd_phys_dev_array[icd_idx].count; pd_idx++) { // Check if this physical device is already in the old buffer if (NULL != inst->phys_devs_term) { - for (uint32_t old_idx = 0; - old_idx < inst->phys_dev_count_term; - old_idx++) { - if (icd_phys_dev_array[icd_idx].phys_devs[pd_idx] == - inst->phys_devs_term[old_idx]->phys_dev) { + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_count_term; old_idx++) { + if (icd_phys_dev_array[icd_idx].phys_devs[pd_idx] == inst->phys_devs_term[old_idx]->phys_dev) { new_phys_devs[idx] = inst->phys_devs_term[old_idx]; break; } @@ -5601,9 +4872,8 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { // If this physical device isn't in the old buffer, then we // need to create it. if (NULL == new_phys_devs[idx]) { - new_phys_devs[idx] = loader_instance_heap_alloc( - inst, sizeof(struct loader_physical_device_term), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + new_phys_devs[idx] = loader_instance_heap_alloc(inst, sizeof(struct loader_physical_device_term), + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (NULL == new_phys_devs[idx]) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevs: Failed to allocate " @@ -5615,11 +4885,9 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { } loader_set_dispatch((void *)new_phys_devs[idx], inst->disp); - new_phys_devs[idx]->this_icd_term = - icd_phys_dev_array[icd_idx].this_icd_term; + new_phys_devs[idx]->this_icd_term = icd_phys_dev_array[icd_idx].this_icd_term; new_phys_devs[idx]->icd_index = (uint8_t)(icd_idx); - new_phys_devs[idx]->phys_dev = - icd_phys_dev_array[icd_idx].phys_devs[pd_idx]; + new_phys_devs[idx]->phys_dev = icd_phys_dev_array[icd_idx].phys_devs[pd_idx]; } idx++; } @@ -5628,35 +4896,29 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { out: if (VK_SUCCESS != res) { - if (NULL != inst->phys_devs_term) { - // We've encountered an error, so we should free the - // new buffers. + if (NULL != new_phys_devs) { + // We've encountered an error, so we should free the new buffers. for (uint32_t i = 0; i < inst->total_gpu_count; i++) { loader_instance_heap_free(inst, new_phys_devs[i]); } - loader_instance_heap_free(inst, inst->phys_devs_term); - inst->total_gpu_count = 0; + loader_instance_heap_free(inst, new_phys_devs); } + inst->total_gpu_count = 0; } else { // Free everything that didn't carry over to the new array of // physical devices. Everything else will have been copied over // to the new array. if (NULL != inst->phys_devs_term) { - for (uint32_t cur_pd = 0; cur_pd < inst->phys_dev_count_term; - cur_pd++) { + for (uint32_t cur_pd = 0; cur_pd < inst->phys_dev_count_term; cur_pd++) { bool found = false; - for (uint32_t new_pd_idx = 0; - new_pd_idx < inst->total_gpu_count; - new_pd_idx++) { - if (inst->phys_devs_term[cur_pd] == - new_phys_devs[new_pd_idx]) { + for (uint32_t new_pd_idx = 0; new_pd_idx < inst->total_gpu_count; new_pd_idx++) { + if (inst->phys_devs_term[cur_pd] == new_phys_devs[new_pd_idx]) { found = true; break; } } if (!found) { - loader_instance_heap_free(inst, - inst->phys_devs_term[cur_pd]); + loader_instance_heap_free(inst, inst->phys_devs_term[cur_pd]); } } loader_instance_heap_free(inst, inst->phys_devs_term); @@ -5670,19 +4932,16 @@ out: return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices( - VkInstance instance, uint32_t *pPhysicalDeviceCount, - VkPhysicalDevice *pPhysicalDevices) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, + VkPhysicalDevice *pPhysicalDevices) { struct loader_instance *inst = (struct loader_instance *)instance; VkResult res = VK_SUCCESS; - // Only do the setup if we're re-querying the number of devices, or - // our count is currently 0. - if (NULL == pPhysicalDevices || 0 == inst->total_gpu_count) { - res = setupLoaderTermPhysDevs(inst); - if (VK_SUCCESS != res) { - goto out; - } + // Always call the setup loader terminator physical devices because they may + // have changed at any point. + res = setupLoaderTermPhysDevs(inst); + if (VK_SUCCESS != res) { + goto out; } uint32_t copy_count = inst->total_gpu_count; @@ -5704,101 +4963,84 @@ out: return res; } -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceProperties) { - icd_term->GetPhysicalDeviceProperties(phys_dev_term->phys_dev, - pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceProperties) { + icd_term->dispatch.GetPhysicalDeviceProperties(phys_dev_term->phys_dev, pProperties); } } -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceQueueFamilyProperties) { - icd_term->GetPhysicalDeviceQueueFamilyProperties( - phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties) { + icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pProperties); } } -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceMemoryProperties) { - icd_term->GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, - pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceMemoryProperties) { + icd_term->dispatch.GetPhysicalDeviceMemoryProperties(phys_dev_term->phys_dev, pProperties); } } -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures *pFeatures) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceFeatures) { - icd_term->GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, pFeatures); + if (NULL != icd_term->dispatch.GetPhysicalDeviceFeatures) { + icd_term->dispatch.GetPhysicalDeviceFeatures(phys_dev_term->phys_dev, pFeatures); } } -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties *pFormatInfo) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, + VkFormatProperties *pFormatInfo) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceFormatProperties) { - icd_term->GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, - format, pFormatInfo); + if (NULL != icd_term->dispatch.GetPhysicalDeviceFormatProperties) { + icd_term->dispatch.GetPhysicalDeviceFormatProperties(phys_dev_term->phys_dev, format, pFormatInfo); } } -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkImageFormatProperties *pImageFormatProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, + VkImageType type, VkImageTiling tiling, + VkImageUsageFlags usage, VkImageCreateFlags flags, + VkImageFormatProperties *pImageFormatProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->GetPhysicalDeviceImageFormatProperties) { + if (NULL == icd_term->dispatch.GetPhysicalDeviceImageFormatProperties) { loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "Encountered the vkEnumerateDeviceLayerProperties " "terminator. This means a layer improperly continued."); return VK_ERROR_INITIALIZATION_FAILED; } - return icd_term->GetPhysicalDeviceImageFormatProperties( - phys_dev_term->phys_dev, format, type, tiling, usage, flags, - pImageFormatProperties); + return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties(phys_dev_term->phys_dev, format, type, tiling, usage, flags, + pImageFormatProperties); } -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceSparseImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkSampleCountFlagBits samples, VkImageUsageFlags usage, - VkImageTiling tiling, uint32_t *pNumProperties, - VkSparseImageFormatProperties *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, + VkImageType type, VkSampleCountFlagBits samples, + VkImageUsageFlags usage, VkImageTiling tiling, + uint32_t *pNumProperties, + VkSparseImageFormatProperties *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL != icd_term->GetPhysicalDeviceSparseImageFormatProperties) { - icd_term->GetPhysicalDeviceSparseImageFormatProperties( - phys_dev_term->phys_dev, format, type, samples, usage, tiling, - pNumProperties, pProperties); + if (NULL != icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties) { + icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties(phys_dev_term->phys_dev, format, type, samples, usage, + tiling, pNumProperties, pProperties); } } -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( - VkPhysicalDevice physicalDevice, const char *pLayerName, - uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, + const char *pLayerName, uint32_t *pPropertyCount, + VkExtensionProperties *pProperties) { struct loader_physical_device_term *phys_dev_term; struct loader_layer_list implicit_layer_list = {0}; @@ -5807,70 +5049,51 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( assert(pLayerName == NULL || strlen(pLayerName) == 0); - /* Any layer or trampoline wrapping should be removed at this point in time - * can just cast to the expected type for VkPhysicalDevice. */ + // Any layer or trampoline wrapping should be removed at this point in time can just cast to the expected + // type for VkPhysicalDevice. phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - /* this case is during the call down the instance chain with pLayerName - * == NULL*/ + // This case is during the call down the instance chain with pLayerName == NULL struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; uint32_t icd_ext_count = *pPropertyCount; VkResult res; - /* get device extensions */ - res = icd_term->EnumerateDeviceExtensionProperties( - phys_dev_term->phys_dev, NULL, &icd_ext_count, pProperties); + // Get the available device extensions + res = icd_term->dispatch.EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, pProperties); if (res != VK_SUCCESS) { goto out; } - if (!loader_init_layer_list(icd_term->this_instance, - &implicit_layer_list)) { + if (!loader_init_layer_list(icd_term->this_instance, &implicit_layer_list)) { res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - loader_add_layer_implicit( - icd_term->this_instance, VK_LAYER_TYPE_INSTANCE_IMPLICIT, - &implicit_layer_list, &icd_term->this_instance->instance_layer_list); - /* we need to determine which implicit layers are active, - * and then add their extensions. This can't be cached as - * it depends on results of environment variables (which can change). - */ + loader_add_layer_implicit(icd_term->this_instance, VK_LAYER_TYPE_INSTANCE_IMPLICIT, &implicit_layer_list, + &icd_term->this_instance->instance_layer_list); + // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as + // it depends on results of environment variables (which can change). if (pProperties != NULL) { - /* initialize dev_extension list within the physicalDevice object */ - res = loader_init_device_extensions(icd_term->this_instance, - phys_dev_term, icd_ext_count, - pProperties, &icd_exts); + // Initialize dev_extension list within the physicalDevice object + res = loader_init_device_extensions(icd_term->this_instance, phys_dev_term, icd_ext_count, pProperties, &icd_exts); if (res != VK_SUCCESS) { goto out; } - /* we need to determine which implicit layers are active, - * and then add their extensions. This can't be cached as - * it depends on results of environment variables (which can - * change). - */ - res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, - icd_exts.count, icd_exts.list); + // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as + // it depends on results of environment variables (which can change). + res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, icd_exts.count, icd_exts.list); if (res != VK_SUCCESS) { goto out; } - loader_add_layer_implicit( - icd_term->this_instance, VK_LAYER_TYPE_INSTANCE_IMPLICIT, - &implicit_layer_list, - &icd_term->this_instance->instance_layer_list); + loader_add_layer_implicit(icd_term->this_instance, VK_LAYER_TYPE_INSTANCE_IMPLICIT, &implicit_layer_list, + &icd_term->this_instance->instance_layer_list); for (uint32_t i = 0; i < implicit_layer_list.count; i++) { - for (uint32_t j = 0; - j < implicit_layer_list.list[i].device_extension_list.count; - j++) { - res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, - 1, - &implicit_layer_list.list[i] - .device_extension_list.list[j] - .props); + for (uint32_t j = 0; j < implicit_layer_list.list[i].device_extension_list.count; j++) { + res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, 1, + &implicit_layer_list.list[i].device_extension_list.list[j].props); if (res != VK_SUCCESS) { goto out; } @@ -5882,22 +5105,20 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( for (uint32_t i = 0; i < all_exts.count && i < capacity; i++) { props[i] = all_exts.list[i]; } - /* wasn't enough space for the extensions, we did partial copy now - * return VK_INCOMPLETE */ + + // Wasn't enough space for the extensions, we did partial copy now return VK_INCOMPLETE if (capacity < all_exts.count) { res = VK_INCOMPLETE; } else { *pPropertyCount = all_exts.count; } } else { - /* just return the count; need to add in the count of implicit layer - * extensions - * don't worry about duplicates being added in the count */ + // Just return the count; need to add in the count of implicit layer extensions + // don't worry about duplicates being added in the count *pPropertyCount = icd_ext_count; for (uint32_t i = 0; i < implicit_layer_list.count; i++) { - *pPropertyCount += - implicit_layer_list.list[i].device_extension_list.count; + *pPropertyCount += implicit_layer_list.list[i].device_extension_list.count; } res = VK_SUCCESS; } @@ -5905,27 +5126,21 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( out: if (NULL != implicit_layer_list.list) { - loader_destroy_generic_list( - icd_term->this_instance, - (struct loader_generic_list *)&implicit_layer_list); + loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&implicit_layer_list); } if (NULL != all_exts.list) { - loader_destroy_generic_list(icd_term->this_instance, - (struct loader_generic_list *)&all_exts); + loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&all_exts); } if (NULL != icd_exts.list) { - loader_destroy_generic_list(icd_term->this_instance, - (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts); } return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkLayerProperties *pProperties) { - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, + VkLayerProperties *pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "Encountered the vkEnumerateDeviceLayerProperties " diff --git a/third_party/vulkan/loader/loader.h b/third_party/vulkan/loader/loader.h index 019125f00..78160d0df 100644 --- a/third_party/vulkan/loader/loader.h +++ b/third_party/vulkan/loader/loader.h @@ -32,9 +32,9 @@ #include "vk_loader_platform.h" #include "vk_loader_layer.h" #include - #include #include +#include "vk_loader_extensions.h" #if defined(__GNUC__) && __GNUC__ >= 4 #define LOADER_EXPORT __attribute__((visibility("default"))) @@ -58,7 +58,6 @@ #define MAX_NUM_UNKNOWN_EXTS 250 #endif - enum layer_type { VK_LAYER_TYPE_INSTANCE_EXPLICIT = 0x1, VK_LAYER_TYPE_INSTANCE_IMPLICIT = 0x2, @@ -82,15 +81,13 @@ static const char UTF8_THREE_BYTE_MASK = 0xF8; static const char UTF8_DATA_BYTE_CODE = 0x80; static const char UTF8_DATA_BYTE_MASK = 0xC0; -static const char std_validation_names[7][VK_MAX_EXTENSION_NAME_SIZE] = { - "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", - "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_image", - "VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain", - "VK_LAYER_GOOGLE_unique_objects"}; +static const char std_validation_names[6][VK_MAX_EXTENSION_NAME_SIZE] = { + "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", "VK_LAYER_LUNARG_object_tracker", + "VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain", "VK_LAYER_GOOGLE_unique_objects"}; struct VkStructureHeader { VkStructureType sType; - const void* pNext; + const void *pNext; }; // form of all dynamic lists/arrays @@ -137,7 +134,7 @@ struct loader_layer_functions { struct loader_layer_properties { VkLayerProperties info; enum layer_type type; - uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion + uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion char lib_name[MAX_STRING_SIZE]; loader_platform_dl_handle lib_handle; struct loader_layer_functions functions; @@ -156,17 +153,16 @@ struct loader_layer_list { struct loader_dispatch_hash_list { size_t capacity; uint32_t count; - uint32_t *index; // index into the dev_ext dispatch table + uint32_t *index; // index into the dev_ext dispatch table }; - // loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.dev_ext have // one to one correspondence; one loader_dispatch_hash_entry for one dev_ext // dispatch entry. // Also have a one to one correspondence with functions in dev_ext_trampoline.c struct loader_dispatch_hash_entry { char *func_name; - struct loader_dispatch_hash_list list; // to handle hashing collisions + struct loader_dispatch_hash_list list; // to handle hashing collisions }; typedef void(VKAPI_PTR *PFN_vkDevExt)(VkDevice device); @@ -182,8 +178,8 @@ struct loader_dev_dispatch_table { // per CreateDevice structure struct loader_device { struct loader_dev_dispatch_table loader_dispatch; - VkDevice chain_device; // device object from the dispatch chain - VkDevice icd_device; // device object from the icd + VkDevice chain_device; // device object from the dispatch chain + VkDevice icd_device; // device object from the icd struct loader_physical_device_term *phys_dev_term; struct loader_layer_list activated_layer_list; @@ -193,159 +189,57 @@ struct loader_device { struct loader_device *next; }; -/* per ICD structure */ +// Per ICD information + +// Per ICD structure struct loader_icd_term { // pointers to find other structs const struct loader_scanned_icd *scanned_icd; const struct loader_instance *this_instance; struct loader_device *logical_device_list; - VkInstance instance; // instance object from the icd - PFN_vkGetDeviceProcAddr GetDeviceProcAddr; - PFN_vkDestroyInstance DestroyInstance; - PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; - PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; - PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; - PFN_vkGetPhysicalDeviceImageFormatProperties - GetPhysicalDeviceImageFormatProperties; - PFN_vkCreateDevice CreateDevice; - PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties - GetPhysicalDeviceQueueFamilyProperties; - PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; - PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties - GetPhysicalDeviceSparseImageFormatProperties; - // WSI extensions - PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR - GetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR - GetPhysicalDeviceSurfacePresentModesKHR; -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR - GetPhysicalDeviceWin32PresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_MIR_KHR - PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; - PFN_vkGetPhysicalDeviceMirPresentationSupportKHR - GetPhysicalDeviceMirPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR - GetPhysicalDeviceWaylandPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR - GetPhysicalDeviceXcbPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR - GetPhysicalDeviceXlibPresentationSupportKHR; -#endif - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR - GetPhysicalDeviceDisplayPropertiesKHR; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR - GetPhysicalDeviceDisplayPlanePropertiesKHR; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR - GetDisplayPlaneSupportedDisplaysKHR; - PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR; - PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR; - PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR; - PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR; - PFN_vkDestroySurfaceKHR DestroySurfaceKHR; - PFN_vkCreateSwapchainKHR CreateSwapchainKHR; - PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; - - // KHR_get_physical_device_properties2 - PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; - PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceFormatProperties2KHR - GetPhysicalDeviceFormatProperties2KHR; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR - GetPhysicalDeviceImageFormatProperties2KHR; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR - GetPhysicalDeviceQueueFamilyProperties2KHR; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR - GetPhysicalDeviceMemoryProperties2KHR; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR - GetPhysicalDeviceSparseImageFormatProperties2KHR; - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; - PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; -#endif - - // EXT_debug_report - PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; - PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; - PFN_vkDebugReportMessageEXT DebugReportMessageEXT; - - // EXT_debug_marker (items needing a trampoline/terminator) - PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; - PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; - - // EXT_direct_mode_display - PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; - - // EXT_display_surface_counter - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT - GetPhysicalDeviceSurfaceCapabilities2EXT; - - // NV_external_memory_capabilities - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV - GetPhysicalDeviceExternalImageFormatPropertiesNV; - - // NVX_device_generated_commands - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX - GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + VkInstance instance; // instance object from the icd + struct loader_icd_term_dispatch dispatch; struct loader_icd_term *next; - PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; + PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; }; -// per ICD library structure +// Per ICD library structure struct loader_icd_tramp_list { size_t capacity; uint32_t count; struct loader_scanned_icd *scanned_list; }; -union loader_instance_extension_enables { - struct { - uint8_t khr_get_physical_device_properties2 : 1; - uint8_t ext_acquire_xlib_display : 1; - uint8_t ext_debug_report : 1; - uint8_t ext_direct_mode_display : 1; - uint8_t ext_display_surface_counter : 1; - uint8_t nv_external_memory_capabilities : 1; - }; - uint64_t padding[4]; -}; - struct loader_instance_dispatch_table { - VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure + VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure // Physical device functions unknown to the loader - PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; + PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS]; }; -// per instance structure +// Per instance structure struct loader_instance { - struct loader_instance_dispatch_table *disp; // must be first entry in structure + struct loader_instance_dispatch_table *disp; // must be first entry in structure + // We need to manually track physical devices over time. If the user + // re-queries the information, we don't want to delete old data or + // create new data unless necessary. uint32_t total_gpu_count; uint32_t phys_dev_count_term; struct loader_physical_device_term **phys_devs_term; uint32_t phys_dev_count_tramp; struct loader_physical_device_tramp **phys_devs_tramp; + // We also need to manually track physical device groups, but we don't need + // loader specific structures since we have that content in the physical + // device stored internal to the public structures. + uint32_t phys_dev_group_count_term; + struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_term; + uint32_t phys_dev_group_count_tramp; + struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_tramp; + struct loader_instance *next; uint32_t total_icd_count; @@ -360,9 +254,9 @@ struct loader_instance { struct loader_layer_list instance_layer_list; struct loader_layer_list activated_layer_list; bool activated_layers_are_std_val; - VkInstance instance; // layers/ICD instance returned to trampoline + VkInstance instance; // layers/ICD instance returned to trampoline - struct loader_extension_list ext_list; // icds and loaders extensions + struct loader_extension_list ext_list; // icds and loaders extensions union loader_instance_extension_enables enabled_known_extensions; VkLayerDbgFunctionNode *DbgFunctionHead; @@ -394,32 +288,32 @@ struct loader_instance { bool wsi_display_enabled; }; -/* VkPhysicalDevice requires special treatment by loader. Firstly, terminator - * code must be able to get the struct loader_icd_term to call into the proper - * driver (multiple ICD/gpu case). This can be accomplished by wrapping the - * created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices(). - * Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice - * in trampoline code. This implies, that the loader trampoline code must also - * wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to - * wrap the VkPhysicalDevice created object twice. In trampoline code it can't - * rely on the terminator object wrapping since a layer may also wrap. Since - * trampoline code wraps the VkPhysicalDevice this means all loader trampoline - * code that passes a VkPhysicalDevice should unwrap it. */ +// VkPhysicalDevice requires special treatment by loader. Firstly, terminator +// code must be able to get the struct loader_icd_term to call into the proper +// driver (multiple ICD/gpu case). This can be accomplished by wrapping the +// created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices(). +// Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice +// in trampoline code. This implies, that the loader trampoline code must also +// wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to +// wrap the VkPhysicalDevice created object twice. In trampoline code it can't +// rely on the terminator object wrapping since a layer may also wrap. Since +// trampoline code wraps the VkPhysicalDevice this means all loader trampoline +// code that passes a VkPhysicalDevice should unwrap it. -/* per enumerated PhysicalDevice structure, used to wrap in trampoline code and - also same structure used to wrap in terminator code */ +// Per enumerated PhysicalDevice structure, used to wrap in trampoline code and +// also same structure used to wrap in terminator code struct loader_physical_device_tramp { - struct loader_instance_dispatch_table *disp; // must be first entry in structure + struct loader_instance_dispatch_table *disp; // must be first entry in structure struct loader_instance *this_instance; - VkPhysicalDevice phys_dev; // object from layers/loader terminator + VkPhysicalDevice phys_dev; // object from layers/loader terminator }; -/* per enumerated PhysicalDevice structure, used to wrap in terminator code */ +// Per enumerated PhysicalDevice structure, used to wrap in terminator code struct loader_physical_device_term { - struct loader_instance_dispatch_table *disp; // must be first entry in structure + struct loader_instance_dispatch_table *disp; // must be first entry in structure struct loader_icd_term *this_icd_term; uint8_t icd_index; - VkPhysicalDevice phys_dev; // object from ICD + VkPhysicalDevice phys_dev; // object from ICD }; struct loader_struct { @@ -434,41 +328,29 @@ struct loader_scanned_icd { PFN_vkGetInstanceProcAddr GetInstanceProcAddr; PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; PFN_vkCreateInstance CreateInstance; - PFN_vkEnumerateInstanceExtensionProperties - EnumerateInstanceExtensionProperties; + PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; }; -static inline struct loader_instance *loader_instance(VkInstance instance) { - return (struct loader_instance *)instance; -} +static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; } -static inline VkPhysicalDevice -loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) { - struct loader_physical_device_tramp *phys_dev = - (struct loader_physical_device_tramp *)physicalDevice; +static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) { + struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice; return phys_dev->phys_dev; } -static inline void loader_set_dispatch(void *obj, const void *data) { - *((const void **)obj) = data; -} +static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; } -static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { - return *((VkLayerDispatchTable **)obj); -} +static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { return *((VkLayerDispatchTable **)obj); } -static inline struct loader_dev_dispatch_table * -loader_get_dev_dispatch(const void *obj) { +static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void *obj) { return *((struct loader_dev_dispatch_table **)obj); } -static inline VkLayerInstanceDispatchTable * -loader_get_instance_layer_dispatch(const void *obj) { +static inline VkLayerInstanceDispatchTable *loader_get_instance_layer_dispatch(const void *obj) { return *((VkLayerInstanceDispatchTable **)obj); } -static inline struct loader_instance_dispatch_table * -loader_get_instance_dispatch(const void *obj) { +static inline struct loader_instance_dispatch_table *loader_get_instance_dispatch(const void *obj) { return *((struct loader_instance_dispatch_table **)obj); } @@ -482,13 +364,12 @@ static inline void loader_init_dispatch(void *obj, const void *data) { loader_set_dispatch(obj, data); } -/* global variables used across files */ +// Global variables used across files extern struct loader_struct loader; extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); extern loader_platform_thread_mutex loader_lock; extern loader_platform_thread_mutex loader_json_lock; -extern const VkLayerInstanceDispatchTable instance_disp; extern const char *std_validation_str; struct loader_msg_callback_map_entry { @@ -496,242 +377,105 @@ struct loader_msg_callback_map_entry { VkDebugReportCallbackEXT loader_obj; }; -/* helper function definitions */ -void *loader_instance_heap_alloc(const struct loader_instance *instance, - size_t size, - VkSystemAllocationScope allocationScope); -void loader_instance_heap_free(const struct loader_instance *instance, - void *pMemory); -void *loader_instance_heap_realloc(const struct loader_instance *instance, - void *pMemory, size_t orig_size, size_t size, +// Helper function definitions +void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope allocationScope); +void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory); +void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size, VkSystemAllocationScope alloc_scope); void *loader_instance_tls_heap_alloc(size_t size); void loader_instance_tls_heap_free(void *pMemory); -void *loader_device_heap_alloc(const struct loader_device *device, size_t size, - VkSystemAllocationScope allocationScope); +void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope allocationScope); void loader_device_heap_free(const struct loader_device *device, void *pMemory); -void *loader_device_heap_realloc(const struct loader_device *device, - void *pMemory, size_t orig_size, size_t size, +void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size, VkSystemAllocationScope alloc_scope); -void loader_log(const struct loader_instance *inst, VkFlags msg_type, - int32_t msg_code, const char *format, ...); +void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...); -bool compare_vk_extension_properties(const VkExtensionProperties *op1, - const VkExtensionProperties *op2); +bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2); -VkResult loader_validate_layers(const struct loader_instance *inst, - const uint32_t layer_count, - const char *const *ppEnabledLayerNames, - const struct loader_layer_list *list); +VkResult loader_validate_layers(const struct loader_instance *inst, const uint32_t layer_count, + const char *const *ppEnabledLayerNames, const struct loader_layer_list *list); -VkResult loader_validate_instance_extensions( - const struct loader_instance *inst, - const struct loader_extension_list *icd_exts, - const struct loader_layer_list *instance_layer, - const VkInstanceCreateInfo *pCreateInfo); +VkResult loader_validate_instance_extensions(const struct loader_instance *inst, const struct loader_extension_list *icd_exts, + const struct loader_layer_list *instance_layer, + const VkInstanceCreateInfo *pCreateInfo); void loader_initialize(void); -VkResult loader_copy_layer_properties(const struct loader_instance *inst, - struct loader_layer_properties *dst, +VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst, struct loader_layer_properties *src); -bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, - const uint32_t count, +bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count, const VkExtensionProperties *ext_array); -bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, - const struct loader_extension_list *ext_list); +bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list); -VkResult loader_add_to_ext_list(const struct loader_instance *inst, - struct loader_extension_list *ext_list, - uint32_t prop_list_count, - const VkExtensionProperties *props); -VkResult -loader_add_to_dev_ext_list(const struct loader_instance *inst, - struct loader_device_extension_list *ext_list, - const VkExtensionProperties *props, - uint32_t entry_count, char **entrys); +VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list, + uint32_t prop_list_count, const VkExtensionProperties *props); +VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list, + const VkExtensionProperties *props, uint32_t entry_count, char **entrys); VkResult loader_add_device_extensions(const struct loader_instance *inst, - PFN_vkEnumerateDeviceExtensionProperties - fpEnumerateDeviceExtensionProperties, - VkPhysicalDevice physical_device, - const char *lib_name, + PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties, + VkPhysicalDevice physical_device, const char *lib_name, struct loader_extension_list *ext_list); -VkResult loader_init_generic_list(const struct loader_instance *inst, - struct loader_generic_list *list_info, - size_t element_size); -void loader_destroy_generic_list(const struct loader_instance *inst, - struct loader_generic_list *list); -void loader_destroy_layer_list(const struct loader_instance *inst, - struct loader_device *device, +VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size); +void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list); +void loader_destroy_layer_list(const struct loader_instance *inst, struct loader_device *device, struct loader_layer_list *layer_list); -void loader_delete_layer_properties(const struct loader_instance *inst, - struct loader_layer_list *layer_list); -bool loader_find_layer_name_array( - const char *name, uint32_t layer_count, - const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]); -VkResult loader_expand_layer_names( - struct loader_instance *inst, const char *key_name, uint32_t expand_count, - const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], - uint32_t *layer_count, char const *const **ppp_layer_names); +void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list); +bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]); +VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key_name, uint32_t expand_count, + const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], uint32_t *layer_count, + char const *const **ppp_layer_names); void loader_init_std_validation_props(struct loader_layer_properties *props); -void loader_delete_shadow_dev_layer_names(const struct loader_instance *inst, - const VkDeviceCreateInfo *orig, - VkDeviceCreateInfo *ours); -void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, - const VkInstanceCreateInfo *orig, +void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, const VkInstanceCreateInfo *orig, VkInstanceCreateInfo *ours); -VkResult loader_add_to_layer_list(const struct loader_instance *inst, - struct loader_layer_list *list, - uint32_t prop_list_count, +VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count, const struct loader_layer_properties *props); -void loader_find_layer_name_add_list( - const struct loader_instance *inst, const char *name, - const enum layer_type type, const struct loader_layer_list *search_list, - struct loader_layer_list *found_list); -void loader_scanned_icd_clear(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list); -VkResult loader_icd_scan(const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list); -void loader_layer_scan(const struct loader_instance *inst, - struct loader_layer_list *instance_layers); -void loader_implicit_layer_scan(const struct loader_instance *inst, - struct loader_layer_list *instance_layers); -VkResult loader_get_icd_loader_instance_extensions( - const struct loader_instance *inst, - struct loader_icd_tramp_list *icd_tramp_list, - struct loader_extension_list *inst_exts); -struct loader_icd_term * -loader_get_icd_and_device(const VkDevice device, - struct loader_device **found_dev, - uint32_t *icd_index); -void loader_init_dispatch_dev_ext(struct loader_instance *inst, - struct loader_device *dev); +void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type type, + const struct loader_layer_list *search_list, struct loader_layer_list *found_list); +void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list); +VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list); +void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers); +void loader_implicit_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers); +VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list, + struct loader_extension_list *inst_exts); +struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index); +void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev); void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName); void *loader_get_dev_ext_trampoline(uint32_t index); -bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, - bool perform_checking, void **tramp_addr, void **term_addr); +bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr, + void **term_addr); void *loader_get_phys_dev_ext_tramp(uint32_t index); void *loader_get_phys_dev_ext_termin(uint32_t index); struct loader_instance *loader_get_instance(const VkInstance instance); -void loader_deactivate_layers(const struct loader_instance *instance, - struct loader_device *device, - struct loader_layer_list *list); -struct loader_device * -loader_create_logical_device(const struct loader_instance *inst, - const VkAllocationCallbacks *pAllocator); -void loader_add_logical_device(const struct loader_instance *inst, - struct loader_icd_term *icd_term, +void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list); +struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator); +void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, struct loader_device *found_dev); -void loader_remove_logical_device(const struct loader_instance *inst, - struct loader_icd_term *icd_term, - struct loader_device *found_dev, - const VkAllocationCallbacks *pAllocator); -// NOTE: Outside of loader, this entry-point is only proivided for error +void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term, + struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator); +// NOTE: Outside of loader, this entry-point is only provided for error // cleanup. -void loader_destroy_logical_device(const struct loader_instance *inst, - struct loader_device *dev, +void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev, const VkAllocationCallbacks *pAllocator); -VkResult -loader_enable_instance_layers(struct loader_instance *inst, - const VkInstanceCreateInfo *pCreateInfo, - const struct loader_layer_list *instance_layers); -void loader_deactivate_instance_layers(struct loader_instance *instance); +VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo, + const struct loader_layer_list *instance_layers); -VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - struct loader_instance *inst, - VkInstance *created_instance); +VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, + struct loader_instance *inst, VkInstance *created_instance); -void loader_activate_instance_layer_extensions(struct loader_instance *inst, - VkInstance created_inst); -VkResult -loader_enable_device_layers(const struct loader_instance *inst, - struct loader_layer_list *activated_layer_list, - const VkDeviceCreateInfo *pCreateInfo, - const struct loader_layer_list *device_layers); +void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst); -VkResult -loader_create_device_chain(const struct loader_physical_device_tramp *pd, - const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - const struct loader_instance *inst, - struct loader_device *dev); +VkResult loader_create_device_chain(const struct loader_physical_device_tramp *pd, const VkDeviceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst, + struct loader_device *dev); -VkResult loader_validate_device_extensions( - struct loader_physical_device_tramp *phys_dev, - const struct loader_layer_list *activated_device_layers, - const struct loader_extension_list *icd_exts, - const VkDeviceCreateInfo *pCreateInfo); +VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev, + const struct loader_layer_list *activated_device_layers, + const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo); VkResult setupLoaderTrampPhysDevs(VkInstance instance); VkResult setupLoaderTermPhysDevs(struct loader_instance *inst); -/* instance layer chain termination entrypoint definitions */ -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkInstance *pInstance); +VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array); -VKAPI_ATTR void VKAPI_CALL -terminator_DestroyInstance(VkInstance instance, - const VkAllocationCallbacks *pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_EnumeratePhysicalDevices(VkInstance instance, - uint32_t *pPhysicalDeviceCount, - VkPhysicalDevice *pPhysicalDevices); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures *pFeatures); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties *pFormatInfo); - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkImageFormatProperties *pImageFormatProperties); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceSparseImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkSampleCountFlagBits samples, VkImageUsageFlags usage, - VkImageTiling tiling, uint32_t *pNumProperties, - VkSparseImageFormatProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL -terminator_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( - VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pCount, - VkExtensionProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, - uint32_t *pCount, - VkLayerProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, uint32_t *pCount, - VkQueueFamilyProperties *pProperties); - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties *pProperties); - -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateDevice(VkPhysicalDevice gpu, - const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDevice *pDevice); - -VkStringErrorFlags vk_string_validate(const int max_length, - const char *char_array); - -#endif /* LOADER_H */ +#endif // LOADER_H diff --git a/third_party/vulkan/loader/loader_cmake_config.h b/third_party/vulkan/loader/loader_cmake_config.h new file mode 100644 index 000000000..3d89882bd --- /dev/null +++ b/third_party/vulkan/loader/loader_cmake_config.h @@ -0,0 +1,2 @@ +/* #undef HAVE_SECURE_GETENV */ +/* #undef HAVE___SECURE_GETENV */ diff --git a/third_party/vulkan/loader/murmurhash.c b/third_party/vulkan/loader/murmurhash.c index 5e5d0de64..db6276f5a 100644 --- a/third_party/vulkan/loader/murmurhash.c +++ b/third_party/vulkan/loader/murmurhash.c @@ -41,16 +41,16 @@ uint32_t murmurhash(const char *key, size_t len, uint32_t seed) { uint32_t n = 0xe6546b64; uint32_t h = 0; uint32_t k = 0; - uint8_t *d = (uint8_t *)key; // 32 bit extract from `key' + uint8_t *d = (uint8_t *)key; // 32 bit extract from `key' const uint32_t *chunks = NULL; - const uint8_t *tail = NULL; // tail - last 8 bytes + const uint8_t *tail = NULL; // tail - last 8 bytes int i = 0; - int l = (int)len / 4; // chunk length + int l = (int)len / 4; // chunk length h = seed; - chunks = (const uint32_t *)(d + l * 4); // body - tail = (const uint8_t *)(d + l * 4); // last 8 byte chunk of `key' + chunks = (const uint32_t *)(d + l * 4); // body + tail = (const uint8_t *)(d + l * 4); // last 8 byte chunk of `key' // for each 4 byte chunk of `key' for (i = -l; i != 0; ++i) { @@ -71,18 +71,18 @@ uint32_t murmurhash(const char *key, size_t len, uint32_t seed) { k = 0; // remainder - switch (len & 3) { // `len % 4' - case 3: - k ^= (tail[2] << 16); - case 2: - k ^= (tail[1] << 8); + switch (len & 3) { // `len % 4' + case 3: + k ^= (tail[2] << 16); + case 2: + k ^= (tail[1] << 8); - case 1: - k ^= tail[0]; - k *= c1; - k = (k << r1) | (k >> (32 - r1)); - k *= c2; - h ^= k; + case 1: + k ^= tail[0]; + k *= c1; + k = (k << r1) | (k >> (32 - r1)); + k *= c2; + h ^= k; } h ^= len; diff --git a/third_party/vulkan/loader/phys_dev_ext.c b/third_party/vulkan/loader/phys_dev_ext.c index 908302509..d668b1b90 100644 --- a/third_party/vulkan/loader/phys_dev_ext.c +++ b/third_party/vulkan/loader/phys_dev_ext.c @@ -30,36 +30,33 @@ #include "loader.h" #if defined(__GNUC__) && !defined(__clang__) -#pragma GCC optimize(3) // force gcc to use tail-calls +#pragma GCC optimize(3) // force gcc to use tail-calls #endif // Trampoline function macro for unknown physical device extension command. -#define PhysDevExtTramp(num) \ -VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTramp##num( \ - VkPhysicalDevice physical_device) { \ - const struct loader_instance_dispatch_table *disp; \ - disp = loader_get_instance_dispatch(physical_device); \ - disp->phys_dev_ext[num]( \ - loader_unwrap_physical_device(physical_device)); \ +#define PhysDevExtTramp(num) \ + VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTramp##num(VkPhysicalDevice physical_device) { \ + const struct loader_instance_dispatch_table *disp; \ + disp = loader_get_instance_dispatch(physical_device); \ + disp->phys_dev_ext[num](loader_unwrap_physical_device(physical_device)); \ } // Terminator function macro for unknown physical device extension command. -#define PhysDevExtTermin(num) \ -VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTermin##num( \ - VkPhysicalDevice physical_device) { \ - struct loader_physical_device_term *phys_dev_term = \ - (struct loader_physical_device_term *)physical_device; \ - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; \ - struct loader_instance *inst = \ - (struct loader_instance *)icd_term->this_instance; \ - if (NULL == icd_term->phys_dev_ext[num]) { \ - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, \ - "Extension %s not supported for this physical device", \ - inst->phys_dev_ext_disp_hash[num].func_name); \ - } \ - icd_term->phys_dev_ext[num](phys_dev_term->phys_dev); \ +#define PhysDevExtTermin(num) \ + VKAPI_ATTR void VKAPI_CALL vkPhysDevExtTermin##num(VkPhysicalDevice physical_device) { \ + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physical_device; \ + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; \ + struct loader_instance *inst = (struct loader_instance *)icd_term->this_instance; \ + if (NULL == icd_term->phys_dev_ext[num]) { \ + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "Extension %s not supported for this physical device", \ + inst->phys_dev_ext_disp_hash[num].func_name); \ + } \ + icd_term->phys_dev_ext[num](phys_dev_term->phys_dev); \ } +// Disable clang-format for lists of macros +// clang-format off + // Instantiations of the trampoline and terminator PhysDevExtTramp(0) PhysDevExtTermin(0) PhysDevExtTramp(1) PhysDevExtTermin(1) diff --git a/third_party/vulkan/loader/premake5.lua b/third_party/vulkan/loader/premake5.lua index 07875f5e2..15d05f44c 100644 --- a/third_party/vulkan/loader/premake5.lua +++ b/third_party/vulkan/loader/premake5.lua @@ -17,6 +17,9 @@ project("vulkan-loader") }) recursive_platform_files() + -- Included elsewhere + removefiles("vk_loader_extensions.c") + filter("platforms:Windows") warnings("Off") -- Too many warnings. characterset("MBCS") diff --git a/third_party/vulkan/loader/table_ops.h b/third_party/vulkan/loader/table_ops.h deleted file mode 100644 index b3b90795e..000000000 --- a/third_party/vulkan/loader/table_ops.h +++ /dev/null @@ -1,935 +0,0 @@ -/* - * - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * Copyright (C) 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Courtney Goeltzenleuchter - * Author: Jon Ashburn - * Author: Ian Elliott - * Author: Tony Barbour - */ - -#include -#include -#include -#include "loader.h" -#include "vk_loader_platform.h" - -static VkResult VKAPI_CALL vkDevExtError(VkDevice dev) { - struct loader_device *found_dev; - // The device going in is a trampoline device - struct loader_icd_term *icd_term = - loader_get_icd_and_device(dev, &found_dev, NULL); - - if (icd_term) - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "Bad destination in loader trampoline dispatch," - "Are layers and extensions that you are calling enabled?"); - return VK_ERROR_EXTENSION_NOT_PRESENT; -} - -static inline void -loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, - PFN_vkGetDeviceProcAddr gpa, VkDevice dev) { - VkLayerDispatchTable *table = &dev_table->core_dispatch; - for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) - dev_table->ext_dispatch.dev_ext[i] = (PFN_vkDevExt)vkDevExtError; - - table->GetDeviceProcAddr = - (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr"); - table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice"); - table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue"); - table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit"); - table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle"); - table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle"); - table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory"); - table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory"); - table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory"); - table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory"); - table->FlushMappedMemoryRanges = - (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges"); - table->InvalidateMappedMemoryRanges = - (PFN_vkInvalidateMappedMemoryRanges)gpa( - dev, "vkInvalidateMappedMemoryRanges"); - table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa( - dev, "vkGetDeviceMemoryCommitment"); - table->GetImageSparseMemoryRequirements = - (PFN_vkGetImageSparseMemoryRequirements)gpa( - dev, "vkGetImageSparseMemoryRequirements"); - table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa( - dev, "vkGetBufferMemoryRequirements"); - table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa( - dev, "vkGetImageMemoryRequirements"); - table->BindBufferMemory = - (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory"); - table->BindImageMemory = - (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory"); - table->QueueBindSparse = - (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse"); - table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence"); - table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence"); - table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences"); - table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus"); - table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences"); - table->CreateSemaphore = - (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore"); - table->DestroySemaphore = - (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore"); - table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent"); - table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent"); - table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus"); - table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent"); - table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent"); - table->CreateQueryPool = - (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool"); - table->DestroyQueryPool = - (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool"); - table->GetQueryPoolResults = - (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults"); - table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer"); - table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer"); - table->CreateBufferView = - (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView"); - table->DestroyBufferView = - (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView"); - table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage"); - table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage"); - table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa( - dev, "vkGetImageSubresourceLayout"); - table->CreateImageView = - (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView"); - table->DestroyImageView = - (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView"); - table->CreateShaderModule = - (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule"); - table->DestroyShaderModule = - (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule"); - table->CreatePipelineCache = - (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache"); - table->DestroyPipelineCache = - (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache"); - table->GetPipelineCacheData = - (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData"); - table->MergePipelineCaches = - (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches"); - table->CreateGraphicsPipelines = - (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines"); - table->CreateComputePipelines = - (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines"); - table->DestroyPipeline = - (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline"); - table->CreatePipelineLayout = - (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout"); - table->DestroyPipelineLayout = - (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout"); - table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler"); - table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler"); - table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa( - dev, "vkCreateDescriptorSetLayout"); - table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa( - dev, "vkDestroyDescriptorSetLayout"); - table->CreateDescriptorPool = - (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool"); - table->DestroyDescriptorPool = - (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool"); - table->ResetDescriptorPool = - (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool"); - table->AllocateDescriptorSets = - (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets"); - table->FreeDescriptorSets = - (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets"); - table->UpdateDescriptorSets = - (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets"); - table->CreateFramebuffer = - (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer"); - table->DestroyFramebuffer = - (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer"); - table->CreateRenderPass = - (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass"); - table->DestroyRenderPass = - (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass"); - table->GetRenderAreaGranularity = - (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity"); - table->CreateCommandPool = - (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool"); - table->DestroyCommandPool = - (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool"); - table->ResetCommandPool = - (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool"); - table->AllocateCommandBuffers = - (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers"); - table->FreeCommandBuffers = - (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers"); - table->BeginCommandBuffer = - (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer"); - table->EndCommandBuffer = - (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer"); - table->ResetCommandBuffer = - (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer"); - table->CmdBindPipeline = - (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline"); - table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport"); - table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor"); - table->CmdSetLineWidth = - (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth"); - table->CmdSetDepthBias = - (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias"); - table->CmdSetBlendConstants = - (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants"); - table->CmdSetDepthBounds = - (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds"); - table->CmdSetStencilCompareMask = - (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask"); - table->CmdSetStencilWriteMask = - (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask"); - table->CmdSetStencilReference = - (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference"); - table->CmdBindDescriptorSets = - (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets"); - table->CmdBindVertexBuffers = - (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers"); - table->CmdBindIndexBuffer = - (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer"); - table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw"); - table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed"); - table->CmdDrawIndirect = - (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect"); - table->CmdDrawIndexedIndirect = - (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect"); - table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch"); - table->CmdDispatchIndirect = - (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect"); - table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer"); - table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage"); - table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage"); - table->CmdCopyBufferToImage = - (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage"); - table->CmdCopyImageToBuffer = - (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer"); - table->CmdUpdateBuffer = - (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer"); - table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer"); - table->CmdClearColorImage = - (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage"); - table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa( - dev, "vkCmdClearDepthStencilImage"); - table->CmdClearAttachments = - (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments"); - table->CmdResolveImage = - (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage"); - table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent"); - table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent"); - table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents"); - table->CmdPipelineBarrier = - (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier"); - table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery"); - table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery"); - table->CmdResetQueryPool = - (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool"); - table->CmdWriteTimestamp = - (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp"); - table->CmdCopyQueryPoolResults = - (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults"); - table->CmdPushConstants = - (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants"); - table->CmdBeginRenderPass = - (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass"); - table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass"); - table->CmdEndRenderPass = - (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass"); - table->CmdExecuteCommands = - (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands"); -} - -static inline void loader_init_device_extension_dispatch_table( - struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa, - VkDevice dev) { - VkLayerDispatchTable *table = &dev_table->core_dispatch; - table->AcquireNextImageKHR = - (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR"); - table->CreateSwapchainKHR = - (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR"); - table->DestroySwapchainKHR = - (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR"); - table->GetSwapchainImagesKHR = - (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR"); - table->QueuePresentKHR = - (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR"); - - // KHR_display_swapchain - table->CreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR)gpa( - dev, "vkCreateSharedSwapchainsKHR"); - - // KHR_maintenance1 - table->TrimCommandPoolKHR = - (PFN_vkTrimCommandPoolKHR)gpa(dev, "vkTrimCommandPoolKHR"); - - // EXT_display_control - table->DisplayPowerControlEXT = - (PFN_vkDisplayPowerControlEXT)gpa(dev, "vkDisplayPowerControlEXT"); - table->RegisterDeviceEventEXT = - (PFN_vkRegisterDeviceEventEXT)gpa(dev, "vkRegisterDeviceEventEXT"); - table->RegisterDisplayEventEXT = - (PFN_vkRegisterDisplayEventEXT)gpa(dev, "vkRegisterDisplayEventEXT"); - table->GetSwapchainCounterEXT = - (PFN_vkGetSwapchainCounterEXT)gpa(dev, "vkGetSwapchainCounterEXT"); - - // EXT_debug_marker - table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)gpa( - dev, "vkDebugMarkerSetObjectTagEXT"); - table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)gpa( - dev, "vkDebugMarkerSetObjectNameEXT"); - table->CmdDebugMarkerBeginEXT = - (PFN_vkCmdDebugMarkerBeginEXT)gpa(dev, "vkCmdDebugMarkerBeginEXT"); - table->CmdDebugMarkerEndEXT = - (PFN_vkCmdDebugMarkerEndEXT)gpa(dev, "vkCmdDebugMarkerEndEXT"); - table->CmdDebugMarkerInsertEXT = - (PFN_vkCmdDebugMarkerInsertEXT)gpa(dev, "vkCmdDebugMarkerInsertEXT"); - - // AMD_draw_indirect_count - table->CmdDrawIndirectCountAMD = - (PFN_vkCmdDrawIndirectCountAMD)gpa(dev, "vkCmdDrawIndirectCountAMD"); - table->CmdDrawIndexedIndirectCountAMD = - (PFN_vkCmdDrawIndexedIndirectCountAMD)gpa( - dev, "vkCmdDrawIndexedIndirectCountAMD"); - -#ifdef VK_USE_PLATFORM_WIN32_KHR - // NV_external_memory_win32 - table->GetMemoryWin32HandleNV = - (PFN_vkGetMemoryWin32HandleNV)gpa(dev, "vkGetMemoryWin32HandleNV"); -#endif - - // NVX_device_generated_commands - table->CmdProcessCommandsNVX = - (PFN_vkCmdProcessCommandsNVX)gpa(dev, "vkCmdProcessCommandsNVX"); - table->CmdReserveSpaceForCommandsNVX = - (PFN_vkCmdReserveSpaceForCommandsNVX)gpa( - dev, "vkCmdReserveSpaceForCommandsNVX"); - table->CreateIndirectCommandsLayoutNVX = - (PFN_vkCreateIndirectCommandsLayoutNVX)gpa( - dev, "vkCreateIndirectCommandsLayoutNVX"); - table->DestroyIndirectCommandsLayoutNVX = - (PFN_vkDestroyIndirectCommandsLayoutNVX)gpa( - dev, "vkDestroyIndirectCommandsLayoutNVX"); - table->CreateObjectTableNVX = - (PFN_vkCreateObjectTableNVX)gpa(dev, "vkCreateObjectTableNVX"); - table->DestroyObjectTableNVX = - (PFN_vkDestroyObjectTableNVX)gpa(dev, "vkDestroyObjectTableNVX"); - table->RegisterObjectsNVX = - (PFN_vkRegisterObjectsNVX)gpa(dev, "vkRegisterObjectsNVX"); - table->UnregisterObjectsNVX = - (PFN_vkUnregisterObjectsNVX)gpa(dev, "vkUnregisterObjectsNVX"); -} - -static inline void * -loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, - const char *name) { - if (!name || name[0] != 'v' || name[1] != 'k') - return NULL; - - name += 2; - if (!strcmp(name, "GetDeviceProcAddr")) - return (void *)table->GetDeviceProcAddr; - if (!strcmp(name, "DestroyDevice")) - return (void *)table->DestroyDevice; - if (!strcmp(name, "GetDeviceQueue")) - return (void *)table->GetDeviceQueue; - if (!strcmp(name, "QueueSubmit")) - return (void *)table->QueueSubmit; - if (!strcmp(name, "QueueWaitIdle")) - return (void *)table->QueueWaitIdle; - if (!strcmp(name, "DeviceWaitIdle")) - return (void *)table->DeviceWaitIdle; - if (!strcmp(name, "AllocateMemory")) - return (void *)table->AllocateMemory; - if (!strcmp(name, "FreeMemory")) - return (void *)table->FreeMemory; - if (!strcmp(name, "MapMemory")) - return (void *)table->MapMemory; - if (!strcmp(name, "UnmapMemory")) - return (void *)table->UnmapMemory; - if (!strcmp(name, "FlushMappedMemoryRanges")) - return (void *)table->FlushMappedMemoryRanges; - if (!strcmp(name, "InvalidateMappedMemoryRanges")) - return (void *)table->InvalidateMappedMemoryRanges; - if (!strcmp(name, "GetDeviceMemoryCommitment")) - return (void *)table->GetDeviceMemoryCommitment; - if (!strcmp(name, "GetImageSparseMemoryRequirements")) - return (void *)table->GetImageSparseMemoryRequirements; - if (!strcmp(name, "GetBufferMemoryRequirements")) - return (void *)table->GetBufferMemoryRequirements; - if (!strcmp(name, "GetImageMemoryRequirements")) - return (void *)table->GetImageMemoryRequirements; - if (!strcmp(name, "BindBufferMemory")) - return (void *)table->BindBufferMemory; - if (!strcmp(name, "BindImageMemory")) - return (void *)table->BindImageMemory; - if (!strcmp(name, "QueueBindSparse")) - return (void *)table->QueueBindSparse; - if (!strcmp(name, "CreateFence")) - return (void *)table->CreateFence; - if (!strcmp(name, "DestroyFence")) - return (void *)table->DestroyFence; - if (!strcmp(name, "ResetFences")) - return (void *)table->ResetFences; - if (!strcmp(name, "GetFenceStatus")) - return (void *)table->GetFenceStatus; - if (!strcmp(name, "WaitForFences")) - return (void *)table->WaitForFences; - if (!strcmp(name, "CreateSemaphore")) - return (void *)table->CreateSemaphore; - if (!strcmp(name, "DestroySemaphore")) - return (void *)table->DestroySemaphore; - if (!strcmp(name, "CreateEvent")) - return (void *)table->CreateEvent; - if (!strcmp(name, "DestroyEvent")) - return (void *)table->DestroyEvent; - if (!strcmp(name, "GetEventStatus")) - return (void *)table->GetEventStatus; - if (!strcmp(name, "SetEvent")) - return (void *)table->SetEvent; - if (!strcmp(name, "ResetEvent")) - return (void *)table->ResetEvent; - if (!strcmp(name, "CreateQueryPool")) - return (void *)table->CreateQueryPool; - if (!strcmp(name, "DestroyQueryPool")) - return (void *)table->DestroyQueryPool; - if (!strcmp(name, "GetQueryPoolResults")) - return (void *)table->GetQueryPoolResults; - if (!strcmp(name, "CreateBuffer")) - return (void *)table->CreateBuffer; - if (!strcmp(name, "DestroyBuffer")) - return (void *)table->DestroyBuffer; - if (!strcmp(name, "CreateBufferView")) - return (void *)table->CreateBufferView; - if (!strcmp(name, "DestroyBufferView")) - return (void *)table->DestroyBufferView; - if (!strcmp(name, "CreateImage")) - return (void *)table->CreateImage; - if (!strcmp(name, "DestroyImage")) - return (void *)table->DestroyImage; - if (!strcmp(name, "GetImageSubresourceLayout")) - return (void *)table->GetImageSubresourceLayout; - if (!strcmp(name, "CreateImageView")) - return (void *)table->CreateImageView; - if (!strcmp(name, "DestroyImageView")) - return (void *)table->DestroyImageView; - if (!strcmp(name, "CreateShaderModule")) - return (void *)table->CreateShaderModule; - if (!strcmp(name, "DestroyShaderModule")) - return (void *)table->DestroyShaderModule; - if (!strcmp(name, "CreatePipelineCache")) - return (void *)vkCreatePipelineCache; - if (!strcmp(name, "DestroyPipelineCache")) - return (void *)vkDestroyPipelineCache; - if (!strcmp(name, "GetPipelineCacheData")) - return (void *)vkGetPipelineCacheData; - if (!strcmp(name, "MergePipelineCaches")) - return (void *)vkMergePipelineCaches; - if (!strcmp(name, "CreateGraphicsPipelines")) - return (void *)vkCreateGraphicsPipelines; - if (!strcmp(name, "CreateComputePipelines")) - return (void *)vkCreateComputePipelines; - if (!strcmp(name, "DestroyPipeline")) - return (void *)table->DestroyPipeline; - if (!strcmp(name, "CreatePipelineLayout")) - return (void *)table->CreatePipelineLayout; - if (!strcmp(name, "DestroyPipelineLayout")) - return (void *)table->DestroyPipelineLayout; - if (!strcmp(name, "CreateSampler")) - return (void *)table->CreateSampler; - if (!strcmp(name, "DestroySampler")) - return (void *)table->DestroySampler; - if (!strcmp(name, "CreateDescriptorSetLayout")) - return (void *)table->CreateDescriptorSetLayout; - if (!strcmp(name, "DestroyDescriptorSetLayout")) - return (void *)table->DestroyDescriptorSetLayout; - if (!strcmp(name, "CreateDescriptorPool")) - return (void *)table->CreateDescriptorPool; - if (!strcmp(name, "DestroyDescriptorPool")) - return (void *)table->DestroyDescriptorPool; - if (!strcmp(name, "ResetDescriptorPool")) - return (void *)table->ResetDescriptorPool; - if (!strcmp(name, "AllocateDescriptorSets")) - return (void *)table->AllocateDescriptorSets; - if (!strcmp(name, "FreeDescriptorSets")) - return (void *)table->FreeDescriptorSets; - if (!strcmp(name, "UpdateDescriptorSets")) - return (void *)table->UpdateDescriptorSets; - if (!strcmp(name, "CreateFramebuffer")) - return (void *)table->CreateFramebuffer; - if (!strcmp(name, "DestroyFramebuffer")) - return (void *)table->DestroyFramebuffer; - if (!strcmp(name, "CreateRenderPass")) - return (void *)table->CreateRenderPass; - if (!strcmp(name, "DestroyRenderPass")) - return (void *)table->DestroyRenderPass; - if (!strcmp(name, "GetRenderAreaGranularity")) - return (void *)table->GetRenderAreaGranularity; - if (!strcmp(name, "CreateCommandPool")) - return (void *)table->CreateCommandPool; - if (!strcmp(name, "DestroyCommandPool")) - return (void *)table->DestroyCommandPool; - if (!strcmp(name, "ResetCommandPool")) - return (void *)table->ResetCommandPool; - if (!strcmp(name, "AllocateCommandBuffers")) - return (void *)table->AllocateCommandBuffers; - if (!strcmp(name, "FreeCommandBuffers")) - return (void *)table->FreeCommandBuffers; - if (!strcmp(name, "BeginCommandBuffer")) - return (void *)table->BeginCommandBuffer; - if (!strcmp(name, "EndCommandBuffer")) - return (void *)table->EndCommandBuffer; - if (!strcmp(name, "ResetCommandBuffer")) - return (void *)table->ResetCommandBuffer; - if (!strcmp(name, "CmdBindPipeline")) - return (void *)table->CmdBindPipeline; - if (!strcmp(name, "CmdSetViewport")) - return (void *)table->CmdSetViewport; - if (!strcmp(name, "CmdSetScissor")) - return (void *)table->CmdSetScissor; - if (!strcmp(name, "CmdSetLineWidth")) - return (void *)table->CmdSetLineWidth; - if (!strcmp(name, "CmdSetDepthBias")) - return (void *)table->CmdSetDepthBias; - if (!strcmp(name, "CmdSetBlendConstants")) - return (void *)table->CmdSetBlendConstants; - if (!strcmp(name, "CmdSetDepthBounds")) - return (void *)table->CmdSetDepthBounds; - if (!strcmp(name, "CmdSetStencilCompareMask")) - return (void *)table->CmdSetStencilCompareMask; - if (!strcmp(name, "CmdSetStencilwriteMask")) - return (void *)table->CmdSetStencilWriteMask; - if (!strcmp(name, "CmdSetStencilReference")) - return (void *)table->CmdSetStencilReference; - if (!strcmp(name, "CmdBindDescriptorSets")) - return (void *)table->CmdBindDescriptorSets; - if (!strcmp(name, "CmdBindVertexBuffers")) - return (void *)table->CmdBindVertexBuffers; - if (!strcmp(name, "CmdBindIndexBuffer")) - return (void *)table->CmdBindIndexBuffer; - if (!strcmp(name, "CmdDraw")) - return (void *)table->CmdDraw; - if (!strcmp(name, "CmdDrawIndexed")) - return (void *)table->CmdDrawIndexed; - if (!strcmp(name, "CmdDrawIndirect")) - return (void *)table->CmdDrawIndirect; - if (!strcmp(name, "CmdDrawIndexedIndirect")) - return (void *)table->CmdDrawIndexedIndirect; - if (!strcmp(name, "CmdDispatch")) - return (void *)table->CmdDispatch; - if (!strcmp(name, "CmdDispatchIndirect")) - return (void *)table->CmdDispatchIndirect; - if (!strcmp(name, "CmdCopyBuffer")) - return (void *)table->CmdCopyBuffer; - if (!strcmp(name, "CmdCopyImage")) - return (void *)table->CmdCopyImage; - if (!strcmp(name, "CmdBlitImage")) - return (void *)table->CmdBlitImage; - if (!strcmp(name, "CmdCopyBufferToImage")) - return (void *)table->CmdCopyBufferToImage; - if (!strcmp(name, "CmdCopyImageToBuffer")) - return (void *)table->CmdCopyImageToBuffer; - if (!strcmp(name, "CmdUpdateBuffer")) - return (void *)table->CmdUpdateBuffer; - if (!strcmp(name, "CmdFillBuffer")) - return (void *)table->CmdFillBuffer; - if (!strcmp(name, "CmdClearColorImage")) - return (void *)table->CmdClearColorImage; - if (!strcmp(name, "CmdClearDepthStencilImage")) - return (void *)table->CmdClearDepthStencilImage; - if (!strcmp(name, "CmdClearAttachments")) - return (void *)table->CmdClearAttachments; - if (!strcmp(name, "CmdResolveImage")) - return (void *)table->CmdResolveImage; - if (!strcmp(name, "CmdSetEvent")) - return (void *)table->CmdSetEvent; - if (!strcmp(name, "CmdResetEvent")) - return (void *)table->CmdResetEvent; - if (!strcmp(name, "CmdWaitEvents")) - return (void *)table->CmdWaitEvents; - if (!strcmp(name, "CmdPipelineBarrier")) - return (void *)table->CmdPipelineBarrier; - if (!strcmp(name, "CmdBeginQuery")) - return (void *)table->CmdBeginQuery; - if (!strcmp(name, "CmdEndQuery")) - return (void *)table->CmdEndQuery; - if (!strcmp(name, "CmdResetQueryPool")) - return (void *)table->CmdResetQueryPool; - if (!strcmp(name, "CmdWriteTimestamp")) - return (void *)table->CmdWriteTimestamp; - if (!strcmp(name, "CmdCopyQueryPoolResults")) - return (void *)table->CmdCopyQueryPoolResults; - if (!strcmp(name, "CmdPushConstants")) - return (void *)table->CmdPushConstants; - if (!strcmp(name, "CmdBeginRenderPass")) - return (void *)table->CmdBeginRenderPass; - if (!strcmp(name, "CmdNextSubpass")) - return (void *)table->CmdNextSubpass; - if (!strcmp(name, "CmdEndRenderPass")) - return (void *)table->CmdEndRenderPass; - if (!strcmp(name, "CmdExecuteCommands")) - return (void *)table->CmdExecuteCommands; - if (!strcmp(name, "DestroySwapchainKHR")) - return (void *)table->DestroySwapchainKHR; - if (!strcmp(name, "GetSwapchainImagesKHR")) - return (void *)table->GetSwapchainImagesKHR; - if (!strcmp(name, "AcquireNextImageKHR")) - return (void *)table->AcquireNextImageKHR; - if (!strcmp(name, "QueuePresentKHR")) - return (void *)table->QueuePresentKHR; - - // NOTE: Device Funcs needing Trampoline/Terminator. - // Overrides for device functions needing a trampoline and - // a terminator because certain device entry-points still need to go - // through a terminator before hitting the ICD. This could be for - // several reasons, but the main one is currently unwrapping an - // object before passing the appropriate info along to the ICD. - if (!strcmp(name, "CreateSwapchainKHR")) { - return (void *)vkCreateSwapchainKHR; - } else if (!strcmp(name, "CreateSharedSwapchainsKHR")) { - return (void *)vkCreateSharedSwapchainsKHR; - } else if (!strcmp(name, "DebugMarkerSetObjectTagEXT")) { - return (void *)vkDebugMarkerSetObjectTagEXT; - } else if (!strcmp(name, "DebugMarkerSetObjectNameEXT")) { - return (void *)vkDebugMarkerSetObjectNameEXT; - } - - return NULL; -} - -static inline void -loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, - PFN_vkGetInstanceProcAddr gpa, - VkInstance inst) { - table->GetInstanceProcAddr = - (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr"); - table->DestroyInstance = - (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance"); - table->EnumeratePhysicalDevices = - (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices"); - table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa( - inst, "vkGetPhysicalDeviceFeatures"); - table->GetPhysicalDeviceImageFormatProperties = - (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa( - inst, "vkGetPhysicalDeviceImageFormatProperties"); - table->GetPhysicalDeviceFormatProperties = - (PFN_vkGetPhysicalDeviceFormatProperties)gpa( - inst, "vkGetPhysicalDeviceFormatProperties"); - table->GetPhysicalDeviceSparseImageFormatProperties = - (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa( - inst, "vkGetPhysicalDeviceSparseImageFormatProperties"); - table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa( - inst, "vkGetPhysicalDeviceProperties"); - table->GetPhysicalDeviceQueueFamilyProperties = - (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa( - inst, "vkGetPhysicalDeviceQueueFamilyProperties"); - table->GetPhysicalDeviceMemoryProperties = - (PFN_vkGetPhysicalDeviceMemoryProperties)gpa( - inst, "vkGetPhysicalDeviceMemoryProperties"); - table->EnumerateDeviceExtensionProperties = - (PFN_vkEnumerateDeviceExtensionProperties)gpa( - inst, "vkEnumerateDeviceExtensionProperties"); - table->EnumerateDeviceLayerProperties = - (PFN_vkEnumerateDeviceLayerProperties)gpa( - inst, "vkEnumerateDeviceLayerProperties"); -} - -static inline void loader_init_instance_extension_dispatch_table( - VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, - VkInstance inst) { - // WSI extensions - table->DestroySurfaceKHR = - (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR"); - table->GetPhysicalDeviceSurfaceSupportKHR = - (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa( - inst, "vkGetPhysicalDeviceSurfaceSupportKHR"); - table->GetPhysicalDeviceSurfaceCapabilitiesKHR = - (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa( - inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); - table->GetPhysicalDeviceSurfaceFormatsKHR = - (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa( - inst, "vkGetPhysicalDeviceSurfaceFormatsKHR"); - table->GetPhysicalDeviceSurfacePresentModesKHR = - (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa( - inst, "vkGetPhysicalDeviceSurfacePresentModesKHR"); -#ifdef VK_USE_PLATFORM_MIR_KHR - table->CreateMirSurfaceKHR = - (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR"); - table->GetPhysicalDeviceMirPresentationSupportKHR = - (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa( - inst, "vkGetPhysicalDeviceMirPresentationSupportKHR"); -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - table->CreateWaylandSurfaceKHR = - (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR"); - table->GetPhysicalDeviceWaylandPresentationSupportKHR = - (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa( - inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR"); -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - table->CreateWin32SurfaceKHR = - (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR"); - table->GetPhysicalDeviceWin32PresentationSupportKHR = - (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa( - inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR"); -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - table->CreateXcbSurfaceKHR = - (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR"); - table->GetPhysicalDeviceXcbPresentationSupportKHR = - (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa( - inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR"); -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - table->CreateXlibSurfaceKHR = - (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR"); - table->GetPhysicalDeviceXlibPresentationSupportKHR = - (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa( - inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR"); -#endif - table->GetPhysicalDeviceDisplayPropertiesKHR = - (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)gpa( - inst, "vkGetPhysicalDeviceDisplayPropertiesKHR"); - table->GetPhysicalDeviceDisplayPlanePropertiesKHR = - (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)gpa( - inst, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); - table->GetDisplayPlaneSupportedDisplaysKHR = - (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)gpa( - inst, "vkGetDisplayPlaneSupportedDisplaysKHR"); - table->GetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR)gpa( - inst, "vkGetDisplayModePropertiesKHR"); - table->CreateDisplayModeKHR = - (PFN_vkCreateDisplayModeKHR)gpa(inst, "vkCreateDisplayModeKHR"); - table->GetDisplayPlaneCapabilitiesKHR = - (PFN_vkGetDisplayPlaneCapabilitiesKHR)gpa( - inst, "vkGetDisplayPlaneCapabilitiesKHR"); - table->CreateDisplayPlaneSurfaceKHR = - (PFN_vkCreateDisplayPlaneSurfaceKHR)gpa( - inst, "vkCreateDisplayPlaneSurfaceKHR"); - - // KHR_get_physical_device_properties2 - table->GetPhysicalDeviceFeatures2KHR = - (PFN_vkGetPhysicalDeviceFeatures2KHR)gpa( - inst, "vkGetPhysicalDeviceFeatures2KHR"); - table->GetPhysicalDeviceProperties2KHR = - (PFN_vkGetPhysicalDeviceProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceProperties2KHR"); - table->GetPhysicalDeviceFormatProperties2KHR = - (PFN_vkGetPhysicalDeviceFormatProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceFormatProperties2KHR"); - table->GetPhysicalDeviceImageFormatProperties2KHR = - (PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceImageFormatProperties2KHR"); - table->GetPhysicalDeviceQueueFamilyProperties2KHR = - (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); - table->GetPhysicalDeviceMemoryProperties2KHR = - (PFN_vkGetPhysicalDeviceMemoryProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceMemoryProperties2KHR"); - table->GetPhysicalDeviceSparseImageFormatProperties2KHR = - (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)gpa( - inst, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); - -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - table->AcquireXlibDisplayEXT = - (PFN_vkAcquireXlibDisplayEXT)gpa(inst, "vkAcquireXlibDisplayEXT"); - table->GetRandROutputDisplayEXT = - (PFN_vkGetRandROutputDisplayEXT)gpa(inst, "vkGetRandROutputDisplayEXT"); -#endif - - // EXT_debug_report - table->CreateDebugReportCallbackEXT = - (PFN_vkCreateDebugReportCallbackEXT)gpa( - inst, "vkCreateDebugReportCallbackEXT"); - table->DestroyDebugReportCallbackEXT = - (PFN_vkDestroyDebugReportCallbackEXT)gpa( - inst, "vkDestroyDebugReportCallbackEXT"); - table->DebugReportMessageEXT = - (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT"); - - // EXT_direct_mode_display - table->ReleaseDisplayEXT = - (PFN_vkReleaseDisplayEXT)gpa(inst, "vkReleaseDisplayEXT"); - - // EXT_display_surface_counter - table->GetPhysicalDeviceSurfaceCapabilities2EXT = - (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)gpa( - inst, "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); - - // NV_external_memory_capabilities - table->GetPhysicalDeviceExternalImageFormatPropertiesNV = - (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)gpa( - inst, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); - - // NVX_device_generated_commands (physical device command) - table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX = - (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)gpa( - inst, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); -} - -static inline void *loader_lookup_instance_extension_dispatch_table( - const VkLayerInstanceDispatchTable *table, const char *name, - bool *found_name) { - - *found_name = true; - - // KHR_get_physical_device_properties2 - if (!strcmp(name, "GetPhysicalDeviceFeatures2KHR")) - return (void *)table->GetPhysicalDeviceFeatures2KHR; - if (!strcmp(name, "GetPhysicalDeviceProperties2KHR")) - return (void *)table->GetPhysicalDeviceProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceFormatProperties2KHR")) - return (void *)table->GetPhysicalDeviceFormatProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties2KHR")) - return (void *)table->GetPhysicalDeviceImageFormatProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties2KHR")) - return (void *)table->GetPhysicalDeviceQueueFamilyProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceMemoryProperties2KHR")) - return (void *)table->GetPhysicalDeviceMemoryProperties2KHR; - if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties2KHR")) - return (void *)table->GetPhysicalDeviceSparseImageFormatProperties2KHR; - -// EXT_acquire_xlib_display -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - if (!strcmp(name, "AcquireXlibDisplayEXT")) - return (void *)table->AcquireXlibDisplayEXT; - if (!strcmp(name, "GetRandROutputDisplayEXT")) - return (void *)table->GetRandROutputDisplayEXT; -#endif - - // EXT_debug_report - if (!strcmp(name, "CreateDebugReportCallbackEXT")) - return (void *)table->CreateDebugReportCallbackEXT; - if (!strcmp(name, "DestroyDebugReportCallbackEXT")) - return (void *)table->DestroyDebugReportCallbackEXT; - if (!strcmp(name, "DebugReportMessageEXT")) - return (void *)table->DebugReportMessageEXT; - - // EXT_direct_mode_display - if (!strcmp(name, "ReleaseDisplayEXT")) - return (void *)table->ReleaseDisplayEXT; - - // EXT_display_surface_counter - if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2EXT")) - return (void *)table->GetPhysicalDeviceSurfaceCapabilities2EXT; - - // NV_external_memory_capabilities - if (!strcmp(name, "GetPhysicalDeviceExternalImageFormatPropertiesNV")) - return (void *)table->GetPhysicalDeviceExternalImageFormatPropertiesNV; - - // NVX_device_generated_commands - if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX")) - return (void *)table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - - *found_name = false; - return NULL; -} - -static inline void * -loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, - const char *name, bool *found_name) { - if (!name || name[0] != 'v' || name[1] != 'k') { - *found_name = false; - return NULL; - } - - *found_name = true; - name += 2; - if (!strcmp(name, "DestroyInstance")) - return (void *)table->DestroyInstance; - if (!strcmp(name, "EnumeratePhysicalDevices")) - return (void *)table->EnumeratePhysicalDevices; - if (!strcmp(name, "GetPhysicalDeviceFeatures")) - return (void *)table->GetPhysicalDeviceFeatures; - if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties")) - return (void *)table->GetPhysicalDeviceImageFormatProperties; - if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) - return (void *)table->GetPhysicalDeviceFormatProperties; - if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) - return (void *)table->GetPhysicalDeviceSparseImageFormatProperties; - if (!strcmp(name, "GetPhysicalDeviceProperties")) - return (void *)table->GetPhysicalDeviceProperties; - if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) - return (void *)table->GetPhysicalDeviceQueueFamilyProperties; - if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) - return (void *)table->GetPhysicalDeviceMemoryProperties; - if (!strcmp(name, "GetInstanceProcAddr")) - return (void *)table->GetInstanceProcAddr; - if (!strcmp(name, "EnumerateDeviceExtensionProperties")) - return (void *)table->EnumerateDeviceExtensionProperties; - if (!strcmp(name, "EnumerateDeviceLayerProperties")) - return (void *)table->EnumerateDeviceLayerProperties; - if (!strcmp(name, "DestroySurfaceKHR")) - return (void *)table->DestroySurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR")) - return (void *)table->GetPhysicalDeviceSurfaceSupportKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR")) - return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR")) - return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR; - if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR")) - return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR; -#ifdef VK_USE_PLATFORM_MIR_KHR - if (!strcmp(name, "CreateMirSurfaceKHR")) - return (void *)table->CreateMirSurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR")) - return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - if (!strcmp(name, "CreateWaylandSurfaceKHR")) - return (void *)table->CreateWaylandSurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR")) - return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - if (!strcmp(name, "CreateWin32SurfaceKHR")) - return (void *)table->CreateWin32SurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) - return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - if (!strcmp(name, "CreateXcbSurfaceKHR")) - return (void *)table->CreateXcbSurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR")) - return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - if (!strcmp(name, "CreateXlibSurfaceKHR")) - return (void *)table->CreateXlibSurfaceKHR; - if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR")) - return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR; -#endif - if (!strcmp(name, "GetPhysicalDeviceDisplayPropertiesKHR")) - return (void *)table->GetPhysicalDeviceDisplayPropertiesKHR; - if (!strcmp(name, "GetPhysicalDeviceDisplayPlanePropertiesKHR")) - return (void *)table->GetPhysicalDeviceDisplayPlanePropertiesKHR; - if (!strcmp(name, "GetDisplayPlaneSupportedDisplaysKHR")) - return (void *)table->GetDisplayPlaneSupportedDisplaysKHR; - if (!strcmp(name, "GetDisplayModePropertiesKHR")) - return (void *)table->GetDisplayModePropertiesKHR; - if (!strcmp(name, "CreateDisplayModeKHR")) - return (void *)table->CreateDisplayModeKHR; - if (!strcmp(name, "GetDisplayPlaneCapabilitiesKHR")) - return (void *)table->GetDisplayPlaneCapabilitiesKHR; - if (!strcmp(name, "CreateDisplayPlaneSurfaceKHR")) - return (void *)table->CreateDisplayPlaneSurfaceKHR; - - return loader_lookup_instance_extension_dispatch_table(table, name, - found_name); -} diff --git a/third_party/vulkan/loader/trampoline.c b/third_party/vulkan/loader/trampoline.c index 4d14f581b..6e11476b8 100644 --- a/third_party/vulkan/loader/trampoline.c +++ b/third_party/vulkan/loader/trampoline.c @@ -30,93 +30,75 @@ #include "loader.h" #include "debug_report.h" #include "wsi.h" -#include "extensions.h" +#include "vk_loader_extensions.h" #include "gpa_helper.h" -#include "table_ops.h" -/* Trampoline entrypoints are in this file for core Vulkan commands */ -/** - * Get an instance level or global level entry point address. - * @param instance - * @param pName - * @return - * If instance == NULL returns a global level functions only - * If instance is valid returns a trampoline entry point for all dispatchable - * Vulkan - * functions both core and extensions. - */ -LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -vkGetInstanceProcAddr(VkInstance instance, const char *pName) { +// Trampoline entrypoints are in this file for core Vulkan commands +// Get an instance level or global level entry point address. +// @param instance +// @param pName +// @return +// If instance == NULL returns a global level functions only +// If instance is valid returns a trampoline entry point for all dispatchable Vulkan +// functions both core and extensions. +LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName) { void *addr; addr = globalGetProcAddr(pName); if (instance == VK_NULL_HANDLE) { - // get entrypoint addresses that are global (no dispatchable object) + // Get entrypoint addresses that are global (no dispatchable object) return addr; } else { - // if a global entrypoint return NULL - if (addr) - return NULL; + // If a global entrypoint return NULL + if (addr) return NULL; } struct loader_instance *ptr_instance = loader_get_instance(instance); - if (ptr_instance == NULL) - return NULL; - // Return trampoline code for non-global entrypoints including any - // extensions. + if (ptr_instance == NULL) return NULL; + // Return trampoline code for non-global entrypoints including any extensions. // Device extensions are returned if a layer or ICD supports the extension. // Instance extensions are returned if the extension is enabled and the // loader or someone else supports the extension return trampolineGetProcAddr(ptr_instance, pName); } -/** - * Get a device level or global level entry point address. - * @param device - * @param pName - * @return - * If device is valid, returns a device relative entry point for device level - * entry points both core and extensions. - * Device relative means call down the device chain. - */ -LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL -vkGetDeviceProcAddr(VkDevice device, const char *pName) { +// Get a device level or global level entry point address. +// @param device +// @param pName +// @return +// If device is valid, returns a device relative entry point for device level +// entry points both core and extensions. +// Device relative means call down the device chain. +LOADER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName) { void *addr; - /* for entrypoints that loader must handle (ie non-dispatchable or create - object) - make sure the loader entrypoint is returned */ + // For entrypoints that loader must handle (ie non-dispatchable or create object) + // make sure the loader entrypoint is returned addr = loader_non_passthrough_gdpa(pName); if (addr) { return addr; } - /* Although CreateDevice is on device chain it's dispatchable object isn't - * a VkDevice or child of VkDevice so return NULL. - */ - if (!strcmp(pName, "CreateDevice")) - return NULL; + // Although CreateDevice is on device chain it's dispatchable object isn't + // a VkDevice or child of VkDevice so return NULL. + if (!strcmp(pName, "CreateDevice")) return NULL; - /* return the dispatch table entrypoint for the fastest case */ + // Return the dispatch table entrypoint for the fastest case const VkLayerDispatchTable *disp_table = *(VkLayerDispatchTable **)device; - if (disp_table == NULL) - return NULL; + if (disp_table == NULL) return NULL; addr = loader_lookup_device_dispatch_table(disp_table, pName); - if (addr) - return addr; + if (addr) return addr; - if (disp_table->GetDeviceProcAddr == NULL) - return NULL; + if (disp_table->GetDeviceProcAddr == NULL) return NULL; return disp_table->GetDeviceProcAddr(device, pName); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkEnumerateInstanceExtensionProperties(const char *pLayerName, - uint32_t *pPropertyCount, - VkExtensionProperties *pProperties) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, + uint32_t *pPropertyCount, + VkExtensionProperties *pProperties) { struct loader_extension_list *global_ext_list = NULL; struct loader_layer_list instance_layers; struct loader_extension_list local_ext_list; @@ -129,12 +111,12 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, memset(&instance_layers, 0, sizeof(instance_layers)); loader_platform_thread_once(&once_init, loader_initialize); - /* get layer libraries if needed */ + // Get layer libraries if needed if (pLayerName && strlen(pLayerName) != 0) { - if (vk_string_validate(MaxLoaderStringLength, pLayerName) != - VK_STRING_ERROR_NONE) { - assert(VK_FALSE && "vkEnumerateInstanceExtensionProperties: " - "pLayerName is too long or is badly formed"); + if (vk_string_validate(MaxLoaderStringLength, pLayerName) != VK_STRING_ERROR_NONE) { + assert(VK_FALSE && + "vkEnumerateInstanceExtensionProperties: " + "pLayerName is too long or is badly formed"); res = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } @@ -143,26 +125,20 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, if (strcmp(pLayerName, std_validation_str) == 0) { struct loader_layer_list local_list; memset(&local_list, 0, sizeof(local_list)); - for (uint32_t i = 0; i < sizeof(std_validation_names) / - sizeof(std_validation_names[0]); - i++) { - loader_find_layer_name_add_list(NULL, std_validation_names[i], - VK_LAYER_TYPE_INSTANCE_EXPLICIT, - &instance_layers, &local_list); + for (uint32_t i = 0; i < sizeof(std_validation_names) / sizeof(std_validation_names[0]); i++) { + loader_find_layer_name_add_list(NULL, std_validation_names[i], VK_LAYER_TYPE_INSTANCE_EXPLICIT, &instance_layers, + &local_list); } for (uint32_t i = 0; i < local_list.count; i++) { - struct loader_extension_list *ext_list = - &local_list.list[i].instance_extension_list; - loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, - ext_list->list); + struct loader_extension_list *ext_list = &local_list.list[i].instance_extension_list; + loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list); } loader_destroy_layer_list(NULL, NULL, &local_list); global_ext_list = &local_ext_list; } else { for (uint32_t i = 0; i < instance_layers.count; i++) { - struct loader_layer_properties *props = - &instance_layers.list[i]; + struct loader_layer_properties *props = &instance_layers.list[i]; if (strcmp(props->info.layerName, pLayerName) == 0) { global_ext_list = &props->instance_extension_list; break; @@ -170,15 +146,14 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, } } } else { - /* Scan/discover all ICD libraries */ + // Scan/discover all ICD libraries memset(&icd_tramp_list, 0, sizeof(struct loader_icd_tramp_list)); res = loader_icd_scan(NULL, &icd_tramp_list); if (VK_SUCCESS != res) { goto out; } - /* get extensions from all ICD's, merge so no duplicates */ - res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, - &local_ext_list); + // Get extensions from all ICD's, merge so no duplicates + res = loader_get_icd_loader_instance_extensions(NULL, &icd_tramp_list, &local_ext_list); if (VK_SUCCESS != res) { goto out; } @@ -187,10 +162,8 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, // Append implicit layers. loader_implicit_layer_scan(NULL, &instance_layers); for (uint32_t i = 0; i < instance_layers.count; i++) { - struct loader_extension_list *ext_list = - &instance_layers.list[i].instance_extension_list; - loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, - ext_list->list); + struct loader_extension_list *ext_list = &instance_layers.list[i].instance_extension_list; + loader_add_to_ext_list(NULL, &local_ext_list, ext_list->count, ext_list->list); } global_ext_list = &local_ext_list; @@ -206,12 +179,9 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, goto out; } - copy_size = *pPropertyCount < global_ext_list->count - ? *pPropertyCount - : global_ext_list->count; + copy_size = *pPropertyCount < global_ext_list->count ? *pPropertyCount : global_ext_list->count; for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &global_ext_list->list[i], - sizeof(VkExtensionProperties)); + memcpy(&pProperties[i], &global_ext_list->list[i], sizeof(VkExtensionProperties)); } *pPropertyCount = copy_size; @@ -222,15 +192,14 @@ vkEnumerateInstanceExtensionProperties(const char *pLayerName, out: - loader_destroy_generic_list(NULL, - (struct loader_generic_list *)&local_ext_list); + loader_destroy_generic_list(NULL, (struct loader_generic_list *)&local_ext_list); loader_delete_layer_properties(NULL, &instance_layers); return res; } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( - uint32_t *pPropertyCount, VkLayerProperties *pProperties) { - +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, + VkLayerProperties *pProperties) { + VkResult result = VK_SUCCESS; struct loader_layer_list instance_layer_list; tls_instance = NULL; @@ -238,39 +207,35 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( uint32_t copy_size; - /* get layer libraries */ + // Get layer libraries memset(&instance_layer_list, 0, sizeof(instance_layer_list)); loader_layer_scan(NULL, &instance_layer_list); if (pProperties == NULL) { *pPropertyCount = instance_layer_list.count; - loader_destroy_layer_list(NULL, NULL, &instance_layer_list); - return VK_SUCCESS; + goto out; } - copy_size = (*pPropertyCount < instance_layer_list.count) - ? *pPropertyCount - : instance_layer_list.count; + copy_size = (*pPropertyCount < instance_layer_list.count) ? *pPropertyCount : instance_layer_list.count; for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &instance_layer_list.list[i].info, - sizeof(VkLayerProperties)); + memcpy(&pProperties[i], &instance_layer_list.list[i].info, sizeof(VkLayerProperties)); } *pPropertyCount = copy_size; if (copy_size < instance_layer_list.count) { - loader_destroy_layer_list(NULL, NULL, &instance_layer_list); - return VK_INCOMPLETE; + result = VK_INCOMPLETE; + goto out; } - loader_destroy_layer_list(NULL, NULL, &instance_layer_list); +out: - return VK_SUCCESS; + loader_delete_layer_properties(NULL, &instance_layer_list); + return result; } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( - const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { struct loader_instance *ptr_instance = NULL; VkInstance created_instance = VK_NULL_HANDLE; bool loaderLocked = false; @@ -282,13 +247,11 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( { #else if (pAllocator) { - ptr_instance = (struct loader_instance *)pAllocator->pfnAllocation( - pAllocator->pUserData, sizeof(struct loader_instance), - sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + ptr_instance = (struct loader_instance *)pAllocator->pfnAllocation(pAllocator->pUserData, sizeof(struct loader_instance), + sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); } else { #endif - ptr_instance = - (struct loader_instance *)malloc(sizeof(struct loader_instance)); + ptr_instance = (struct loader_instance *)malloc(sizeof(struct loader_instance)); } VkInstanceCreateInfo ici = *pCreateInfo; @@ -306,27 +269,21 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( ptr_instance->alloc_callbacks = *pAllocator; } - /* - * Look for one or more debug report create info structures - * and setup a callback(s) for each one found. - */ + // Look for one or more debug report create info structures + // and setup a callback(s) for each one found. ptr_instance->num_tmp_callbacks = 0; ptr_instance->tmp_dbg_create_infos = NULL; ptr_instance->tmp_callbacks = NULL; - if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, pAllocator, - &ptr_instance->num_tmp_callbacks, - &ptr_instance->tmp_dbg_create_infos, - &ptr_instance->tmp_callbacks)) { + if (util_CopyDebugReportCreateInfos(pCreateInfo->pNext, pAllocator, &ptr_instance->num_tmp_callbacks, + &ptr_instance->tmp_dbg_create_infos, &ptr_instance->tmp_callbacks)) { // One or more were found, but allocation failed. Therefore, clean up // and fail this function: res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } else if (ptr_instance->num_tmp_callbacks > 0) { // Setup the temporary callback(s) here to catch early issues: - if (util_CreateDebugReportCallbacks(ptr_instance, pAllocator, - ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_dbg_create_infos, - ptr_instance->tmp_callbacks)) { + if (util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, + ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) { // Failure of setting up one or more of the callback. Therefore, // clean up and fail this function: res = VK_ERROR_OUT_OF_HOST_MEMORY; @@ -334,58 +291,49 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( } } - /* Due to implicit layers need to get layer list even if - * enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always - * get layer list via loader_layer_scan(). */ - memset(&ptr_instance->instance_layer_list, 0, - sizeof(ptr_instance->instance_layer_list)); + // Due to implicit layers need to get layer list even if + // enabledLayerCount == 0 and VK_INSTANCE_LAYERS is unset. For now always + // get layer list via loader_layer_scan(). + memset(&ptr_instance->instance_layer_list, 0, sizeof(ptr_instance->instance_layer_list)); loader_layer_scan(ptr_instance, &ptr_instance->instance_layer_list); - /* validate the app requested layers to be enabled */ + // Validate the app requested layers to be enabled if (pCreateInfo->enabledLayerCount > 0) { - res = - loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount, - pCreateInfo->ppEnabledLayerNames, - &ptr_instance->instance_layer_list); + res = loader_validate_layers(ptr_instance, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, + &ptr_instance->instance_layer_list); if (res != VK_SUCCESS) { goto out; } } - /* convert any meta layers to the actual layers makes a copy of layer name*/ - VkResult layerErr = loader_expand_layer_names( - ptr_instance, std_validation_str, - sizeof(std_validation_names) / sizeof(std_validation_names[0]), - std_validation_names, &ici.enabledLayerCount, &ici.ppEnabledLayerNames); + // Convert any meta layers to the actual layers makes a copy of layer name + VkResult layerErr = + loader_expand_layer_names(ptr_instance, std_validation_str, sizeof(std_validation_names) / sizeof(std_validation_names[0]), + std_validation_names, &ici.enabledLayerCount, &ici.ppEnabledLayerNames); if (VK_SUCCESS != layerErr) { res = layerErr; goto out; } - /* Scan/discover all ICD libraries */ - memset(&ptr_instance->icd_tramp_list, 0, - sizeof(ptr_instance->icd_tramp_list)); + // Scan/discover all ICD libraries + memset(&ptr_instance->icd_tramp_list, 0, sizeof(ptr_instance->icd_tramp_list)); res = loader_icd_scan(ptr_instance, &ptr_instance->icd_tramp_list); if (res != VK_SUCCESS) { goto out; } - /* get extensions from all ICD's, merge so no duplicates, then validate */ - res = loader_get_icd_loader_instance_extensions( - ptr_instance, &ptr_instance->icd_tramp_list, &ptr_instance->ext_list); + // Get extensions from all ICD's, merge so no duplicates, then validate + res = loader_get_icd_loader_instance_extensions(ptr_instance, &ptr_instance->icd_tramp_list, &ptr_instance->ext_list); if (res != VK_SUCCESS) { goto out; } - res = loader_validate_instance_extensions( - ptr_instance, &ptr_instance->ext_list, - &ptr_instance->instance_layer_list, &ici); + res = loader_validate_instance_extensions(ptr_instance, &ptr_instance->ext_list, &ptr_instance->instance_layer_list, &ici); if (res != VK_SUCCESS) { goto out; } - ptr_instance->disp = loader_instance_heap_alloc( - ptr_instance, sizeof(VkLayerInstanceDispatchTable), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + ptr_instance->disp = + loader_instance_heap_alloc(ptr_instance, sizeof(VkLayerInstanceDispatchTable), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (ptr_instance->disp == NULL) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateInstance: Failed to allocate Instance dispatch" @@ -397,16 +345,14 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( ptr_instance->next = loader.instances; loader.instances = ptr_instance; - /* activate any layers on instance chain */ - res = loader_enable_instance_layers(ptr_instance, &ici, - &ptr_instance->instance_layer_list); + // Activate any layers on instance chain + res = loader_enable_instance_layers(ptr_instance, &ici, &ptr_instance->instance_layer_list); if (res != VK_SUCCESS) { goto out; } created_instance = (VkInstance)ptr_instance; - res = loader_create_instance_chain(&ici, pAllocator, ptr_instance, - &created_instance); + res = loader_create_instance_chain(&ici, pAllocator, ptr_instance, &created_instance); if (res == VK_SUCCESS) { memset(ptr_instance->enabled_known_extensions.padding, 0, sizeof(uint64_t) * 4); @@ -417,12 +363,10 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( *pInstance = created_instance; - /* - * Finally have the layers in place and everyone has seen - * the CreateInstance command go by. This allows the layer's - * GetInstanceProcAddr functions to return valid extension functions - * if enabled. - */ + // Finally have the layers in place and everyone has seen + // the CreateInstance command go by. This allows the layer's + // GetInstanceProcAddr functions to return valid extension functions + // if enabled. loader_activate_instance_layer_extensions(ptr_instance, *pInstance); } @@ -437,35 +381,24 @@ out: loader_instance_heap_free(ptr_instance, ptr_instance->disp); } if (ptr_instance->num_tmp_callbacks > 0) { - util_DestroyDebugReportCallbacks( - ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_callbacks); - util_FreeDebugReportCreateInfos( - pAllocator, ptr_instance->tmp_dbg_create_infos, - ptr_instance->tmp_callbacks); + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, + ptr_instance->tmp_callbacks); + util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks); } - loader_deactivate_layers(ptr_instance, NULL, - &ptr_instance->activated_layer_list); + loader_deactivate_layers(ptr_instance, NULL, &ptr_instance->activated_layer_list); - loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, - &ici); - loader_delete_layer_properties(ptr_instance, - &ptr_instance->instance_layer_list); - loader_scanned_icd_clear(ptr_instance, - &ptr_instance->icd_tramp_list); - loader_destroy_generic_list( - ptr_instance, - (struct loader_generic_list *)&ptr_instance->ext_list); + loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); + loader_delete_layer_properties(ptr_instance, &ptr_instance->instance_layer_list); + loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_tramp_list); + loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&ptr_instance->ext_list); loader_instance_heap_free(ptr_instance, ptr_instance); } else { - /* Remove temporary debug_report callback */ - util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, - ptr_instance->num_tmp_callbacks, + // Remove temporary debug_report callback + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, ptr_instance->tmp_callbacks); - loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, - &ici); + loader_delete_shadow_inst_layer_names(ptr_instance, pCreateInfo, &ici); } if (loaderLocked) { @@ -476,8 +409,7 @@ out: return res; } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( - VkInstance instance, const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { const VkLayerInstanceDispatchTable *disp; struct loader_instance *ptr_instance = NULL; bool callback_setup = false; @@ -498,48 +430,45 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance( if (ptr_instance->num_tmp_callbacks > 0) { // Setup the temporary callback(s) here to catch cleanup issues: - if (!util_CreateDebugReportCallbacks(ptr_instance, pAllocator, - ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_dbg_create_infos, - ptr_instance->tmp_callbacks)) { + if (!util_CreateDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, + ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks)) { callback_setup = true; } } disp->DestroyInstance(instance, pAllocator); - loader_deactivate_layers(ptr_instance, NULL, - &ptr_instance->activated_layer_list); + loader_deactivate_layers(ptr_instance, NULL, &ptr_instance->activated_layer_list); if (ptr_instance->phys_devs_tramp) { for (uint32_t i = 0; i < ptr_instance->phys_dev_count_tramp; i++) { - loader_instance_heap_free(ptr_instance, - ptr_instance->phys_devs_tramp[i]); + loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_tramp[i]); } loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_tramp); } + if (ptr_instance->phys_dev_groups_tramp) { + for (uint32_t i = 0; i < ptr_instance->phys_dev_group_count_tramp; i++) { + loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_tramp[i]); + } + loader_instance_heap_free(ptr_instance, ptr_instance->phys_dev_groups_tramp); + } + if (callback_setup) { - util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, - ptr_instance->num_tmp_callbacks, - ptr_instance->tmp_callbacks); - util_FreeDebugReportCreateInfos(pAllocator, - ptr_instance->tmp_dbg_create_infos, - ptr_instance->tmp_callbacks); + util_DestroyDebugReportCallbacks(ptr_instance, pAllocator, ptr_instance->num_tmp_callbacks, ptr_instance->tmp_callbacks); + util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_dbg_create_infos, ptr_instance->tmp_callbacks); } loader_instance_heap_free(ptr_instance, ptr_instance->disp); loader_instance_heap_free(ptr_instance, ptr_instance); loader_platform_thread_unlock_mutex(&loader_lock); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, - VkPhysicalDevice *pPhysicalDevices) { - const VkLayerInstanceDispatchTable *disp; +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, + VkPhysicalDevice *pPhysicalDevices) { VkResult res = VK_SUCCESS; - uint32_t count, i; + uint32_t count; + uint32_t i; struct loader_instance *inst; - disp = loader_get_instance_layer_dispatch(instance); loader_platform_thread_lock_mutex(&loader_lock); @@ -549,43 +478,40 @@ vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, goto out; } - if (pPhysicalDevices == NULL) { - // Call down. At the lower levels, this will setup the terminator - // structures in the loader. - res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, - pPhysicalDevices); - if (VK_SUCCESS != res) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkEnumeratePhysicalDevices: Failed in dispatch call" - " used to determine number of available GPUs"); - } - - // Goto out, even on success since we don't need to fill in the rest. + if (NULL == pPhysicalDeviceCount) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkEnumeratePhysicalDevices: Received NULL pointer for physical device count return value."); + res = VK_ERROR_INITIALIZATION_FAILED; goto out; } + // Setup the trampoline loader physical devices. This will actually + // call down and setup the terminator loader physical devices during the + // process. VkResult setup_res = setupLoaderTrampPhysDevs(instance); if (setup_res != VK_SUCCESS && setup_res != VK_INCOMPLETE) { res = setup_res; goto out; } + count = inst->phys_dev_count_tramp; + // Wrap the PhysDev object for loader usage, return wrapped objects - if (inst->total_gpu_count > *pPhysicalDeviceCount) { - loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkEnumeratePhysicalDevices: Trimming device count down" - " by application request from %d to %d physical devices", - inst->total_gpu_count, *pPhysicalDeviceCount); - count = *pPhysicalDeviceCount; - res = VK_INCOMPLETE; - } else { - count = inst->total_gpu_count; - *pPhysicalDeviceCount = count; + if (NULL != pPhysicalDevices) { + if (inst->phys_dev_count_tramp > *pPhysicalDeviceCount) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkEnumeratePhysicalDevices: Trimming device count down" + " by application request from %d to %d physical devices", + inst->phys_dev_count_tramp, *pPhysicalDeviceCount); + count = *pPhysicalDeviceCount; + res = VK_INCOMPLETE; + } + for (i = 0; i < count; i++) { + pPhysicalDevices[i] = (VkPhysicalDevice)inst->phys_devs_tramp[i]; + } } - for (i = 0; i < count; i++) { - pPhysicalDevices[i] = (VkPhysicalDevice)inst->phys_devs_tramp[i]; - } + *pPhysicalDeviceCount = count; out: @@ -593,74 +519,59 @@ out: return res; } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures *pFeatures) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); disp->GetPhysicalDeviceFeatures(unwrapped_phys_dev, pFeatures); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, - VkFormatProperties *pFormatInfo) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, + VkFormatProperties *pFormatInfo) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_pd = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_pd = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); disp->GetPhysicalDeviceFormatProperties(unwrapped_pd, format, pFormatInfo); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, - VkImageFormatProperties *pImageFormatProperties) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, + VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceImageFormatProperties( - unwrapped_phys_dev, format, type, tiling, usage, flags, - pImageFormatProperties); + return disp->GetPhysicalDeviceImageFormatProperties(unwrapped_phys_dev, format, type, tiling, usage, flags, + pImageFormatProperties); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( - VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties *pProperties) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); disp->GetPhysicalDeviceProperties(unwrapped_phys_dev, pProperties); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, - VkQueueFamilyProperties *pQueueProperties) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties *pQueueProperties) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceQueueFamilyProperties( - unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueProperties); + disp->GetPhysicalDeviceQueueFamilyProperties(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueProperties); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties *pMemoryProperties) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties *pMemoryProperties) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceMemoryProperties(unwrapped_phys_dev, - pMemoryProperties); + disp->GetPhysicalDeviceMemoryProperties(unwrapped_phys_dev, pMemoryProperties); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( - VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { VkResult res; struct loader_physical_device_tramp *phys_dev = NULL; struct loader_device *dev = NULL; @@ -673,33 +584,26 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( phys_dev = (struct loader_physical_device_tramp *)physicalDevice; inst = (struct loader_instance *)phys_dev->this_instance; - /* Get the physical device (ICD) extensions */ + // Get the physical device (ICD) extensions struct loader_extension_list icd_exts; icd_exts.list = NULL; - res = - loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, - sizeof(VkExtensionProperties)); + res = loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties)); if (VK_SUCCESS != res) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkCreateDevice: Failed to create ICD extension list"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to create ICD extension list"); goto out; } - res = loader_add_device_extensions( - inst, inst->disp->layer_inst_disp.EnumerateDeviceExtensionProperties, - phys_dev->phys_dev, "Unknown", &icd_exts); + res = loader_add_device_extensions(inst, inst->disp->layer_inst_disp.EnumerateDeviceExtensionProperties, phys_dev->phys_dev, + "Unknown", &icd_exts); if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkCreateDevice: Failed to add extensions to list"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to add extensions to list"); goto out; } - /* make sure requested extensions to be enabled are supported */ - res = loader_validate_device_extensions( - phys_dev, &inst->activated_layer_list, &icd_exts, pCreateInfo); + // Make sure requested extensions to be enabled are supported + res = loader_validate_device_extensions(phys_dev, &inst->activated_layer_list, &icd_exts, pCreateInfo); if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkCreateDevice: Failed to validate extensions in list"); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to validate extensions in list"); goto out; } @@ -709,12 +613,11 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( goto out; } - /* copy the instance layer list into the device */ + // Copy the instance layer list into the device dev->activated_layer_list.capacity = inst->activated_layer_list.capacity; dev->activated_layer_list.count = inst->activated_layer_list.count; dev->activated_layer_list.list = - loader_device_heap_alloc(dev, inst->activated_layer_list.capacity, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); + loader_device_heap_alloc(dev, inst->activated_layer_list.capacity, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); if (dev->activated_layer_list.list == NULL) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to allocate activated layer" @@ -724,14 +627,11 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( goto out; } memcpy(dev->activated_layer_list.list, inst->activated_layer_list.list, - sizeof(*dev->activated_layer_list.list) * - dev->activated_layer_list.count); + sizeof(*dev->activated_layer_list.list) * dev->activated_layer_list.count); - res = loader_create_device_chain(phys_dev, pCreateInfo, pAllocator, inst, - dev); + res = loader_create_device_chain(phys_dev, pCreateInfo, pAllocator, inst, dev); if (res != VK_SUCCESS) { - loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkCreateDevice: Failed to create device chain."); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkCreateDevice: Failed to create device chain."); goto out; } @@ -742,9 +642,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice( // Initialize WSI device extensions as part of core dispatch since loader // has dedicated trampoline code for these*/ - loader_init_device_extension_dispatch_table( - &dev->loader_dispatch, - dev->loader_dispatch.core_dispatch.GetDeviceProcAddr, *pDevice); + loader_init_device_extension_dispatch_table(&dev->loader_dispatch, dev->loader_dispatch.core_dispatch.GetDeviceProcAddr, + *pDevice); out: @@ -756,15 +655,13 @@ out: } if (NULL != icd_exts.list) { - loader_destroy_generic_list(inst, - (struct loader_generic_list *)&icd_exts); + loader_destroy_generic_list(inst, (struct loader_generic_list *)&icd_exts); } loader_platform_thread_unlock_mutex(&loader_lock); return res; } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; struct loader_device *dev; @@ -774,8 +671,7 @@ vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { loader_platform_thread_lock_mutex(&loader_lock); - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, NULL); + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL); const struct loader_instance *inst = icd_term->this_instance; disp = loader_get_dispatch(device); @@ -787,63 +683,51 @@ vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { loader_platform_thread_unlock_mutex(&loader_lock); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, - const char *pLayerName, - uint32_t *pPropertyCount, - VkExtensionProperties *pProperties) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, + const char *pLayerName, uint32_t *pPropertyCount, + VkExtensionProperties *pProperties) { VkResult res = VK_SUCCESS; struct loader_physical_device_tramp *phys_dev; phys_dev = (struct loader_physical_device_tramp *)physicalDevice; loader_platform_thread_lock_mutex(&loader_lock); - /* If pLayerName == NULL, then querying ICD extensions, pass this call - down the instance chain which will terminate in the ICD. This allows - layers to filter the extensions coming back up the chain. - If pLayerName != NULL then get layer extensions from manifest file. */ + // If pLayerName == NULL, then querying ICD extensions, pass this call + // down the instance chain which will terminate in the ICD. This allows + // layers to filter the extensions coming back up the chain. + // If pLayerName != NULL then get layer extensions from manifest file. if (pLayerName == NULL || strlen(pLayerName) == 0) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - res = disp->EnumerateDeviceExtensionProperties( - phys_dev->phys_dev, NULL, pPropertyCount, pProperties); + res = disp->EnumerateDeviceExtensionProperties(phys_dev->phys_dev, NULL, pPropertyCount, pProperties); } else { - uint32_t count; uint32_t copy_size; const struct loader_instance *inst = phys_dev->this_instance; struct loader_device_extension_list *dev_ext_list = NULL; struct loader_device_extension_list local_ext_list; memset(&local_ext_list, 0, sizeof(local_ext_list)); - if (vk_string_validate(MaxLoaderStringLength, pLayerName) == - VK_STRING_ERROR_NONE) { + if (vk_string_validate(MaxLoaderStringLength, pLayerName) == VK_STRING_ERROR_NONE) { if (strcmp(pLayerName, std_validation_str) == 0) { struct loader_layer_list local_list; memset(&local_list, 0, sizeof(local_list)); - for (uint32_t i = 0; i < sizeof(std_validation_names) / - sizeof(std_validation_names[0]); - i++) { - loader_find_layer_name_add_list( - NULL, std_validation_names[i], - VK_LAYER_TYPE_INSTANCE_EXPLICIT, - &inst->instance_layer_list, &local_list); + for (uint32_t i = 0; i < sizeof(std_validation_names) / sizeof(std_validation_names[0]); i++) { + loader_find_layer_name_add_list(NULL, std_validation_names[i], VK_LAYER_TYPE_INSTANCE_EXPLICIT, + &inst->instance_layer_list, &local_list); } for (uint32_t i = 0; i < local_list.count; i++) { - struct loader_device_extension_list *ext_list = - &local_list.list[i].device_extension_list; + struct loader_device_extension_list *ext_list = &local_list.list[i].device_extension_list; for (uint32_t j = 0; j < ext_list->count; j++) { - loader_add_to_dev_ext_list(NULL, &local_ext_list, - &ext_list->list[j].props, 0, - NULL); + loader_add_to_dev_ext_list(NULL, &local_ext_list, &ext_list->list[j].props, 0, NULL); } } + loader_destroy_layer_list(NULL, NULL, &local_list); dev_ext_list = &local_ext_list; } else { for (uint32_t i = 0; i < inst->instance_layer_list.count; i++) { - struct loader_layer_properties *props = - &inst->instance_layer_list.list[i]; + struct loader_layer_properties *props = &inst->instance_layer_list.list[i]; if (strcmp(props->info.layerName, pLayerName) == 0) { dev_ext_list = &props->device_extension_list; } @@ -853,21 +737,18 @@ vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, count = (dev_ext_list == NULL) ? 0 : dev_ext_list->count; if (pProperties == NULL) { *pPropertyCount = count; - loader_destroy_generic_list( - inst, (struct loader_generic_list *)&local_ext_list); + loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list); loader_platform_thread_unlock_mutex(&loader_lock); return VK_SUCCESS; } copy_size = *pPropertyCount < count ? *pPropertyCount : count; for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &dev_ext_list->list[i].props, - sizeof(VkExtensionProperties)); + memcpy(&pProperties[i], &dev_ext_list->list[i].props, sizeof(VkExtensionProperties)); } *pPropertyCount = copy_size; - loader_destroy_generic_list( - inst, (struct loader_generic_list *)&local_ext_list); + loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list); if (copy_size < count) { loader_platform_thread_unlock_mutex(&loader_lock); return VK_INCOMPLETE; @@ -885,20 +766,18 @@ vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, return res; } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, - uint32_t *pPropertyCount, - VkLayerProperties *pProperties) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkLayerProperties *pProperties) { uint32_t copy_size; struct loader_physical_device_tramp *phys_dev; struct loader_layer_list *enabled_layers, layers_list; - uint32_t std_val_count = sizeof(std_validation_names) / - sizeof(std_validation_names[0]); + uint32_t std_val_count = sizeof(std_validation_names) / sizeof(std_validation_names[0]); memset(&layers_list, 0, sizeof(layers_list)); loader_platform_thread_lock_mutex(&loader_lock); - /* Don't dispatch this call down the instance chain, want all device layers - enumerated and instance chain may not contain all device layers */ + // Don't dispatch this call down the instance chain, want all device layers + // enumerated and instance chain may not contain all device layers // TODO re-evaluate the above statement we maybe able to start calling // down the chain @@ -906,66 +785,52 @@ vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, const struct loader_instance *inst = phys_dev->this_instance; uint32_t count = inst->activated_layer_list.count; - if (inst->activated_layers_are_std_val) - count = count - std_val_count + 1; + if (inst->activated_layers_are_std_val) count = count - std_val_count + 1; if (pProperties == NULL) { *pPropertyCount = count; loader_platform_thread_unlock_mutex(&loader_lock); return VK_SUCCESS; } - /* make sure to enumerate standard_validation if that is what was used - at the instance layer enablement */ + // Make sure to enumerate standard_validation if that is what was used + // at the instance layer enablement if (inst->activated_layers_are_std_val) { enabled_layers = &layers_list; enabled_layers->count = count; - enabled_layers->capacity = enabled_layers->count * - sizeof(struct loader_layer_properties); - enabled_layers->list = loader_instance_heap_alloc(inst, enabled_layers->capacity, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + enabled_layers->capacity = enabled_layers->count * sizeof(struct loader_layer_properties); + enabled_layers->list = loader_instance_heap_alloc(inst, enabled_layers->capacity, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (!enabled_layers->list) { - loader_log( - inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "vkEnumerateDeviceLayerProperties: Failed to allocate enabled" - "layer list of size %d", - enabled_layers->capacity); + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "vkEnumerateDeviceLayerProperties: Failed to allocate enabled" + "layer list of size %d", + enabled_layers->capacity); return VK_ERROR_OUT_OF_HOST_MEMORY; } uint32_t j = 0; for (uint32_t i = 0; i < inst->activated_layer_list.count; j++) { - - if (loader_find_layer_name_array( - inst->activated_layer_list.list[i].info.layerName, - std_val_count, std_validation_names)) { + if (loader_find_layer_name_array(inst->activated_layer_list.list[i].info.layerName, std_val_count, + std_validation_names)) { struct loader_layer_properties props; loader_init_std_validation_props(&props); - VkResult err = loader_copy_layer_properties(inst, - &enabled_layers->list[j], - &props); + VkResult err = loader_copy_layer_properties(inst, &enabled_layers->list[j], &props); if (err != VK_SUCCESS) { return err; } i += std_val_count; - } - else { - VkResult err = loader_copy_layer_properties(inst, - &enabled_layers->list[j], - &inst->activated_layer_list.list[i++]); + } else { + VkResult err = loader_copy_layer_properties(inst, &enabled_layers->list[j], &inst->activated_layer_list.list[i++]); if (err != VK_SUCCESS) { return err; } } } + } else { + enabled_layers = (struct loader_layer_list *)&inst->activated_layer_list; } - else { - enabled_layers = (struct loader_layer_list *) &inst->activated_layer_list; - } - copy_size = (*pPropertyCount < count) ? *pPropertyCount : count; for (uint32_t i = 0; i < copy_size; i++) { - memcpy(&pProperties[i], &(enabled_layers->list[i].info), - sizeof(VkLayerProperties)); + memcpy(&pProperties[i], &(enabled_layers->list[i].info), sizeof(VkLayerProperties)); } *pPropertyCount = copy_size; @@ -981,9 +846,8 @@ vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, return VK_SUCCESS; } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, - VkQueue *pQueue) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, + VkQueue *pQueue) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -992,9 +856,8 @@ vkGetDeviceQueue(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, loader_set_dispatch(*pQueue, disp); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, - VkFence fence) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, + VkFence fence) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(queue); @@ -1018,10 +881,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) { return disp->DeviceWaitIdle(device); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, - const VkAllocationCallbacks *pAllocator, - VkDeviceMemory *pMemory) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, + const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1029,9 +890,8 @@ vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, return disp->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkFreeMemory(VkDevice device, VkDeviceMemory mem, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory mem, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1039,9 +899,8 @@ vkFreeMemory(VkDevice device, VkDeviceMemory mem, disp->FreeMemory(device, mem, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, - VkDeviceSize size, VkFlags flags, void **ppData) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, + VkDeviceSize size, VkFlags flags, void **ppData) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1049,8 +908,7 @@ vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, return disp->MapMemory(device, mem, offset, size, flags, ppData); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkUnmapMemory(VkDevice device, VkDeviceMemory mem) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory mem) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1058,31 +916,26 @@ vkUnmapMemory(VkDevice device, VkDeviceMemory mem) { disp->UnmapMemory(device, mem); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, - const VkMappedMemoryRange *pMemoryRanges) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, + const VkMappedMemoryRange *pMemoryRanges) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->FlushMappedMemoryRanges(device, memoryRangeCount, - pMemoryRanges); + return disp->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, - const VkMappedMemoryRange *pMemoryRanges) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, + const VkMappedMemoryRange *pMemoryRanges) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, - pMemoryRanges); + return disp->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, - VkDeviceSize *pCommittedMemoryInBytes) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, + VkDeviceSize *pCommittedMemoryInBytes) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1090,9 +943,8 @@ vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, - VkDeviceSize offset) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, + VkDeviceSize offset) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1100,9 +952,8 @@ vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, return disp->BindBufferMemory(device, buffer, mem, offset); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, - VkDeviceSize offset) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, + VkDeviceSize offset) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1110,9 +961,8 @@ vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, return disp->BindImageMemory(device, image, mem, offset); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, - VkMemoryRequirements *pMemoryRequirements) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, + VkMemoryRequirements *pMemoryRequirements) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1120,9 +970,8 @@ vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, disp->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetImageMemoryRequirements(VkDevice device, VkImage image, - VkMemoryRequirements *pMemoryRequirements) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, + VkMemoryRequirements *pMemoryRequirements) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1130,37 +979,29 @@ vkGetImageMemoryRequirements(VkDevice device, VkImage image, disp->GetImageMemoryRequirements(device, image, pMemoryRequirements); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements( - VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL +vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, + VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - disp->GetImageSparseMemoryRequirements(device, image, - pSparseMemoryRequirementCount, - pSparseMemoryRequirements); + disp->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetPhysicalDeviceSparseImageFormatProperties( - VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, - VkSampleCountFlagBits samples, VkImageUsageFlags usage, - VkImageTiling tiling, uint32_t *pPropertyCount, - VkSparseImageFormatProperties *pProperties) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, + VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceSparseImageFormatProperties( - unwrapped_phys_dev, format, type, samples, usage, tiling, - pPropertyCount, pProperties); + disp->GetPhysicalDeviceSparseImageFormatProperties(unwrapped_phys_dev, format, type, samples, usage, tiling, pPropertyCount, + pProperties); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, - const VkBindSparseInfo *pBindInfo, VkFence fence) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, + const VkBindSparseInfo *pBindInfo, VkFence fence) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(queue); @@ -1168,9 +1009,8 @@ vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, return disp->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkFence *pFence) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkFence *pFence) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1178,9 +1018,7 @@ vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, return disp->CreateFence(device, pCreateInfo, pAllocator, pFence); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyFence(VkDevice device, VkFence fence, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1188,8 +1026,7 @@ vkDestroyFence(VkDevice device, VkFence fence, disp->DestroyFence(device, fence, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1197,8 +1034,7 @@ vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { return disp->ResetFences(device, fenceCount, pFences); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetFenceStatus(VkDevice device, VkFence fence) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1206,9 +1042,8 @@ vkGetFenceStatus(VkDevice device, VkFence fence) { return disp->GetFenceStatus(device, fence); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, - VkBool32 waitAll, uint64_t timeout) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, + VkBool32 waitAll, uint64_t timeout) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1216,10 +1051,8 @@ vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, return disp->WaitForFences(device, fenceCount, pFences, waitAll, timeout); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSemaphore *pSemaphore) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1227,9 +1060,8 @@ vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, return disp->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1237,9 +1069,8 @@ vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, disp->DestroySemaphore(device, semaphore, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1247,9 +1078,7 @@ vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, return disp->CreateEvent(device, pCreateInfo, pAllocator, pEvent); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyEvent(VkDevice device, VkEvent event, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1257,8 +1086,7 @@ vkDestroyEvent(VkDevice device, VkEvent event, disp->DestroyEvent(device, event, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetEventStatus(VkDevice device, VkEvent event) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1266,8 +1094,7 @@ vkGetEventStatus(VkDevice device, VkEvent event) { return disp->GetEventStatus(device, event); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkSetEvent(VkDevice device, VkEvent event) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1275,8 +1102,7 @@ vkSetEvent(VkDevice device, VkEvent event) { return disp->SetEvent(device, event); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkResetEvent(VkDevice device, VkEvent event) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1284,10 +1110,8 @@ vkResetEvent(VkDevice device, VkEvent event) { return disp->ResetEvent(device, event); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkQueryPool *pQueryPool) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1295,9 +1119,8 @@ vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, return disp->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1305,22 +1128,18 @@ vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, disp->DestroyQueryPool(device, queryPool, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, - uint32_t firstQuery, uint32_t queryCount, size_t dataSize, - void *pData, VkDeviceSize stride, - VkQueryResultFlags flags) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, + uint32_t queryCount, size_t dataSize, void *pData, + VkDeviceSize stride, VkQueryResultFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, - dataSize, pData, stride, flags); + return disp->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1328,9 +1147,8 @@ vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, return disp->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyBuffer(VkDevice device, VkBuffer buffer, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1338,10 +1156,8 @@ vkDestroyBuffer(VkDevice device, VkBuffer buffer, disp->DestroyBuffer(device, buffer, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkBufferView *pView) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkBufferView *pView) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1349,9 +1165,8 @@ vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, return disp->CreateBufferView(device, pCreateInfo, pAllocator, pView); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyBufferView(VkDevice device, VkBufferView bufferView, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1359,9 +1174,8 @@ vkDestroyBufferView(VkDevice device, VkBufferView bufferView, disp->DestroyBufferView(device, bufferView, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkImage *pImage) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkImage *pImage) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1369,9 +1183,7 @@ vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, return disp->CreateImage(device, pCreateInfo, pAllocator, pImage); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyImage(VkDevice device, VkImage image, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1379,10 +1191,9 @@ vkDestroyImage(VkDevice device, VkImage image, disp->DestroyImage(device, image, pAllocator); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetImageSubresourceLayout(VkDevice device, VkImage image, - const VkImageSubresource *pSubresource, - VkSubresourceLayout *pLayout) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, + const VkImageSubresource *pSubresource, + VkSubresourceLayout *pLayout) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1390,9 +1201,8 @@ vkGetImageSubresourceLayout(VkDevice device, VkImage image, disp->GetImageSubresourceLayout(device, image, pSubresource, pLayout); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkImageView *pView) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkImageView *pView) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1400,9 +1210,8 @@ vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, return disp->CreateImageView(device, pCreateInfo, pAllocator, pView); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyImageView(VkDevice device, VkImageView imageView, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1410,11 +1219,9 @@ vkDestroyImageView(VkDevice device, VkImageView imageView, disp->DestroyImageView(device, imageView, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateShaderModule(VkDevice device, - const VkShaderModuleCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkShaderModule *pShader) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkShaderModule *pShader) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1422,9 +1229,8 @@ vkCreateShaderModule(VkDevice device, return disp->CreateShaderModule(device, pCreateInfo, pAllocator, pShader); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1432,22 +1238,18 @@ vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, disp->DestroyShaderModule(device, shaderModule, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreatePipelineCache(VkDevice device, - const VkPipelineCacheCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkPipelineCache *pPipelineCache) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkPipelineCache *pPipelineCache) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, - pPipelineCache); + return disp->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1455,9 +1257,8 @@ vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, disp->DestroyPipelineCache(device, pipelineCache, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, - size_t *pDataSize, void *pData) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, + size_t *pDataSize, void *pData) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1465,49 +1266,41 @@ vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, return disp->GetPipelineCacheData(device, pipelineCache, pDataSize, pData); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, - uint32_t srcCacheCount, - const VkPipelineCache *pSrcCaches) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, + uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->MergePipelineCaches(device, dstCache, srcCacheCount, - pSrcCaches); + return disp->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkGraphicsPipelineCreateInfo *pCreateInfos, - const VkAllocationCallbacks *pAllocator, - VkPipeline *pPipelines) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkGraphicsPipelineCreateInfo *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkPipeline *pPipelines) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, - pCreateInfos, pAllocator, pPipelines); + return disp->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkComputePipelineCreateInfo *pCreateInfos, - const VkAllocationCallbacks *pAllocator, - VkPipeline *pPipelines) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkComputePipelineCreateInfo *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkPipeline *pPipelines) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, - pCreateInfos, pAllocator, pPipelines); + return disp->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyPipeline(VkDevice device, VkPipeline pipeline, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1515,22 +1308,18 @@ vkDestroyPipeline(VkDevice device, VkPipeline pipeline, disp->DestroyPipeline(device, pipeline, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreatePipelineLayout(VkDevice device, - const VkPipelineLayoutCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkPipelineLayout *pPipelineLayout) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkPipelineLayout *pPipelineLayout) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, - pPipelineLayout); + return disp->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1538,9 +1327,8 @@ vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, disp->DestroyPipelineLayout(device, pipelineLayout, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1548,9 +1336,8 @@ vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, return disp->CreateSampler(device, pCreateInfo, pAllocator, pSampler); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroySampler(VkDevice device, VkSampler sampler, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1558,23 +1345,19 @@ vkDestroySampler(VkDevice device, VkSampler sampler, disp->DestroySampler(device, sampler, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateDescriptorSetLayout(VkDevice device, - const VkDescriptorSetLayoutCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDescriptorSetLayout *pSetLayout) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, + const VkDescriptorSetLayoutCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorSetLayout *pSetLayout) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, - pSetLayout); + return disp->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyDescriptorSetLayout(VkDevice device, - VkDescriptorSetLayout descriptorSetLayout, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1582,22 +1365,18 @@ vkDestroyDescriptorSetLayout(VkDevice device, disp->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateDescriptorPool(VkDevice device, - const VkDescriptorPoolCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDescriptorPool *pDescriptorPool) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDescriptorPool *pDescriptorPool) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, - pDescriptorPool); + return disp->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1605,9 +1384,8 @@ vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, disp->DestroyDescriptorPool(device, descriptorPool, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, - VkDescriptorPoolResetFlags flags) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, + VkDescriptorPoolResetFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1615,10 +1393,9 @@ vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, return disp->ResetDescriptorPool(device, descriptorPool, flags); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkAllocateDescriptorSets(VkDevice device, - const VkDescriptorSetAllocateInfo *pAllocateInfo, - VkDescriptorSet *pDescriptorSets) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, + const VkDescriptorSetAllocateInfo *pAllocateInfo, + VkDescriptorSet *pDescriptorSets) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1626,46 +1403,39 @@ vkAllocateDescriptorSets(VkDevice device, return disp->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VkDescriptorSet *pDescriptorSets) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, + uint32_t descriptorSetCount, + const VkDescriptorSet *pDescriptorSets) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, - pDescriptorSets); + return disp->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, - const VkWriteDescriptorSet *pDescriptorWrites, - uint32_t descriptorCopyCount, - const VkCopyDescriptorSet *pDescriptorCopies) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, + const VkWriteDescriptorSet *pDescriptorWrites, + uint32_t descriptorCopyCount, + const VkCopyDescriptorSet *pDescriptorCopies) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, - descriptorCopyCount, pDescriptorCopies); + disp->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkFramebuffer *pFramebuffer) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkFramebuffer *pFramebuffer) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, - pFramebuffer); + return disp->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1673,10 +1443,9 @@ vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, disp->DestroyFramebuffer(device, framebuffer, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkRenderPass *pRenderPass) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkRenderPass *pRenderPass) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1684,9 +1453,8 @@ vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, return disp->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1694,9 +1462,8 @@ vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, disp->DestroyRenderPass(device, renderPass, pAllocator); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, - VkExtent2D *pGranularity) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, + VkExtent2D *pGranularity) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1704,21 +1471,18 @@ vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, disp->GetRenderAreaGranularity(device, renderPass, pGranularity); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkCommandPool *pCommandPool) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkCommandPool *pCommandPool) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateCommandPool(device, pCreateInfo, pAllocator, - pCommandPool); + return disp->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1726,9 +1490,8 @@ vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, disp->DestroyCommandPool(device, commandPool, pAllocator); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkResetCommandPool(VkDevice device, VkCommandPool commandPool, - VkCommandPoolResetFlags flags) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, + VkCommandPoolResetFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); @@ -1736,10 +1499,9 @@ vkResetCommandPool(VkDevice device, VkCommandPool commandPool, return disp->ResetCommandPool(device, commandPool, flags); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkAllocateCommandBuffers(VkDevice device, - const VkCommandBufferAllocateInfo *pAllocateInfo, - VkCommandBuffer *pCommandBuffers) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, + const VkCommandBufferAllocateInfo *pAllocateInfo, + VkCommandBuffer *pCommandBuffers) { const VkLayerDispatchTable *disp; VkResult res; @@ -1757,21 +1519,17 @@ vkAllocateCommandBuffers(VkDevice device, return res; } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, - uint32_t commandBufferCount, - const VkCommandBuffer *pCommandBuffers) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, + uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - disp->FreeCommandBuffers(device, commandPool, commandBufferCount, - pCommandBuffers); + disp->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkBeginCommandBuffer(VkCommandBuffer commandBuffer, - const VkCommandBufferBeginInfo *pBeginInfo) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, + const VkCommandBufferBeginInfo *pBeginInfo) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1779,8 +1537,7 @@ vkBeginCommandBuffer(VkCommandBuffer commandBuffer, return disp->BeginCommandBuffer(commandBuffer, pBeginInfo); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkEndCommandBuffer(VkCommandBuffer commandBuffer) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1788,9 +1545,7 @@ vkEndCommandBuffer(VkCommandBuffer commandBuffer) { return disp->EndCommandBuffer(commandBuffer); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkResetCommandBuffer(VkCommandBuffer commandBuffer, - VkCommandBufferResetFlags flags) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1798,9 +1553,8 @@ vkResetCommandBuffer(VkCommandBuffer commandBuffer, return disp->ResetCommandBuffer(commandBuffer, flags); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBindPipeline(VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1808,20 +1562,17 @@ vkCmdBindPipeline(VkCommandBuffer commandBuffer, disp->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, - uint32_t viewportCount, const VkViewport *pViewports) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, + uint32_t viewportCount, const VkViewport *pViewports) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, - pViewports); + disp->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, - uint32_t scissorCount, const VkRect2D *pScissors) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, + uint32_t scissorCount, const VkRect2D *pScissors) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1829,8 +1580,7 @@ vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, disp->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1838,20 +1588,16 @@ vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { disp->CmdSetLineWidth(commandBuffer, lineWidth); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, - float depthBiasClamp, float depthBiasSlopeFactor) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, + float depthBiasClamp, float depthBiasSlopeFactor) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, - depthBiasClamp, depthBiasSlopeFactor); + disp->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, - const float blendConstants[4]) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1859,9 +1605,8 @@ vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, disp->CmdSetBlendConstants(commandBuffer, blendConstants); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, - float maxDepthBounds) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, + float maxDepthBounds) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1869,9 +1614,8 @@ vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, disp->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, uint32_t compareMask) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, + uint32_t compareMask) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1879,9 +1623,8 @@ vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, disp->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, uint32_t writeMask) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, + uint32_t writeMask) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1889,9 +1632,8 @@ vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, disp->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetStencilReference(VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, uint32_t reference) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, + uint32_t reference) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1899,23 +1641,21 @@ vkCmdSetStencilReference(VkCommandBuffer commandBuffer, disp->CmdSetStencilReference(commandBuffer, faceMask, reference); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets( - VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, - const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, - const uint32_t *pDynamicOffsets) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, + uint32_t firstSet, uint32_t descriptorSetCount, + const VkDescriptorSet *pDescriptorSets, + uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, - firstSet, descriptorSetCount, pDescriptorSets, + disp->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, - VkDeviceSize offset, VkIndexType indexType) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkIndexType indexType) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1923,45 +1663,37 @@ vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, disp->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, - uint32_t bindingCount, const VkBuffer *pBuffers, - const VkDeviceSize *pOffsets) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, + uint32_t bindingCount, const VkBuffer *pBuffers, + const VkDeviceSize *pOffsets) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, - pBuffers, pOffsets); + disp->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, - uint32_t instanceCount, uint32_t firstVertex, - uint32_t firstInstance) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, + uint32_t firstVertex, uint32_t firstInstance) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, - firstInstance); + disp->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, - uint32_t instanceCount, uint32_t firstIndex, - int32_t vertexOffset, uint32_t firstInstance) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, + uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, + uint32_t firstInstance) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, - vertexOffset, firstInstance); + disp->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, - VkDeviceSize offset, uint32_t drawCount, uint32_t stride) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + uint32_t drawCount, uint32_t stride) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1969,21 +1701,16 @@ vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, disp->CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, - VkDeviceSize offset, uint32_t drawCount, - uint32_t stride) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, + VkDeviceSize offset, uint32_t drawCount, uint32_t stride) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, - stride); + disp->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, - uint32_t z) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -1991,9 +1718,8 @@ vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, disp->CmdDispatch(commandBuffer, x, y, z); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, - VkDeviceSize offset) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, + VkDeviceSize offset) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2001,74 +1727,59 @@ vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, disp->CmdDispatchIndirect(commandBuffer, buffer, offset); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, - VkBuffer dstBuffer, uint32_t regionCount, - const VkBufferCopy *pRegions) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, + uint32_t regionCount, const VkBufferCopy *pRegions) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, - pRegions); + disp->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, - VkImageLayout srcImageLayout, VkImage dstImage, - VkImageLayout dstImageLayout, uint32_t regionCount, - const VkImageCopy *pRegions) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, + VkImageLayout srcImageLayout, VkImage dstImage, + VkImageLayout dstImageLayout, uint32_t regionCount, + const VkImageCopy *pRegions) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, - dstImageLayout, regionCount, pRegions); + disp->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, - VkImageLayout srcImageLayout, VkImage dstImage, - VkImageLayout dstImageLayout, uint32_t regionCount, - const VkImageBlit *pRegions, VkFilter filter) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, + VkImageLayout srcImageLayout, VkImage dstImage, + VkImageLayout dstImageLayout, uint32_t regionCount, + const VkImageBlit *pRegions, VkFilter filter) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, - dstImageLayout, regionCount, pRegions, filter); + disp->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, - VkImage dstImage, VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkBufferImageCopy *pRegions) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, + VkImageLayout dstImageLayout, uint32_t regionCount, + const VkBufferImageCopy *pRegions) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, - dstImageLayout, regionCount, pRegions); + disp->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, - VkImageLayout srcImageLayout, VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferImageCopy *pRegions) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, + VkImageLayout srcImageLayout, VkBuffer dstBuffer, + uint32_t regionCount, const VkBufferImageCopy *pRegions) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, - dstBuffer, regionCount, pRegions); + disp->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, - VkDeviceSize dstOffset, VkDeviceSize dataSize, - const void *pData) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, + VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2076,9 +1787,8 @@ vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, disp->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, - VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, + VkDeviceSize size, uint32_t data) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2086,61 +1796,50 @@ vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, disp->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, - VkImageLayout imageLayout, const VkClearColorValue *pColor, - uint32_t rangeCount, - const VkImageSubresourceRange *pRanges) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, + VkImageLayout imageLayout, const VkClearColorValue *pColor, + uint32_t rangeCount, const VkImageSubresourceRange *pRanges) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, - rangeCount, pRanges); + disp->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, - VkImageLayout imageLayout, - const VkClearDepthStencilValue *pDepthStencil, - uint32_t rangeCount, - const VkImageSubresourceRange *pRanges) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue *pDepthStencil, + uint32_t rangeCount, const VkImageSubresourceRange *pRanges) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, - pDepthStencil, rangeCount, pRanges); + disp->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, - const VkClearAttachment *pAttachments, uint32_t rectCount, - const VkClearRect *pRects) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, + const VkClearAttachment *pAttachments, uint32_t rectCount, + const VkClearRect *pRects) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, - rectCount, pRects); + disp->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, - VkImageLayout srcImageLayout, VkImage dstImage, - VkImageLayout dstImageLayout, uint32_t regionCount, - const VkImageResolve *pRegions) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, + VkImageLayout srcImageLayout, VkImage dstImage, + VkImageLayout dstImageLayout, uint32_t regionCount, + const VkImageResolve *pRegions) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, - dstImageLayout, regionCount, pRegions); + disp->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, - VkPipelineStageFlags stageMask) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, + VkPipelineStageFlags stageMask) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2148,9 +1847,8 @@ vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, disp->CmdSetEvent(commandBuffer, event, stageMask); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, - VkPipelineStageFlags stageMask) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, + VkPipelineStageFlags stageMask) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2158,46 +1856,38 @@ vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, disp->CmdResetEvent(commandBuffer, event, stageMask); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, - const VkEvent *pEvents, VkPipelineStageFlags sourceStageMask, - VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, - const VkMemoryBarrier *pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier *pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier *pImageMemoryBarriers) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, + VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, + uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, + uint32_t bufferMemoryBarrierCount, + const VkBufferMemoryBarrier *pBufferMemoryBarriers, + uint32_t imageMemoryBarrierCount, + const VkImageMemoryBarrier *pImageMemoryBarriers) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, - dstStageMask, memoryBarrierCount, pMemoryBarriers, - bufferMemoryBarrierCount, pBufferMemoryBarriers, - imageMemoryBarrierCount, pImageMemoryBarriers); + disp->CmdWaitEvents(commandBuffer, eventCount, pEvents, sourceStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, + bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier( - VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, - VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, - uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier *pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier *pImageMemoryBarriers) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, + VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, + uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, + uint32_t bufferMemoryBarrierCount, + const VkBufferMemoryBarrier *pBufferMemoryBarriers, + uint32_t imageMemoryBarrierCount, + const VkImageMemoryBarrier *pImageMemoryBarriers) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdPipelineBarrier( - commandBuffer, srcStageMask, dstStageMask, dependencyFlags, - memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, - pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); + disp->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, + bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t slot, VkFlags flags) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, + VkFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2205,9 +1895,7 @@ vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, disp->CmdBeginQuery(commandBuffer, queryPool, slot, flags); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t slot) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2215,9 +1903,8 @@ vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, disp->CmdEndQuery(commandBuffer, queryPool, slot); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t firstQuery, uint32_t queryCount) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, + uint32_t firstQuery, uint32_t queryCount) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2225,10 +1912,8 @@ vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, disp->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, - VkPipelineStageFlagBits pipelineStage, - VkQueryPool queryPool, uint32_t slot) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, + VkQueryPool queryPool, uint32_t slot) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2236,36 +1921,29 @@ vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, disp->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, - uint32_t firstQuery, uint32_t queryCount, - VkBuffer dstBuffer, VkDeviceSize dstOffset, - VkDeviceSize stride, VkFlags flags) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, + uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, + VkDeviceSize dstOffset, VkDeviceSize stride, VkFlags flags) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, - queryCount, dstBuffer, dstOffset, stride, - flags); + disp->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, - VkShaderStageFlags stageFlags, uint32_t offset, - uint32_t size, const void *pValues) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, + VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, + const void *pValues) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, - pValues); + disp->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo *pRenderPassBegin, - VkSubpassContents contents) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, + const VkRenderPassBeginInfo *pRenderPassBegin, + VkSubpassContents contents) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2273,8 +1951,7 @@ vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, disp->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2282,8 +1959,7 @@ vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { disp->CmdNextSubpass(commandBuffer, contents); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); @@ -2291,14 +1967,11 @@ vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { disp->CmdEndRenderPass(commandBuffer); } -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkCmdExecuteCommands(VkCommandBuffer commandBuffer, - uint32_t commandBuffersCount, - const VkCommandBuffer *pCommandBuffers) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, + const VkCommandBuffer *pCommandBuffers) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(commandBuffer); - disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, - pCommandBuffers); + disp->CmdExecuteCommands(commandBuffer, commandBuffersCount, pCommandBuffers); } diff --git a/third_party/vulkan/loader/vk_loader_extensions.c b/third_party/vulkan/loader/vk_loader_extensions.c new file mode 100644 index 000000000..3db1faae8 --- /dev/null +++ b/third_party/vulkan/loader/vk_loader_extensions.c @@ -0,0 +1,2626 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See loader_extension_generator.py for modifications + +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Mark Lobodzinski + * Author: Mark Young + */ + +#define _GNU_SOURCE +#include +#include +#include +#include "vk_loader_platform.h" +#include "loader.h" +#include "vk_loader_extensions.h" +#include +#include "wsi.h" +#include "debug_report.h" +#include "extension_manual.h" + +// Device extension error function +VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev) { + struct loader_device *found_dev; + // The device going in is a trampoline device + struct loader_icd_term *icd_term = loader_get_icd_and_device(dev, &found_dev, NULL); + + if (icd_term) + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "Bad destination in loader trampoline dispatch," + "Are layers and extensions that you are calling enabled?"); + return VK_ERROR_EXTENSION_NOT_PRESENT; +} + +VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst, + const PFN_vkGetInstanceProcAddr fp_gipa) { + +#define LOOKUP_GIPA(func, required) \ + do { \ + icd_term->dispatch.func = (PFN_vk##func)fp_gipa(inst, "vk" #func); \ + if (!icd_term->dispatch.func && required) { \ + loader_log((struct loader_instance *)inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, \ + loader_platform_get_proc_address_error("vk" #func)); \ + return false; \ + } \ + } while (0) + + + // ---- Core 1_0 + LOOKUP_GIPA(DestroyInstance, true); + LOOKUP_GIPA(EnumeratePhysicalDevices, true); + LOOKUP_GIPA(GetPhysicalDeviceFeatures, true); + LOOKUP_GIPA(GetPhysicalDeviceFormatProperties, true); + LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties, true); + LOOKUP_GIPA(GetPhysicalDeviceProperties, true); + LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties, true); + LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties, true); + LOOKUP_GIPA(GetDeviceProcAddr, true); + LOOKUP_GIPA(CreateDevice, true); + LOOKUP_GIPA(EnumerateDeviceExtensionProperties, true); + LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties, true); + + // ---- VK_KHR_surface extension commands + LOOKUP_GIPA(DestroySurfaceKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceSurfaceSupportKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilitiesKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormatsKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceSurfacePresentModesKHR, false); + + // ---- VK_KHR_swapchain extension commands + LOOKUP_GIPA(CreateSwapchainKHR, false); + + // ---- VK_KHR_display extension commands + LOOKUP_GIPA(GetPhysicalDeviceDisplayPropertiesKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceDisplayPlanePropertiesKHR, false); + LOOKUP_GIPA(GetDisplayPlaneSupportedDisplaysKHR, false); + LOOKUP_GIPA(GetDisplayModePropertiesKHR, false); + LOOKUP_GIPA(CreateDisplayModeKHR, false); + LOOKUP_GIPA(GetDisplayPlaneCapabilitiesKHR, false); + LOOKUP_GIPA(CreateDisplayPlaneSurfaceKHR, false); + + // ---- VK_KHR_display_swapchain extension commands + LOOKUP_GIPA(CreateSharedSwapchainsKHR, false); + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + LOOKUP_GIPA(CreateXlibSurfaceKHR, false); +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + LOOKUP_GIPA(GetPhysicalDeviceXlibPresentationSupportKHR, false); +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + LOOKUP_GIPA(CreateXcbSurfaceKHR, false); +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + LOOKUP_GIPA(GetPhysicalDeviceXcbPresentationSupportKHR, false); +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + LOOKUP_GIPA(CreateWaylandSurfaceKHR, false); +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + LOOKUP_GIPA(GetPhysicalDeviceWaylandPresentationSupportKHR, false); +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + LOOKUP_GIPA(CreateMirSurfaceKHR, false); +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + LOOKUP_GIPA(GetPhysicalDeviceMirPresentationSupportKHR, false); +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + LOOKUP_GIPA(CreateAndroidSurfaceKHR, false); +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + LOOKUP_GIPA(CreateWin32SurfaceKHR, false); +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + LOOKUP_GIPA(GetPhysicalDeviceWin32PresentationSupportKHR, false); +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + LOOKUP_GIPA(GetPhysicalDeviceFeatures2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceProperties2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceFormatProperties2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyProperties2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties2KHR, false); + LOOKUP_GIPA(GetPhysicalDeviceSparseImageFormatProperties2KHR, false); + + // ---- VK_EXT_debug_report extension commands + LOOKUP_GIPA(CreateDebugReportCallbackEXT, false); + LOOKUP_GIPA(DestroyDebugReportCallbackEXT, false); + LOOKUP_GIPA(DebugReportMessageEXT, false); + + // ---- VK_EXT_debug_marker extension commands + LOOKUP_GIPA(DebugMarkerSetObjectTagEXT, false); + LOOKUP_GIPA(DebugMarkerSetObjectNameEXT, false); + + // ---- VK_NV_external_memory_capabilities extension commands + LOOKUP_GIPA(GetPhysicalDeviceExternalImageFormatPropertiesNV, false); + + // ---- VK_KHX_device_group extension commands + LOOKUP_GIPA(GetDeviceGroupSurfacePresentModesKHX, false); + LOOKUP_GIPA(GetPhysicalDevicePresentRectanglesKHX, false); + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + LOOKUP_GIPA(CreateViSurfaceNN, false); +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + LOOKUP_GIPA(EnumeratePhysicalDeviceGroupsKHX, false); + + // ---- VK_KHX_external_memory_capabilities extension commands + LOOKUP_GIPA(GetPhysicalDeviceExternalBufferPropertiesKHX, false); + + // ---- VK_KHX_external_semaphore_capabilities extension commands + LOOKUP_GIPA(GetPhysicalDeviceExternalSemaphorePropertiesKHX, false); + + // ---- VK_NVX_device_generated_commands extension commands + LOOKUP_GIPA(GetPhysicalDeviceGeneratedCommandsPropertiesNVX, false); + + // ---- VK_EXT_direct_mode_display extension commands + LOOKUP_GIPA(ReleaseDisplayEXT, false); + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + LOOKUP_GIPA(AcquireXlibDisplayEXT, false); +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + LOOKUP_GIPA(GetRandROutputDisplayEXT, false); +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilities2EXT, false); + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + LOOKUP_GIPA(CreateIOSSurfaceMVK, false); +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + LOOKUP_GIPA(CreateMacOSSurfaceMVK, false); +#endif // VK_USE_PLATFORM_MACOS_MVK + +#undef LOOKUP_GIPA + + return true; +}; + +// Init Device function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa, + VkDevice dev) { + VkLayerDispatchTable *table = &dev_table->core_dispatch; + for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) dev_table->ext_dispatch.dev_ext[i] = (PFN_vkDevExt)vkDevExtError; + + + // ---- Core 1_0 commands + table->GetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr"); + table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice"); + table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue"); + table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit"); + table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle"); + table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle"); + table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory"); + table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory"); + table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory"); + table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory"); + table->FlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges"); + table->InvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)gpa(dev, "vkInvalidateMappedMemoryRanges"); + table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa(dev, "vkGetDeviceMemoryCommitment"); + table->BindBufferMemory = (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory"); + table->BindImageMemory = (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory"); + table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa(dev, "vkGetBufferMemoryRequirements"); + table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa(dev, "vkGetImageMemoryRequirements"); + table->GetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements)gpa(dev, "vkGetImageSparseMemoryRequirements"); + table->QueueBindSparse = (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse"); + table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence"); + table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence"); + table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences"); + table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus"); + table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences"); + table->CreateSemaphore = (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore"); + table->DestroySemaphore = (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore"); + table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent"); + table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent"); + table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus"); + table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent"); + table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent"); + table->CreateQueryPool = (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool"); + table->DestroyQueryPool = (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool"); + table->GetQueryPoolResults = (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults"); + table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer"); + table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer"); + table->CreateBufferView = (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView"); + table->DestroyBufferView = (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView"); + table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage"); + table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage"); + table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa(dev, "vkGetImageSubresourceLayout"); + table->CreateImageView = (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView"); + table->DestroyImageView = (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView"); + table->CreateShaderModule = (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule"); + table->DestroyShaderModule = (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule"); + table->CreatePipelineCache = (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache"); + table->DestroyPipelineCache = (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache"); + table->GetPipelineCacheData = (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData"); + table->MergePipelineCaches = (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches"); + table->CreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines"); + table->CreateComputePipelines = (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines"); + table->DestroyPipeline = (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline"); + table->CreatePipelineLayout = (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout"); + table->DestroyPipelineLayout = (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout"); + table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler"); + table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler"); + table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa(dev, "vkCreateDescriptorSetLayout"); + table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa(dev, "vkDestroyDescriptorSetLayout"); + table->CreateDescriptorPool = (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool"); + table->DestroyDescriptorPool = (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool"); + table->ResetDescriptorPool = (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool"); + table->AllocateDescriptorSets = (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets"); + table->FreeDescriptorSets = (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets"); + table->UpdateDescriptorSets = (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets"); + table->CreateFramebuffer = (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer"); + table->DestroyFramebuffer = (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer"); + table->CreateRenderPass = (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass"); + table->DestroyRenderPass = (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass"); + table->GetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity"); + table->CreateCommandPool = (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool"); + table->DestroyCommandPool = (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool"); + table->ResetCommandPool = (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool"); + table->AllocateCommandBuffers = (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers"); + table->FreeCommandBuffers = (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers"); + table->BeginCommandBuffer = (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer"); + table->EndCommandBuffer = (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer"); + table->ResetCommandBuffer = (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer"); + table->CmdBindPipeline = (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline"); + table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport"); + table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor"); + table->CmdSetLineWidth = (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth"); + table->CmdSetDepthBias = (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias"); + table->CmdSetBlendConstants = (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants"); + table->CmdSetDepthBounds = (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds"); + table->CmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask"); + table->CmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask"); + table->CmdSetStencilReference = (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference"); + table->CmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets"); + table->CmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer"); + table->CmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers"); + table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw"); + table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed"); + table->CmdDrawIndirect = (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect"); + table->CmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect"); + table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch"); + table->CmdDispatchIndirect = (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect"); + table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer"); + table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage"); + table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage"); + table->CmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage"); + table->CmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer"); + table->CmdUpdateBuffer = (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer"); + table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer"); + table->CmdClearColorImage = (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage"); + table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa(dev, "vkCmdClearDepthStencilImage"); + table->CmdClearAttachments = (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments"); + table->CmdResolveImage = (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage"); + table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent"); + table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent"); + table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents"); + table->CmdPipelineBarrier = (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier"); + table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery"); + table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery"); + table->CmdResetQueryPool = (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool"); + table->CmdWriteTimestamp = (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp"); + table->CmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults"); + table->CmdPushConstants = (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants"); + table->CmdBeginRenderPass = (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass"); + table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass"); + table->CmdEndRenderPass = (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass"); + table->CmdExecuteCommands = (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands"); +} + +// Init Device function pointer dispatch table with extension commands +VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table, + PFN_vkGetDeviceProcAddr gpa, VkDevice dev) { + VkLayerDispatchTable *table = &dev_table->core_dispatch; + + + // ---- VK_KHR_swapchain extension commands + table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR"); + table->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR"); + table->GetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR"); + table->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR"); + table->QueuePresentKHR = (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR"); + + // ---- VK_KHR_display_swapchain extension commands + table->CreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR)gpa(dev, "vkCreateSharedSwapchainsKHR"); + + // ---- VK_KHR_maintenance1 extension commands + table->TrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)gpa(dev, "vkTrimCommandPoolKHR"); + + // ---- VK_KHR_push_descriptor extension commands + table->CmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)gpa(dev, "vkCmdPushDescriptorSetKHR"); + + // ---- VK_KHR_descriptor_update_template extension commands + table->CreateDescriptorUpdateTemplateKHR = (PFN_vkCreateDescriptorUpdateTemplateKHR)gpa(dev, "vkCreateDescriptorUpdateTemplateKHR"); + table->DestroyDescriptorUpdateTemplateKHR = (PFN_vkDestroyDescriptorUpdateTemplateKHR)gpa(dev, "vkDestroyDescriptorUpdateTemplateKHR"); + table->UpdateDescriptorSetWithTemplateKHR = (PFN_vkUpdateDescriptorSetWithTemplateKHR)gpa(dev, "vkUpdateDescriptorSetWithTemplateKHR"); + table->CmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)gpa(dev, "vkCmdPushDescriptorSetWithTemplateKHR"); + + // ---- VK_EXT_debug_marker extension commands + table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)gpa(dev, "vkDebugMarkerSetObjectTagEXT"); + table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)gpa(dev, "vkDebugMarkerSetObjectNameEXT"); + table->CmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT)gpa(dev, "vkCmdDebugMarkerBeginEXT"); + table->CmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT)gpa(dev, "vkCmdDebugMarkerEndEXT"); + table->CmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT)gpa(dev, "vkCmdDebugMarkerInsertEXT"); + + // ---- VK_AMD_draw_indirect_count extension commands + table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)gpa(dev, "vkCmdDrawIndirectCountAMD"); + table->CmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)gpa(dev, "vkCmdDrawIndexedIndirectCountAMD"); + + // ---- VK_NV_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + table->GetMemoryWin32HandleNV = (PFN_vkGetMemoryWin32HandleNV)gpa(dev, "vkGetMemoryWin32HandleNV"); +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHX_device_group extension commands + table->GetDeviceGroupPeerMemoryFeaturesKHX = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)gpa(dev, "vkGetDeviceGroupPeerMemoryFeaturesKHX"); + table->BindBufferMemory2KHX = (PFN_vkBindBufferMemory2KHX)gpa(dev, "vkBindBufferMemory2KHX"); + table->BindImageMemory2KHX = (PFN_vkBindImageMemory2KHX)gpa(dev, "vkBindImageMemory2KHX"); + table->CmdSetDeviceMaskKHX = (PFN_vkCmdSetDeviceMaskKHX)gpa(dev, "vkCmdSetDeviceMaskKHX"); + table->GetDeviceGroupPresentCapabilitiesKHX = (PFN_vkGetDeviceGroupPresentCapabilitiesKHX)gpa(dev, "vkGetDeviceGroupPresentCapabilitiesKHX"); + table->GetDeviceGroupSurfacePresentModesKHX = (PFN_vkGetDeviceGroupSurfacePresentModesKHX)gpa(dev, "vkGetDeviceGroupSurfacePresentModesKHX"); + table->AcquireNextImage2KHX = (PFN_vkAcquireNextImage2KHX)gpa(dev, "vkAcquireNextImage2KHX"); + table->CmdDispatchBaseKHX = (PFN_vkCmdDispatchBaseKHX)gpa(dev, "vkCmdDispatchBaseKHX"); + + // ---- VK_KHX_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + table->GetMemoryWin32HandleKHX = (PFN_vkGetMemoryWin32HandleKHX)gpa(dev, "vkGetMemoryWin32HandleKHX"); +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + table->GetMemoryWin32HandlePropertiesKHX = (PFN_vkGetMemoryWin32HandlePropertiesKHX)gpa(dev, "vkGetMemoryWin32HandlePropertiesKHX"); +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_memory_fd extension commands + table->GetMemoryFdKHX = (PFN_vkGetMemoryFdKHX)gpa(dev, "vkGetMemoryFdKHX"); + table->GetMemoryFdPropertiesKHX = (PFN_vkGetMemoryFdPropertiesKHX)gpa(dev, "vkGetMemoryFdPropertiesKHX"); + + // ---- VK_KHX_external_semaphore_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + table->ImportSemaphoreWin32HandleKHX = (PFN_vkImportSemaphoreWin32HandleKHX)gpa(dev, "vkImportSemaphoreWin32HandleKHX"); +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + table->GetSemaphoreWin32HandleKHX = (PFN_vkGetSemaphoreWin32HandleKHX)gpa(dev, "vkGetSemaphoreWin32HandleKHX"); +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_semaphore_fd extension commands + table->ImportSemaphoreFdKHX = (PFN_vkImportSemaphoreFdKHX)gpa(dev, "vkImportSemaphoreFdKHX"); + table->GetSemaphoreFdKHX = (PFN_vkGetSemaphoreFdKHX)gpa(dev, "vkGetSemaphoreFdKHX"); + + // ---- VK_NVX_device_generated_commands extension commands + table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX)gpa(dev, "vkCmdProcessCommandsNVX"); + table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX)gpa(dev, "vkCmdReserveSpaceForCommandsNVX"); + table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX)gpa(dev, "vkCreateIndirectCommandsLayoutNVX"); + table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX)gpa(dev, "vkDestroyIndirectCommandsLayoutNVX"); + table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX)gpa(dev, "vkCreateObjectTableNVX"); + table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX)gpa(dev, "vkDestroyObjectTableNVX"); + table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)gpa(dev, "vkRegisterObjectsNVX"); + table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)gpa(dev, "vkUnregisterObjectsNVX"); + + // ---- VK_NV_clip_space_w_scaling extension commands + table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)gpa(dev, "vkCmdSetViewportWScalingNV"); + + // ---- VK_EXT_display_control extension commands + table->DisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT)gpa(dev, "vkDisplayPowerControlEXT"); + table->RegisterDeviceEventEXT = (PFN_vkRegisterDeviceEventEXT)gpa(dev, "vkRegisterDeviceEventEXT"); + table->RegisterDisplayEventEXT = (PFN_vkRegisterDisplayEventEXT)gpa(dev, "vkRegisterDisplayEventEXT"); + table->GetSwapchainCounterEXT = (PFN_vkGetSwapchainCounterEXT)gpa(dev, "vkGetSwapchainCounterEXT"); + + // ---- VK_GOOGLE_display_timing extension commands + table->GetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)gpa(dev, "vkGetRefreshCycleDurationGOOGLE"); + table->GetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)gpa(dev, "vkGetPastPresentationTimingGOOGLE"); + + // ---- VK_EXT_discard_rectangles extension commands + table->CmdSetDiscardRectangleEXT = (PFN_vkCmdSetDiscardRectangleEXT)gpa(dev, "vkCmdSetDiscardRectangleEXT"); + + // ---- VK_EXT_hdr_metadata extension commands + table->SetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)gpa(dev, "vkSetHdrMetadataEXT"); +} + +// Init Instance function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, + VkInstance inst) { + + // ---- Core 1_0 commands + table->DestroyInstance = (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance"); + table->EnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices"); + table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa(inst, "vkGetPhysicalDeviceFeatures"); + table->GetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties)gpa(inst, "vkGetPhysicalDeviceFormatProperties"); + table->GetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa(inst, "vkGetPhysicalDeviceImageFormatProperties"); + table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa(inst, "vkGetPhysicalDeviceProperties"); + table->GetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa(inst, "vkGetPhysicalDeviceQueueFamilyProperties"); + table->GetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties)gpa(inst, "vkGetPhysicalDeviceMemoryProperties"); + table->GetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr"); + table->EnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties)gpa(inst, "vkEnumerateDeviceExtensionProperties"); + table->EnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties)gpa(inst, "vkEnumerateDeviceLayerProperties"); + table->GetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa(inst, "vkGetPhysicalDeviceSparseImageFormatProperties"); +} + +// Init Instance function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, + VkInstance inst) { + + // ---- VK_KHR_surface extension commands + table->DestroySurfaceKHR = (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR"); + table->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa(inst, "vkGetPhysicalDeviceSurfaceSupportKHR"); + table->GetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa(inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); + table->GetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa(inst, "vkGetPhysicalDeviceSurfaceFormatsKHR"); + table->GetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa(inst, "vkGetPhysicalDeviceSurfacePresentModesKHR"); + + // ---- VK_KHR_display extension commands + table->GetPhysicalDeviceDisplayPropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)gpa(inst, "vkGetPhysicalDeviceDisplayPropertiesKHR"); + table->GetPhysicalDeviceDisplayPlanePropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)gpa(inst, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); + table->GetDisplayPlaneSupportedDisplaysKHR = (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)gpa(inst, "vkGetDisplayPlaneSupportedDisplaysKHR"); + table->GetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR)gpa(inst, "vkGetDisplayModePropertiesKHR"); + table->CreateDisplayModeKHR = (PFN_vkCreateDisplayModeKHR)gpa(inst, "vkCreateDisplayModeKHR"); + table->GetDisplayPlaneCapabilitiesKHR = (PFN_vkGetDisplayPlaneCapabilitiesKHR)gpa(inst, "vkGetDisplayPlaneCapabilitiesKHR"); + table->CreateDisplayPlaneSurfaceKHR = (PFN_vkCreateDisplayPlaneSurfaceKHR)gpa(inst, "vkCreateDisplayPlaneSurfaceKHR"); + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + table->CreateXlibSurfaceKHR = (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR"); +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + table->GetPhysicalDeviceXlibPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa(inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR"); +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + table->CreateXcbSurfaceKHR = (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR"); +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + table->GetPhysicalDeviceXcbPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa(inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR"); +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + table->CreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR"); +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + table->GetPhysicalDeviceWaylandPresentationSupportKHR = (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa(inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR"); +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + table->CreateMirSurfaceKHR = (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR"); +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + table->GetPhysicalDeviceMirPresentationSupportKHR = (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa(inst, "vkGetPhysicalDeviceMirPresentationSupportKHR"); +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + table->CreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR)gpa(inst, "vkCreateAndroidSurfaceKHR"); +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + table->CreateWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR"); +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + table->GetPhysicalDeviceWin32PresentationSupportKHR = (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa(inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR"); +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + table->GetPhysicalDeviceFeatures2KHR = (PFN_vkGetPhysicalDeviceFeatures2KHR)gpa(inst, "vkGetPhysicalDeviceFeatures2KHR"); + table->GetPhysicalDeviceProperties2KHR = (PFN_vkGetPhysicalDeviceProperties2KHR)gpa(inst, "vkGetPhysicalDeviceProperties2KHR"); + table->GetPhysicalDeviceFormatProperties2KHR = (PFN_vkGetPhysicalDeviceFormatProperties2KHR)gpa(inst, "vkGetPhysicalDeviceFormatProperties2KHR"); + table->GetPhysicalDeviceImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)gpa(inst, "vkGetPhysicalDeviceImageFormatProperties2KHR"); + table->GetPhysicalDeviceQueueFamilyProperties2KHR = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)gpa(inst, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); + table->GetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2KHR)gpa(inst, "vkGetPhysicalDeviceMemoryProperties2KHR"); + table->GetPhysicalDeviceSparseImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)gpa(inst, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); + + // ---- VK_EXT_debug_report extension commands + table->CreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT)gpa(inst, "vkCreateDebugReportCallbackEXT"); + table->DestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT)gpa(inst, "vkDestroyDebugReportCallbackEXT"); + table->DebugReportMessageEXT = (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT"); + + // ---- VK_NV_external_memory_capabilities extension commands + table->GetPhysicalDeviceExternalImageFormatPropertiesNV = (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)gpa(inst, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); + + // ---- VK_KHX_device_group extension commands + table->GetPhysicalDevicePresentRectanglesKHX = (PFN_vkGetPhysicalDevicePresentRectanglesKHX)gpa(inst, "vkGetPhysicalDevicePresentRectanglesKHX"); + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + table->CreateViSurfaceNN = (PFN_vkCreateViSurfaceNN)gpa(inst, "vkCreateViSurfaceNN"); +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + table->EnumeratePhysicalDeviceGroupsKHX = (PFN_vkEnumeratePhysicalDeviceGroupsKHX)gpa(inst, "vkEnumeratePhysicalDeviceGroupsKHX"); + + // ---- VK_KHX_external_memory_capabilities extension commands + table->GetPhysicalDeviceExternalBufferPropertiesKHX = (PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX)gpa(inst, "vkGetPhysicalDeviceExternalBufferPropertiesKHX"); + + // ---- VK_KHX_external_semaphore_capabilities extension commands + table->GetPhysicalDeviceExternalSemaphorePropertiesKHX = (PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX)gpa(inst, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHX"); + + // ---- VK_NVX_device_generated_commands extension commands + table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX = (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)gpa(inst, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); + + // ---- VK_EXT_direct_mode_display extension commands + table->ReleaseDisplayEXT = (PFN_vkReleaseDisplayEXT)gpa(inst, "vkReleaseDisplayEXT"); + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + table->AcquireXlibDisplayEXT = (PFN_vkAcquireXlibDisplayEXT)gpa(inst, "vkAcquireXlibDisplayEXT"); +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + table->GetRandROutputDisplayEXT = (PFN_vkGetRandROutputDisplayEXT)gpa(inst, "vkGetRandROutputDisplayEXT"); +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + table->GetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)gpa(inst, "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + table->CreateIOSSurfaceMVK = (PFN_vkCreateIOSSurfaceMVK)gpa(inst, "vkCreateIOSSurfaceMVK"); +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + table->CreateMacOSSurfaceMVK = (PFN_vkCreateMacOSSurfaceMVK)gpa(inst, "vkCreateMacOSSurfaceMVK"); +#endif // VK_USE_PLATFORM_MACOS_MVK +} + +// Device command lookup function +VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name) { + if (!name || name[0] != 'v' || name[1] != 'k') return NULL; + + name += 2; + + // ---- Core 1_0 commands + if (!strcmp(name, "GetDeviceProcAddr")) return (void *)table->GetDeviceProcAddr; + if (!strcmp(name, "DestroyDevice")) return (void *)table->DestroyDevice; + if (!strcmp(name, "GetDeviceQueue")) return (void *)table->GetDeviceQueue; + if (!strcmp(name, "QueueSubmit")) return (void *)table->QueueSubmit; + if (!strcmp(name, "QueueWaitIdle")) return (void *)table->QueueWaitIdle; + if (!strcmp(name, "DeviceWaitIdle")) return (void *)table->DeviceWaitIdle; + if (!strcmp(name, "AllocateMemory")) return (void *)table->AllocateMemory; + if (!strcmp(name, "FreeMemory")) return (void *)table->FreeMemory; + if (!strcmp(name, "MapMemory")) return (void *)table->MapMemory; + if (!strcmp(name, "UnmapMemory")) return (void *)table->UnmapMemory; + if (!strcmp(name, "FlushMappedMemoryRanges")) return (void *)table->FlushMappedMemoryRanges; + if (!strcmp(name, "InvalidateMappedMemoryRanges")) return (void *)table->InvalidateMappedMemoryRanges; + if (!strcmp(name, "GetDeviceMemoryCommitment")) return (void *)table->GetDeviceMemoryCommitment; + if (!strcmp(name, "BindBufferMemory")) return (void *)table->BindBufferMemory; + if (!strcmp(name, "BindImageMemory")) return (void *)table->BindImageMemory; + if (!strcmp(name, "GetBufferMemoryRequirements")) return (void *)table->GetBufferMemoryRequirements; + if (!strcmp(name, "GetImageMemoryRequirements")) return (void *)table->GetImageMemoryRequirements; + if (!strcmp(name, "GetImageSparseMemoryRequirements")) return (void *)table->GetImageSparseMemoryRequirements; + if (!strcmp(name, "QueueBindSparse")) return (void *)table->QueueBindSparse; + if (!strcmp(name, "CreateFence")) return (void *)table->CreateFence; + if (!strcmp(name, "DestroyFence")) return (void *)table->DestroyFence; + if (!strcmp(name, "ResetFences")) return (void *)table->ResetFences; + if (!strcmp(name, "GetFenceStatus")) return (void *)table->GetFenceStatus; + if (!strcmp(name, "WaitForFences")) return (void *)table->WaitForFences; + if (!strcmp(name, "CreateSemaphore")) return (void *)table->CreateSemaphore; + if (!strcmp(name, "DestroySemaphore")) return (void *)table->DestroySemaphore; + if (!strcmp(name, "CreateEvent")) return (void *)table->CreateEvent; + if (!strcmp(name, "DestroyEvent")) return (void *)table->DestroyEvent; + if (!strcmp(name, "GetEventStatus")) return (void *)table->GetEventStatus; + if (!strcmp(name, "SetEvent")) return (void *)table->SetEvent; + if (!strcmp(name, "ResetEvent")) return (void *)table->ResetEvent; + if (!strcmp(name, "CreateQueryPool")) return (void *)table->CreateQueryPool; + if (!strcmp(name, "DestroyQueryPool")) return (void *)table->DestroyQueryPool; + if (!strcmp(name, "GetQueryPoolResults")) return (void *)table->GetQueryPoolResults; + if (!strcmp(name, "CreateBuffer")) return (void *)table->CreateBuffer; + if (!strcmp(name, "DestroyBuffer")) return (void *)table->DestroyBuffer; + if (!strcmp(name, "CreateBufferView")) return (void *)table->CreateBufferView; + if (!strcmp(name, "DestroyBufferView")) return (void *)table->DestroyBufferView; + if (!strcmp(name, "CreateImage")) return (void *)table->CreateImage; + if (!strcmp(name, "DestroyImage")) return (void *)table->DestroyImage; + if (!strcmp(name, "GetImageSubresourceLayout")) return (void *)table->GetImageSubresourceLayout; + if (!strcmp(name, "CreateImageView")) return (void *)table->CreateImageView; + if (!strcmp(name, "DestroyImageView")) return (void *)table->DestroyImageView; + if (!strcmp(name, "CreateShaderModule")) return (void *)table->CreateShaderModule; + if (!strcmp(name, "DestroyShaderModule")) return (void *)table->DestroyShaderModule; + if (!strcmp(name, "CreatePipelineCache")) return (void *)table->CreatePipelineCache; + if (!strcmp(name, "DestroyPipelineCache")) return (void *)table->DestroyPipelineCache; + if (!strcmp(name, "GetPipelineCacheData")) return (void *)table->GetPipelineCacheData; + if (!strcmp(name, "MergePipelineCaches")) return (void *)table->MergePipelineCaches; + if (!strcmp(name, "CreateGraphicsPipelines")) return (void *)table->CreateGraphicsPipelines; + if (!strcmp(name, "CreateComputePipelines")) return (void *)table->CreateComputePipelines; + if (!strcmp(name, "DestroyPipeline")) return (void *)table->DestroyPipeline; + if (!strcmp(name, "CreatePipelineLayout")) return (void *)table->CreatePipelineLayout; + if (!strcmp(name, "DestroyPipelineLayout")) return (void *)table->DestroyPipelineLayout; + if (!strcmp(name, "CreateSampler")) return (void *)table->CreateSampler; + if (!strcmp(name, "DestroySampler")) return (void *)table->DestroySampler; + if (!strcmp(name, "CreateDescriptorSetLayout")) return (void *)table->CreateDescriptorSetLayout; + if (!strcmp(name, "DestroyDescriptorSetLayout")) return (void *)table->DestroyDescriptorSetLayout; + if (!strcmp(name, "CreateDescriptorPool")) return (void *)table->CreateDescriptorPool; + if (!strcmp(name, "DestroyDescriptorPool")) return (void *)table->DestroyDescriptorPool; + if (!strcmp(name, "ResetDescriptorPool")) return (void *)table->ResetDescriptorPool; + if (!strcmp(name, "AllocateDescriptorSets")) return (void *)table->AllocateDescriptorSets; + if (!strcmp(name, "FreeDescriptorSets")) return (void *)table->FreeDescriptorSets; + if (!strcmp(name, "UpdateDescriptorSets")) return (void *)table->UpdateDescriptorSets; + if (!strcmp(name, "CreateFramebuffer")) return (void *)table->CreateFramebuffer; + if (!strcmp(name, "DestroyFramebuffer")) return (void *)table->DestroyFramebuffer; + if (!strcmp(name, "CreateRenderPass")) return (void *)table->CreateRenderPass; + if (!strcmp(name, "DestroyRenderPass")) return (void *)table->DestroyRenderPass; + if (!strcmp(name, "GetRenderAreaGranularity")) return (void *)table->GetRenderAreaGranularity; + if (!strcmp(name, "CreateCommandPool")) return (void *)table->CreateCommandPool; + if (!strcmp(name, "DestroyCommandPool")) return (void *)table->DestroyCommandPool; + if (!strcmp(name, "ResetCommandPool")) return (void *)table->ResetCommandPool; + if (!strcmp(name, "AllocateCommandBuffers")) return (void *)table->AllocateCommandBuffers; + if (!strcmp(name, "FreeCommandBuffers")) return (void *)table->FreeCommandBuffers; + if (!strcmp(name, "BeginCommandBuffer")) return (void *)table->BeginCommandBuffer; + if (!strcmp(name, "EndCommandBuffer")) return (void *)table->EndCommandBuffer; + if (!strcmp(name, "ResetCommandBuffer")) return (void *)table->ResetCommandBuffer; + if (!strcmp(name, "CmdBindPipeline")) return (void *)table->CmdBindPipeline; + if (!strcmp(name, "CmdSetViewport")) return (void *)table->CmdSetViewport; + if (!strcmp(name, "CmdSetScissor")) return (void *)table->CmdSetScissor; + if (!strcmp(name, "CmdSetLineWidth")) return (void *)table->CmdSetLineWidth; + if (!strcmp(name, "CmdSetDepthBias")) return (void *)table->CmdSetDepthBias; + if (!strcmp(name, "CmdSetBlendConstants")) return (void *)table->CmdSetBlendConstants; + if (!strcmp(name, "CmdSetDepthBounds")) return (void *)table->CmdSetDepthBounds; + if (!strcmp(name, "CmdSetStencilCompareMask")) return (void *)table->CmdSetStencilCompareMask; + if (!strcmp(name, "CmdSetStencilWriteMask")) return (void *)table->CmdSetStencilWriteMask; + if (!strcmp(name, "CmdSetStencilReference")) return (void *)table->CmdSetStencilReference; + if (!strcmp(name, "CmdBindDescriptorSets")) return (void *)table->CmdBindDescriptorSets; + if (!strcmp(name, "CmdBindIndexBuffer")) return (void *)table->CmdBindIndexBuffer; + if (!strcmp(name, "CmdBindVertexBuffers")) return (void *)table->CmdBindVertexBuffers; + if (!strcmp(name, "CmdDraw")) return (void *)table->CmdDraw; + if (!strcmp(name, "CmdDrawIndexed")) return (void *)table->CmdDrawIndexed; + if (!strcmp(name, "CmdDrawIndirect")) return (void *)table->CmdDrawIndirect; + if (!strcmp(name, "CmdDrawIndexedIndirect")) return (void *)table->CmdDrawIndexedIndirect; + if (!strcmp(name, "CmdDispatch")) return (void *)table->CmdDispatch; + if (!strcmp(name, "CmdDispatchIndirect")) return (void *)table->CmdDispatchIndirect; + if (!strcmp(name, "CmdCopyBuffer")) return (void *)table->CmdCopyBuffer; + if (!strcmp(name, "CmdCopyImage")) return (void *)table->CmdCopyImage; + if (!strcmp(name, "CmdBlitImage")) return (void *)table->CmdBlitImage; + if (!strcmp(name, "CmdCopyBufferToImage")) return (void *)table->CmdCopyBufferToImage; + if (!strcmp(name, "CmdCopyImageToBuffer")) return (void *)table->CmdCopyImageToBuffer; + if (!strcmp(name, "CmdUpdateBuffer")) return (void *)table->CmdUpdateBuffer; + if (!strcmp(name, "CmdFillBuffer")) return (void *)table->CmdFillBuffer; + if (!strcmp(name, "CmdClearColorImage")) return (void *)table->CmdClearColorImage; + if (!strcmp(name, "CmdClearDepthStencilImage")) return (void *)table->CmdClearDepthStencilImage; + if (!strcmp(name, "CmdClearAttachments")) return (void *)table->CmdClearAttachments; + if (!strcmp(name, "CmdResolveImage")) return (void *)table->CmdResolveImage; + if (!strcmp(name, "CmdSetEvent")) return (void *)table->CmdSetEvent; + if (!strcmp(name, "CmdResetEvent")) return (void *)table->CmdResetEvent; + if (!strcmp(name, "CmdWaitEvents")) return (void *)table->CmdWaitEvents; + if (!strcmp(name, "CmdPipelineBarrier")) return (void *)table->CmdPipelineBarrier; + if (!strcmp(name, "CmdBeginQuery")) return (void *)table->CmdBeginQuery; + if (!strcmp(name, "CmdEndQuery")) return (void *)table->CmdEndQuery; + if (!strcmp(name, "CmdResetQueryPool")) return (void *)table->CmdResetQueryPool; + if (!strcmp(name, "CmdWriteTimestamp")) return (void *)table->CmdWriteTimestamp; + if (!strcmp(name, "CmdCopyQueryPoolResults")) return (void *)table->CmdCopyQueryPoolResults; + if (!strcmp(name, "CmdPushConstants")) return (void *)table->CmdPushConstants; + if (!strcmp(name, "CmdBeginRenderPass")) return (void *)table->CmdBeginRenderPass; + if (!strcmp(name, "CmdNextSubpass")) return (void *)table->CmdNextSubpass; + if (!strcmp(name, "CmdEndRenderPass")) return (void *)table->CmdEndRenderPass; + if (!strcmp(name, "CmdExecuteCommands")) return (void *)table->CmdExecuteCommands; + + // ---- VK_KHR_swapchain extension commands + if (!strcmp(name, "CreateSwapchainKHR")) return (void *)table->CreateSwapchainKHR; + if (!strcmp(name, "DestroySwapchainKHR")) return (void *)table->DestroySwapchainKHR; + if (!strcmp(name, "GetSwapchainImagesKHR")) return (void *)table->GetSwapchainImagesKHR; + if (!strcmp(name, "AcquireNextImageKHR")) return (void *)table->AcquireNextImageKHR; + if (!strcmp(name, "QueuePresentKHR")) return (void *)table->QueuePresentKHR; + + // ---- VK_KHR_display_swapchain extension commands + if (!strcmp(name, "CreateSharedSwapchainsKHR")) return (void *)table->CreateSharedSwapchainsKHR; + + // ---- VK_KHR_maintenance1 extension commands + if (!strcmp(name, "TrimCommandPoolKHR")) return (void *)table->TrimCommandPoolKHR; + + // ---- VK_KHR_push_descriptor extension commands + if (!strcmp(name, "CmdPushDescriptorSetKHR")) return (void *)table->CmdPushDescriptorSetKHR; + + // ---- VK_KHR_descriptor_update_template extension commands + if (!strcmp(name, "CreateDescriptorUpdateTemplateKHR")) return (void *)table->CreateDescriptorUpdateTemplateKHR; + if (!strcmp(name, "DestroyDescriptorUpdateTemplateKHR")) return (void *)table->DestroyDescriptorUpdateTemplateKHR; + if (!strcmp(name, "UpdateDescriptorSetWithTemplateKHR")) return (void *)table->UpdateDescriptorSetWithTemplateKHR; + if (!strcmp(name, "CmdPushDescriptorSetWithTemplateKHR")) return (void *)table->CmdPushDescriptorSetWithTemplateKHR; + + // ---- VK_EXT_debug_marker extension commands + if (!strcmp(name, "DebugMarkerSetObjectTagEXT")) return (void *)table->DebugMarkerSetObjectTagEXT; + if (!strcmp(name, "DebugMarkerSetObjectNameEXT")) return (void *)table->DebugMarkerSetObjectNameEXT; + if (!strcmp(name, "CmdDebugMarkerBeginEXT")) return (void *)table->CmdDebugMarkerBeginEXT; + if (!strcmp(name, "CmdDebugMarkerEndEXT")) return (void *)table->CmdDebugMarkerEndEXT; + if (!strcmp(name, "CmdDebugMarkerInsertEXT")) return (void *)table->CmdDebugMarkerInsertEXT; + + // ---- VK_AMD_draw_indirect_count extension commands + if (!strcmp(name, "CmdDrawIndirectCountAMD")) return (void *)table->CmdDrawIndirectCountAMD; + if (!strcmp(name, "CmdDrawIndexedIndirectCountAMD")) return (void *)table->CmdDrawIndexedIndirectCountAMD; + + // ---- VK_NV_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (!strcmp(name, "GetMemoryWin32HandleNV")) return (void *)table->GetMemoryWin32HandleNV; +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHX_device_group extension commands + if (!strcmp(name, "GetDeviceGroupPeerMemoryFeaturesKHX")) return (void *)table->GetDeviceGroupPeerMemoryFeaturesKHX; + if (!strcmp(name, "BindBufferMemory2KHX")) return (void *)table->BindBufferMemory2KHX; + if (!strcmp(name, "BindImageMemory2KHX")) return (void *)table->BindImageMemory2KHX; + if (!strcmp(name, "CmdSetDeviceMaskKHX")) return (void *)table->CmdSetDeviceMaskKHX; + if (!strcmp(name, "GetDeviceGroupPresentCapabilitiesKHX")) return (void *)table->GetDeviceGroupPresentCapabilitiesKHX; + if (!strcmp(name, "GetDeviceGroupSurfacePresentModesKHX")) return (void *)table->GetDeviceGroupSurfacePresentModesKHX; + if (!strcmp(name, "AcquireNextImage2KHX")) return (void *)table->AcquireNextImage2KHX; + if (!strcmp(name, "CmdDispatchBaseKHX")) return (void *)table->CmdDispatchBaseKHX; + + // ---- VK_KHX_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp(name, "GetMemoryWin32HandleKHX")) return (void *)table->GetMemoryWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp(name, "GetMemoryWin32HandlePropertiesKHX")) return (void *)table->GetMemoryWin32HandlePropertiesKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_memory_fd extension commands + if (!strcmp(name, "GetMemoryFdKHX")) return (void *)table->GetMemoryFdKHX; + if (!strcmp(name, "GetMemoryFdPropertiesKHX")) return (void *)table->GetMemoryFdPropertiesKHX; + + // ---- VK_KHX_external_semaphore_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp(name, "ImportSemaphoreWin32HandleKHX")) return (void *)table->ImportSemaphoreWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp(name, "GetSemaphoreWin32HandleKHX")) return (void *)table->GetSemaphoreWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_semaphore_fd extension commands + if (!strcmp(name, "ImportSemaphoreFdKHX")) return (void *)table->ImportSemaphoreFdKHX; + if (!strcmp(name, "GetSemaphoreFdKHX")) return (void *)table->GetSemaphoreFdKHX; + + // ---- VK_NVX_device_generated_commands extension commands + if (!strcmp(name, "CmdProcessCommandsNVX")) return (void *)table->CmdProcessCommandsNVX; + if (!strcmp(name, "CmdReserveSpaceForCommandsNVX")) return (void *)table->CmdReserveSpaceForCommandsNVX; + if (!strcmp(name, "CreateIndirectCommandsLayoutNVX")) return (void *)table->CreateIndirectCommandsLayoutNVX; + if (!strcmp(name, "DestroyIndirectCommandsLayoutNVX")) return (void *)table->DestroyIndirectCommandsLayoutNVX; + if (!strcmp(name, "CreateObjectTableNVX")) return (void *)table->CreateObjectTableNVX; + if (!strcmp(name, "DestroyObjectTableNVX")) return (void *)table->DestroyObjectTableNVX; + if (!strcmp(name, "RegisterObjectsNVX")) return (void *)table->RegisterObjectsNVX; + if (!strcmp(name, "UnregisterObjectsNVX")) return (void *)table->UnregisterObjectsNVX; + + // ---- VK_NV_clip_space_w_scaling extension commands + if (!strcmp(name, "CmdSetViewportWScalingNV")) return (void *)table->CmdSetViewportWScalingNV; + + // ---- VK_EXT_display_control extension commands + if (!strcmp(name, "DisplayPowerControlEXT")) return (void *)table->DisplayPowerControlEXT; + if (!strcmp(name, "RegisterDeviceEventEXT")) return (void *)table->RegisterDeviceEventEXT; + if (!strcmp(name, "RegisterDisplayEventEXT")) return (void *)table->RegisterDisplayEventEXT; + if (!strcmp(name, "GetSwapchainCounterEXT")) return (void *)table->GetSwapchainCounterEXT; + + // ---- VK_GOOGLE_display_timing extension commands + if (!strcmp(name, "GetRefreshCycleDurationGOOGLE")) return (void *)table->GetRefreshCycleDurationGOOGLE; + if (!strcmp(name, "GetPastPresentationTimingGOOGLE")) return (void *)table->GetPastPresentationTimingGOOGLE; + + // ---- VK_EXT_discard_rectangles extension commands + if (!strcmp(name, "CmdSetDiscardRectangleEXT")) return (void *)table->CmdSetDiscardRectangleEXT; + + // ---- VK_EXT_hdr_metadata extension commands + if (!strcmp(name, "SetHdrMetadataEXT")) return (void *)table->SetHdrMetadataEXT; + + return NULL; +} + +// Instance command lookup function +VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name, + bool *found_name) { + if (!name || name[0] != 'v' || name[1] != 'k') { + *found_name = false; + return NULL; + } + + *found_name = true; + name += 2; + + // ---- Core 1_0 commands + if (!strcmp(name, "DestroyInstance")) return (void *)table->DestroyInstance; + if (!strcmp(name, "EnumeratePhysicalDevices")) return (void *)table->EnumeratePhysicalDevices; + if (!strcmp(name, "GetPhysicalDeviceFeatures")) return (void *)table->GetPhysicalDeviceFeatures; + if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) return (void *)table->GetPhysicalDeviceFormatProperties; + if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties")) return (void *)table->GetPhysicalDeviceImageFormatProperties; + if (!strcmp(name, "GetPhysicalDeviceProperties")) return (void *)table->GetPhysicalDeviceProperties; + if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) return (void *)table->GetPhysicalDeviceQueueFamilyProperties; + if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) return (void *)table->GetPhysicalDeviceMemoryProperties; + if (!strcmp(name, "GetInstanceProcAddr")) return (void *)table->GetInstanceProcAddr; + if (!strcmp(name, "EnumerateDeviceExtensionProperties")) return (void *)table->EnumerateDeviceExtensionProperties; + if (!strcmp(name, "EnumerateDeviceLayerProperties")) return (void *)table->EnumerateDeviceLayerProperties; + if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) return (void *)table->GetPhysicalDeviceSparseImageFormatProperties; + + // ---- VK_KHR_surface extension commands + if (!strcmp(name, "DestroySurfaceKHR")) return (void *)table->DestroySurfaceKHR; + if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR")) return (void *)table->GetPhysicalDeviceSurfaceSupportKHR; + if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR")) return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR; + if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR")) return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR; + if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR")) return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR; + + // ---- VK_KHR_display extension commands + if (!strcmp(name, "GetPhysicalDeviceDisplayPropertiesKHR")) return (void *)table->GetPhysicalDeviceDisplayPropertiesKHR; + if (!strcmp(name, "GetPhysicalDeviceDisplayPlanePropertiesKHR")) return (void *)table->GetPhysicalDeviceDisplayPlanePropertiesKHR; + if (!strcmp(name, "GetDisplayPlaneSupportedDisplaysKHR")) return (void *)table->GetDisplayPlaneSupportedDisplaysKHR; + if (!strcmp(name, "GetDisplayModePropertiesKHR")) return (void *)table->GetDisplayModePropertiesKHR; + if (!strcmp(name, "CreateDisplayModeKHR")) return (void *)table->CreateDisplayModeKHR; + if (!strcmp(name, "GetDisplayPlaneCapabilitiesKHR")) return (void *)table->GetDisplayPlaneCapabilitiesKHR; + if (!strcmp(name, "CreateDisplayPlaneSurfaceKHR")) return (void *)table->CreateDisplayPlaneSurfaceKHR; + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + if (!strcmp(name, "CreateXlibSurfaceKHR")) return (void *)table->CreateXlibSurfaceKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR")) return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + if (!strcmp(name, "CreateXcbSurfaceKHR")) return (void *)table->CreateXcbSurfaceKHR; +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR")) return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + if (!strcmp(name, "CreateWaylandSurfaceKHR")) return (void *)table->CreateWaylandSurfaceKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR")) return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + if (!strcmp(name, "CreateMirSurfaceKHR")) return (void *)table->CreateMirSurfaceKHR; +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR")) return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR; +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + if (!strcmp(name, "CreateAndroidSurfaceKHR")) return (void *)table->CreateAndroidSurfaceKHR; +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (!strcmp(name, "CreateWin32SurfaceKHR")) return (void *)table->CreateWin32SurfaceKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + if (!strcmp(name, "GetPhysicalDeviceFeatures2KHR")) return (void *)table->GetPhysicalDeviceFeatures2KHR; + if (!strcmp(name, "GetPhysicalDeviceProperties2KHR")) return (void *)table->GetPhysicalDeviceProperties2KHR; + if (!strcmp(name, "GetPhysicalDeviceFormatProperties2KHR")) return (void *)table->GetPhysicalDeviceFormatProperties2KHR; + if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties2KHR")) return (void *)table->GetPhysicalDeviceImageFormatProperties2KHR; + if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties2KHR")) return (void *)table->GetPhysicalDeviceQueueFamilyProperties2KHR; + if (!strcmp(name, "GetPhysicalDeviceMemoryProperties2KHR")) return (void *)table->GetPhysicalDeviceMemoryProperties2KHR; + if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties2KHR")) return (void *)table->GetPhysicalDeviceSparseImageFormatProperties2KHR; + + // ---- VK_EXT_debug_report extension commands + if (!strcmp(name, "CreateDebugReportCallbackEXT")) return (void *)table->CreateDebugReportCallbackEXT; + if (!strcmp(name, "DestroyDebugReportCallbackEXT")) return (void *)table->DestroyDebugReportCallbackEXT; + if (!strcmp(name, "DebugReportMessageEXT")) return (void *)table->DebugReportMessageEXT; + + // ---- VK_NV_external_memory_capabilities extension commands + if (!strcmp(name, "GetPhysicalDeviceExternalImageFormatPropertiesNV")) return (void *)table->GetPhysicalDeviceExternalImageFormatPropertiesNV; + + // ---- VK_KHX_device_group extension commands + if (!strcmp(name, "GetPhysicalDevicePresentRectanglesKHX")) return (void *)table->GetPhysicalDevicePresentRectanglesKHX; + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + if (!strcmp(name, "CreateViSurfaceNN")) return (void *)table->CreateViSurfaceNN; +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + if (!strcmp(name, "EnumeratePhysicalDeviceGroupsKHX")) return (void *)table->EnumeratePhysicalDeviceGroupsKHX; + + // ---- VK_KHX_external_memory_capabilities extension commands + if (!strcmp(name, "GetPhysicalDeviceExternalBufferPropertiesKHX")) return (void *)table->GetPhysicalDeviceExternalBufferPropertiesKHX; + + // ---- VK_KHX_external_semaphore_capabilities extension commands + if (!strcmp(name, "GetPhysicalDeviceExternalSemaphorePropertiesKHX")) return (void *)table->GetPhysicalDeviceExternalSemaphorePropertiesKHX; + + // ---- VK_NVX_device_generated_commands extension commands + if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX")) return (void *)table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + + // ---- VK_EXT_direct_mode_display extension commands + if (!strcmp(name, "ReleaseDisplayEXT")) return (void *)table->ReleaseDisplayEXT; + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + if (!strcmp(name, "AcquireXlibDisplayEXT")) return (void *)table->AcquireXlibDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + if (!strcmp(name, "GetRandROutputDisplayEXT")) return (void *)table->GetRandROutputDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2EXT")) return (void *)table->GetPhysicalDeviceSurfaceCapabilities2EXT; + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + if (!strcmp(name, "CreateIOSSurfaceMVK")) return (void *)table->CreateIOSSurfaceMVK; +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + if (!strcmp(name, "CreateMacOSSurfaceMVK")) return (void *)table->CreateMacOSSurfaceMVK; +#endif // VK_USE_PLATFORM_MACOS_MVK + + *found_name = false; + return NULL; +} + + +// ---- VK_KHR_get_physical_device_properties2 extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2KHR* pFeatures) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceFeatures2KHR(unwrapped_phys_dev, pFeatures); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2KHR* pFeatures) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceFeatures2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceFeatures2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceFeatures2KHR(phys_dev_term->phys_dev, pFeatures); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHR* pProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceProperties2KHR(unwrapped_phys_dev, pProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHR* pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceProperties2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceProperties2KHR(phys_dev_term->phys_dev, pProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2KHR* pFormatProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceFormatProperties2KHR(unwrapped_phys_dev, format, pFormatProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2KHR* pFormatProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceFormatProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceFormatProperties2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceFormatProperties2KHR(phys_dev_term->phys_dev, format, pFormatProperties); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, + VkImageFormatProperties2KHR* pImageFormatProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDeviceImageFormatProperties2KHR(unwrapped_phys_dev, pImageFormatInfo, pImageFormatProperties); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, + VkImageFormatProperties2KHR* pImageFormatProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceImageFormatProperties2KHR"); + } + return icd_term->dispatch.GetPhysicalDeviceImageFormatProperties2KHR(phys_dev_term->phys_dev, pImageFormatInfo, pImageFormatProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2KHR* pQueueFamilyProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceQueueFamilyProperties2KHR(unwrapped_phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2KHR( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties2KHR* pQueueFamilyProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceQueueFamilyProperties2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceQueueFamilyProperties2KHR(phys_dev_term->phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceMemoryProperties2KHR(unwrapped_phys_dev, pMemoryProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties2KHR( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceMemoryProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceMemoryProperties2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceMemoryProperties2KHR(phys_dev_term->phys_dev, pMemoryProperties); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2KHR* pProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceSparseImageFormatProperties2KHR(unwrapped_phys_dev, pFormatInfo, pPropertyCount, pProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties2KHR* pProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2KHR) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceSparseImageFormatProperties2KHR"); + } + icd_term->dispatch.GetPhysicalDeviceSparseImageFormatProperties2KHR(phys_dev_term->phys_dev, pFormatInfo, pPropertyCount, pProperties); +} + + +// ---- VK_KHR_maintenance1 extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR( + VkDevice device, + VkCommandPool commandPool, + VkCommandPoolTrimFlagsKHR flags) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->TrimCommandPoolKHR(device, commandPool, flags); +} + + +// ---- VK_KHR_push_descriptor extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); +} + + +// ---- VK_KHR_descriptor_update_template extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); +} + +VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR( + VkDevice device, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); +} + +VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void* pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); +} + +VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); +} + + +// ---- VK_EXT_debug_marker extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT( + VkDevice device, + VkDebugMarkerObjectTagInfoEXT* pTagInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + // If this is a physical device, we have to replace it with the proper one for the next call. + if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { + struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->object; + pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; + } + return disp->DebugMarkerSetObjectTagEXT(device, pTagInfo); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectTagEXT( + VkDevice device, + VkDebugMarkerObjectTagInfoEXT* pTagInfo) { + uint32_t icd_index = 0; + struct loader_device *dev; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.DebugMarkerSetObjectTagEXT) { + // If this is a physical device, we have to replace it with the proper one for the next call. + if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pTagInfo->object; + pTagInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; + // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call. + } else if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->object; + if (NULL != icd_surface->real_icd_surfaces) { + pTagInfo->object = (uint64_t)icd_surface->real_icd_surfaces[icd_index]; + } + } + } + return icd_term->dispatch.DebugMarkerSetObjectTagEXT(device, pTagInfo); + } else { + return VK_SUCCESS; + } +} + +VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT( + VkDevice device, + VkDebugMarkerObjectNameInfoEXT* pNameInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + // If this is a physical device, we have to replace it with the proper one for the next call. + if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { + struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pNameInfo->object; + pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev; + } + return disp->DebugMarkerSetObjectNameEXT(device, pNameInfo); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_DebugMarkerSetObjectNameEXT( + VkDevice device, + VkDebugMarkerObjectNameInfoEXT* pNameInfo) { + uint32_t icd_index = 0; + struct loader_device *dev; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.DebugMarkerSetObjectNameEXT) { + // If this is a physical device, we have to replace it with the proper one for the next call. + if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pNameInfo->object; + pNameInfo->object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev; + // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call. + } else if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) { + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->object; + if (NULL != icd_surface->real_icd_surfaces) { + pNameInfo->object = (uint64_t)icd_surface->real_icd_surfaces[icd_index]; + } + } + } + return icd_term->dispatch.DebugMarkerSetObjectNameEXT(device, pNameInfo); + } else { + return VK_SUCCESS; + } +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT( + VkCommandBuffer commandBuffer, + VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT( + VkCommandBuffer commandBuffer) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDebugMarkerEndEXT(commandBuffer); +} + +VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT( + VkCommandBuffer commandBuffer, + VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); +} + + +// ---- VK_AMD_draw_indirect_count extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); +} + +VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); +} + + +// ---- VK_NV_external_memory_win32 extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_WIN32_KHR +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagsNV handleType, + HANDLE* pHandle) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetMemoryWin32HandleNV(device, memory, handleType, pHandle); +} + +#endif // VK_USE_PLATFORM_WIN32_KHR + +// ---- VK_KHX_device_group extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHX( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetDeviceGroupPeerMemoryFeaturesKHX(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); +} + +VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHX* pBindInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BindBufferMemory2KHX(device, bindInfoCount, pBindInfos); +} + +VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHX* pBindInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BindImageMemory2KHX(device, bindInfoCount, pBindInfos); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHX( + VkCommandBuffer commandBuffer, + uint32_t deviceMask) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDeviceMaskKHX(commandBuffer, deviceMask); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupPresentCapabilitiesKHX( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeviceGroupPresentCapabilitiesKHX(device, pDeviceGroupPresentCapabilities); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHX( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX* pModes) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModesKHX( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX* pModes) { + uint32_t icd_index = 0; + struct loader_device *dev; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHX) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { + return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHX(device, icd_surface->real_icd_surfaces[icd_index], pModes); + } + return icd_term->dispatch.GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); + } + return VK_SUCCESS; +} + +VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHX( + VkDevice device, + const VkAcquireNextImageInfoKHX* pAcquireInfo, + uint32_t* pImageIndex) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->AcquireNextImage2KHX(device, pAcquireInfo, pImageIndex); +} + +VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHX( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdDispatchBaseKHX(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHX( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDevicePresentRectanglesKHX(unwrapped_phys_dev, surface, pRectCount, pRects); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDevicePresentRectanglesKHX( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHX) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDevicePresentRectanglesKHX"); + } + VkIcdSurface *icd_surface = (VkIcdSurface *)(surface); + uint8_t icd_index = phys_dev_term->icd_index; + if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) { + return icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHX(phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[icd_index], pRectCount, pRects); + } + return icd_term->dispatch.GetPhysicalDevicePresentRectanglesKHX(phys_dev_term->phys_dev, surface, pRectCount, pRects); +} + + +// ---- VK_NN_vi_surface extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_VI_NN +VKAPI_ATTR VkResult VKAPI_CALL CreateViSurfaceNN( + VkInstance instance, + const VkViSurfaceCreateInfoNN* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); + return disp->CreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateViSurfaceNN( + VkInstance instance, + const VkViSurfaceCreateInfoNN* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); +} + +#endif // VK_USE_PLATFORM_VI_NN + +// ---- VK_KHX_external_memory_capabilities extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, + VkExternalBufferPropertiesKHX* pExternalBufferProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceExternalBufferPropertiesKHX(unwrapped_phys_dev, pExternalBufferInfo, pExternalBufferProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, + VkExternalBufferPropertiesKHX* pExternalBufferProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceExternalBufferPropertiesKHX) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceExternalBufferPropertiesKHX"); + } + icd_term->dispatch.GetPhysicalDeviceExternalBufferPropertiesKHX(phys_dev_term->phys_dev, pExternalBufferInfo, pExternalBufferProperties); +} + + +// ---- VK_KHX_external_memory_win32 extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetMemoryWin32HandleKHX(device, memory, handleType, pHandle); +} + +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetMemoryWin32HandlePropertiesKHX(device, handleType, handle, pMemoryWin32HandleProperties); +} + +#endif // VK_USE_PLATFORM_WIN32_KHX + +// ---- VK_KHX_external_memory_fd extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int* pFd) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetMemoryFdKHX(device, memory, handleType, pFd); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int fd, + VkMemoryFdPropertiesKHX* pMemoryFdProperties) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetMemoryFdPropertiesKHX(device, handleType, fd, pMemoryFdProperties); +} + + +// ---- VK_KHX_external_semaphore_capabilities extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceExternalSemaphorePropertiesKHX(unwrapped_phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceExternalSemaphorePropertiesKHX) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceExternalSemaphorePropertiesKHX"); + } + icd_term->dispatch.GetPhysicalDeviceExternalSemaphorePropertiesKHX(phys_dev_term->phys_dev, pExternalSemaphoreInfo, pExternalSemaphoreProperties); +} + + +// ---- VK_KHX_external_semaphore_win32 extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreWin32HandleKHX( + VkDevice device, + const VkImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->ImportSemaphoreWin32HandleKHX(device, pImportSemaphoreWin32HandleInfo); +} + +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetSemaphoreWin32HandleKHX(device, semaphore, handleType, pHandle); +} + +#endif // VK_USE_PLATFORM_WIN32_KHX + +// ---- VK_KHX_external_semaphore_fd extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHX( + VkDevice device, + const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->ImportSemaphoreFdKHX(device, pImportSemaphoreFdInfo); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + int* pFd) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetSemaphoreFdKHX(device, semaphore, handleType, pFd); +} + + +// ---- VK_NVX_device_generated_commands extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX( + VkCommandBuffer commandBuffer, + const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); +} + +VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX( + VkDevice device, + VkIndirectCommandsLayoutNVX indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX( + VkDevice device, + const VkObjectTableCreateInfoNVX* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkObjectTableNVX* pObjectTable) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); +} + +VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX( + VkDevice device, + VkObjectTableNVX objectTable, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyObjectTableNVX(device, objectTable, pAllocator); +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectTableEntryNVX* const* ppObjectTableEntries, + const uint32_t* pObjectIndices) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); +} + +VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX( + VkDevice device, + VkObjectTableNVX objectTable, + uint32_t objectCount, + const VkObjectEntryTypeNVX* pObjectEntryTypes, + const uint32_t* pObjectIndices) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); +} + +VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX( + VkPhysicalDevice physicalDevice, + VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, + VkDeviceGeneratedCommandsLimitsNVX* pLimits) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + disp->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(unwrapped_phys_dev, pFeatures, pLimits); +} + +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( + VkPhysicalDevice physicalDevice, + VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, + VkDeviceGeneratedCommandsLimitsNVX* pLimits) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceGeneratedCommandsPropertiesNVX) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceGeneratedCommandsPropertiesNVX"); + } + icd_term->dispatch.GetPhysicalDeviceGeneratedCommandsPropertiesNVX(phys_dev_term->phys_dev, pFeatures, pLimits); +} + + +// ---- VK_NV_clip_space_w_scaling extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportWScalingNV* pViewportWScalings) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); +} + + +// ---- VK_EXT_direct_mode_display extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->ReleaseDisplayEXT(unwrapped_phys_dev, display); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_ReleaseDisplayEXT( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.ReleaseDisplayEXT) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support ReleaseDisplayEXT"); + } + return icd_term->dispatch.ReleaseDisplayEXT(phys_dev_term->phys_dev, display); +} + + +// ---- VK_EXT_acquire_xlib_display extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT +VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + VkDisplayKHR display) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->AcquireXlibDisplayEXT(unwrapped_phys_dev, dpy, display); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_AcquireXlibDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + VkDisplayKHR display) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.AcquireXlibDisplayEXT) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support AcquireXlibDisplayEXT"); + } + return icd_term->dispatch.AcquireXlibDisplayEXT(phys_dev_term->phys_dev, dpy, display); +} + +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT +VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + RROutput rrOutput, + VkDisplayKHR* pDisplay) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetRandROutputDisplayEXT(unwrapped_phys_dev, dpy, rrOutput, pDisplay); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetRandROutputDisplayEXT( + VkPhysicalDevice physicalDevice, + Display* dpy, + RROutput rrOutput, + VkDisplayKHR* pDisplay) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetRandROutputDisplayEXT) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetRandROutputDisplayEXT"); + } + return icd_term->dispatch.GetRandROutputDisplayEXT(phys_dev_term->phys_dev, dpy, rrOutput, pDisplay); +} + +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + +// ---- VK_EXT_display_surface_counter extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT* pSurfaceCapabilities) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDeviceSurfaceCapabilities2EXT(unwrapped_phys_dev, surface, pSurfaceCapabilities); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2EXT( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT* pSurfaceCapabilities) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2EXT) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceSurfaceCapabilities2EXT"); + } + VkIcdSurface *icd_surface = (VkIcdSurface *)(surface); + uint8_t icd_index = phys_dev_term->icd_index; + if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) { + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2EXT(phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[icd_index], pSurfaceCapabilities); + } + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2EXT(phys_dev_term->phys_dev, surface, pSurfaceCapabilities); +} + + +// ---- VK_EXT_display_control extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayPowerInfoEXT* pDisplayPowerInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->DisplayPowerControlEXT(device, display, pDisplayPowerInfo); +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT( + VkDevice device, + const VkDeviceEventInfoEXT* pDeviceEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); +} + +VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT( + VkDevice device, + VkDisplayKHR display, + const VkDisplayEventInfoEXT* pDisplayEventInfo, + const VkAllocationCallbacks* pAllocator, + VkFence* pFence) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT( + VkDevice device, + VkSwapchainKHR swapchain, + VkSurfaceCounterFlagBitsEXT counter, + uint64_t* pCounterValue) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); +} + + +// ---- VK_GOOGLE_display_timing extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); +} + +VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pPresentationTimingCount, + VkPastPresentationTimingGOOGLE* pPresentationTimings) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings); +} + + +// ---- VK_EXT_discard_rectangles extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT( + VkCommandBuffer commandBuffer, + uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, + const VkRect2D* pDiscardRectangles) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles); +} + + +// ---- VK_EXT_hdr_metadata extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainKHR* pSwapchains, + const VkHdrMetadataEXT* pMetadata) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->SetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata); +} + + +// ---- VK_MVK_ios_surface extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_IOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL CreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); + return disp->CreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); +} + +#endif // VK_USE_PLATFORM_IOS_MVK + +// ---- VK_MVK_macos_surface extension trampoline/terminators + +#ifdef VK_USE_PLATFORM_MACOS_MVK +VKAPI_ATTR VkResult VKAPI_CALL CreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); + return disp->CreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface) { +#error("Not implemented. Likely needs to be manually generated!"); +} + +#endif // VK_USE_PLATFORM_MACOS_MVK +// GPA helpers for extensions +bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { + *addr = NULL; + + + // ---- VK_KHR_get_physical_device_properties2 extension commands + if (!strcmp("vkGetPhysicalDeviceFeatures2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceFeatures2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceProperties2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceFormatProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceFormatProperties2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceImageFormatProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceImageFormatProperties2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceQueueFamilyProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceQueueFamilyProperties2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceMemoryProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceMemoryProperties2KHR + : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceSparseImageFormatProperties2KHR", name)) { + *addr = (ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 == 1) + ? (void *)GetPhysicalDeviceSparseImageFormatProperties2KHR + : NULL; + return true; + } + + // ---- VK_KHR_maintenance1 extension commands + if (!strcmp("vkTrimCommandPoolKHR", name)) { + *addr = (void *)TrimCommandPoolKHR; + return true; + } + + // ---- VK_KHR_push_descriptor extension commands + if (!strcmp("vkCmdPushDescriptorSetKHR", name)) { + *addr = (void *)CmdPushDescriptorSetKHR; + return true; + } + + // ---- VK_KHR_descriptor_update_template extension commands + if (!strcmp("vkCreateDescriptorUpdateTemplateKHR", name)) { + *addr = (void *)CreateDescriptorUpdateTemplateKHR; + return true; + } + if (!strcmp("vkDestroyDescriptorUpdateTemplateKHR", name)) { + *addr = (void *)DestroyDescriptorUpdateTemplateKHR; + return true; + } + if (!strcmp("vkUpdateDescriptorSetWithTemplateKHR", name)) { + *addr = (void *)UpdateDescriptorSetWithTemplateKHR; + return true; + } + if (!strcmp("vkCmdPushDescriptorSetWithTemplateKHR", name)) { + *addr = (void *)CmdPushDescriptorSetWithTemplateKHR; + return true; + } + + // ---- VK_EXT_debug_marker extension commands + if (!strcmp("vkDebugMarkerSetObjectTagEXT", name)) { + *addr = (void *)DebugMarkerSetObjectTagEXT; + return true; + } + if (!strcmp("vkDebugMarkerSetObjectNameEXT", name)) { + *addr = (void *)DebugMarkerSetObjectNameEXT; + return true; + } + if (!strcmp("vkCmdDebugMarkerBeginEXT", name)) { + *addr = (void *)CmdDebugMarkerBeginEXT; + return true; + } + if (!strcmp("vkCmdDebugMarkerEndEXT", name)) { + *addr = (void *)CmdDebugMarkerEndEXT; + return true; + } + if (!strcmp("vkCmdDebugMarkerInsertEXT", name)) { + *addr = (void *)CmdDebugMarkerInsertEXT; + return true; + } + + // ---- VK_AMD_draw_indirect_count extension commands + if (!strcmp("vkCmdDrawIndirectCountAMD", name)) { + *addr = (void *)CmdDrawIndirectCountAMD; + return true; + } + if (!strcmp("vkCmdDrawIndexedIndirectCountAMD", name)) { + *addr = (void *)CmdDrawIndexedIndirectCountAMD; + return true; + } + + // ---- VK_NV_external_memory_capabilities extension commands + if (!strcmp("vkGetPhysicalDeviceExternalImageFormatPropertiesNV", name)) { + *addr = (ptr_instance->enabled_known_extensions.nv_external_memory_capabilities == 1) + ? (void *)GetPhysicalDeviceExternalImageFormatPropertiesNV + : NULL; + return true; + } + + // ---- VK_NV_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + if (!strcmp("vkGetMemoryWin32HandleNV", name)) { + *addr = (void *)GetMemoryWin32HandleNV; + return true; + } +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHX_device_group extension commands + if (!strcmp("vkGetDeviceGroupPeerMemoryFeaturesKHX", name)) { + *addr = (void *)GetDeviceGroupPeerMemoryFeaturesKHX; + return true; + } + if (!strcmp("vkBindBufferMemory2KHX", name)) { + *addr = (void *)BindBufferMemory2KHX; + return true; + } + if (!strcmp("vkBindImageMemory2KHX", name)) { + *addr = (void *)BindImageMemory2KHX; + return true; + } + if (!strcmp("vkCmdSetDeviceMaskKHX", name)) { + *addr = (void *)CmdSetDeviceMaskKHX; + return true; + } + if (!strcmp("vkGetDeviceGroupPresentCapabilitiesKHX", name)) { + *addr = (void *)GetDeviceGroupPresentCapabilitiesKHX; + return true; + } + if (!strcmp("vkGetDeviceGroupSurfacePresentModesKHX", name)) { + *addr = (void *)GetDeviceGroupSurfacePresentModesKHX; + return true; + } + if (!strcmp("vkAcquireNextImage2KHX", name)) { + *addr = (void *)AcquireNextImage2KHX; + return true; + } + if (!strcmp("vkCmdDispatchBaseKHX", name)) { + *addr = (void *)CmdDispatchBaseKHX; + return true; + } + if (!strcmp("vkGetPhysicalDevicePresentRectanglesKHX", name)) { + *addr = (void *)GetPhysicalDevicePresentRectanglesKHX; + return true; + } + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + if (!strcmp("vkCreateViSurfaceNN", name)) { + *addr = (ptr_instance->enabled_known_extensions.nn_vi_surface == 1) + ? (void *)CreateViSurfaceNN + : NULL; + return true; + } +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + if (!strcmp("vkEnumeratePhysicalDeviceGroupsKHX", name)) { + *addr = (ptr_instance->enabled_known_extensions.khx_device_group_creation == 1) + ? (void *)EnumeratePhysicalDeviceGroupsKHX + : NULL; + return true; + } + + // ---- VK_KHX_external_memory_capabilities extension commands + if (!strcmp("vkGetPhysicalDeviceExternalBufferPropertiesKHX", name)) { + *addr = (ptr_instance->enabled_known_extensions.khx_external_memory_capabilities == 1) + ? (void *)GetPhysicalDeviceExternalBufferPropertiesKHX + : NULL; + return true; + } + + // ---- VK_KHX_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp("vkGetMemoryWin32HandleKHX", name)) { + *addr = (void *)GetMemoryWin32HandleKHX; + return true; + } +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp("vkGetMemoryWin32HandlePropertiesKHX", name)) { + *addr = (void *)GetMemoryWin32HandlePropertiesKHX; + return true; + } +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_memory_fd extension commands + if (!strcmp("vkGetMemoryFdKHX", name)) { + *addr = (void *)GetMemoryFdKHX; + return true; + } + if (!strcmp("vkGetMemoryFdPropertiesKHX", name)) { + *addr = (void *)GetMemoryFdPropertiesKHX; + return true; + } + + // ---- VK_KHX_external_semaphore_capabilities extension commands + if (!strcmp("vkGetPhysicalDeviceExternalSemaphorePropertiesKHX", name)) { + *addr = (ptr_instance->enabled_known_extensions.khx_external_semaphore_capabilities == 1) + ? (void *)GetPhysicalDeviceExternalSemaphorePropertiesKHX + : NULL; + return true; + } + + // ---- VK_KHX_external_semaphore_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp("vkImportSemaphoreWin32HandleKHX", name)) { + *addr = (void *)ImportSemaphoreWin32HandleKHX; + return true; + } +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + if (!strcmp("vkGetSemaphoreWin32HandleKHX", name)) { + *addr = (void *)GetSemaphoreWin32HandleKHX; + return true; + } +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_semaphore_fd extension commands + if (!strcmp("vkImportSemaphoreFdKHX", name)) { + *addr = (void *)ImportSemaphoreFdKHX; + return true; + } + if (!strcmp("vkGetSemaphoreFdKHX", name)) { + *addr = (void *)GetSemaphoreFdKHX; + return true; + } + + // ---- VK_NVX_device_generated_commands extension commands + if (!strcmp("vkCmdProcessCommandsNVX", name)) { + *addr = (void *)CmdProcessCommandsNVX; + return true; + } + if (!strcmp("vkCmdReserveSpaceForCommandsNVX", name)) { + *addr = (void *)CmdReserveSpaceForCommandsNVX; + return true; + } + if (!strcmp("vkCreateIndirectCommandsLayoutNVX", name)) { + *addr = (void *)CreateIndirectCommandsLayoutNVX; + return true; + } + if (!strcmp("vkDestroyIndirectCommandsLayoutNVX", name)) { + *addr = (void *)DestroyIndirectCommandsLayoutNVX; + return true; + } + if (!strcmp("vkCreateObjectTableNVX", name)) { + *addr = (void *)CreateObjectTableNVX; + return true; + } + if (!strcmp("vkDestroyObjectTableNVX", name)) { + *addr = (void *)DestroyObjectTableNVX; + return true; + } + if (!strcmp("vkRegisterObjectsNVX", name)) { + *addr = (void *)RegisterObjectsNVX; + return true; + } + if (!strcmp("vkUnregisterObjectsNVX", name)) { + *addr = (void *)UnregisterObjectsNVX; + return true; + } + if (!strcmp("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", name)) { + *addr = (void *)GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + return true; + } + + // ---- VK_NV_clip_space_w_scaling extension commands + if (!strcmp("vkCmdSetViewportWScalingNV", name)) { + *addr = (void *)CmdSetViewportWScalingNV; + return true; + } + + // ---- VK_EXT_direct_mode_display extension commands + if (!strcmp("vkReleaseDisplayEXT", name)) { + *addr = (ptr_instance->enabled_known_extensions.ext_direct_mode_display == 1) + ? (void *)ReleaseDisplayEXT + : NULL; + return true; + } + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + if (!strcmp("vkAcquireXlibDisplayEXT", name)) { + *addr = (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == 1) + ? (void *)AcquireXlibDisplayEXT + : NULL; + return true; + } +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + if (!strcmp("vkGetRandROutputDisplayEXT", name)) { + *addr = (ptr_instance->enabled_known_extensions.ext_acquire_xlib_display == 1) + ? (void *)GetRandROutputDisplayEXT + : NULL; + return true; + } +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2EXT", name)) { + *addr = (ptr_instance->enabled_known_extensions.ext_display_surface_counter == 1) + ? (void *)GetPhysicalDeviceSurfaceCapabilities2EXT + : NULL; + return true; + } + + // ---- VK_EXT_display_control extension commands + if (!strcmp("vkDisplayPowerControlEXT", name)) { + *addr = (void *)DisplayPowerControlEXT; + return true; + } + if (!strcmp("vkRegisterDeviceEventEXT", name)) { + *addr = (void *)RegisterDeviceEventEXT; + return true; + } + if (!strcmp("vkRegisterDisplayEventEXT", name)) { + *addr = (void *)RegisterDisplayEventEXT; + return true; + } + if (!strcmp("vkGetSwapchainCounterEXT", name)) { + *addr = (void *)GetSwapchainCounterEXT; + return true; + } + + // ---- VK_GOOGLE_display_timing extension commands + if (!strcmp("vkGetRefreshCycleDurationGOOGLE", name)) { + *addr = (void *)GetRefreshCycleDurationGOOGLE; + return true; + } + if (!strcmp("vkGetPastPresentationTimingGOOGLE", name)) { + *addr = (void *)GetPastPresentationTimingGOOGLE; + return true; + } + + // ---- VK_EXT_discard_rectangles extension commands + if (!strcmp("vkCmdSetDiscardRectangleEXT", name)) { + *addr = (void *)CmdSetDiscardRectangleEXT; + return true; + } + + // ---- VK_EXT_hdr_metadata extension commands + if (!strcmp("vkSetHdrMetadataEXT", name)) { + *addr = (void *)SetHdrMetadataEXT; + return true; + } + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + if (!strcmp("vkCreateIOSSurfaceMVK", name)) { + *addr = (ptr_instance->enabled_known_extensions.mvk_ios_surface == 1) + ? (void *)CreateIOSSurfaceMVK + : NULL; + return true; + } +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + if (!strcmp("vkCreateMacOSSurfaceMVK", name)) { + *addr = (ptr_instance->enabled_known_extensions.mvk_macos_surface == 1) + ? (void *)CreateMacOSSurfaceMVK + : NULL; + return true; + } +#endif // VK_USE_PLATFORM_MACOS_MVK + return false; +} + +// A function that can be used to query enabled extensions during a vkCreateInstance call +void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { + for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { + + // ---- VK_KHR_get_physical_device_properties2 extension commands + if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.khr_get_physical_device_properties2 = 1; + + // ---- VK_NV_external_memory_capabilities extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.nv_external_memory_capabilities = 1; + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NN_VI_SURFACE_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.nn_vi_surface = 1; +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.khx_device_group_creation = 1; + + // ---- VK_KHX_external_memory_capabilities extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.khx_external_memory_capabilities = 1; + + // ---- VK_KHX_external_semaphore_capabilities extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.khx_external_semaphore_capabilities = 1; + + // ---- VK_EXT_direct_mode_display extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.ext_direct_mode_display = 1; + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.ext_acquire_xlib_display = 1; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.ext_display_surface_counter = 1; + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_IOS_SURFACE_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.mvk_ios_surface = 1; +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_MACOS_SURFACE_EXTENSION_NAME)) { + ptr_instance->enabled_known_extensions.mvk_macos_surface = 1; +#endif // VK_USE_PLATFORM_MACOS_MVK + } + } +} + +// Some device commands still need a terminator because the loader needs to unwrap something about them. +// In many cases, the item needing unwrapping is a VkPhysicalDevice or VkSurfaceKHR object. But there may be other items +// in the future. +PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName) { + PFN_vkVoidFunction addr = NULL; + + // ---- VK_KHR_swapchain extension commands + if(!strcmp(pName, "vkCreateSwapchainKHR")) { + addr = (PFN_vkVoidFunction)terminator_CreateSwapchainKHR; + + // ---- VK_KHR_display_swapchain extension commands + } else if(!strcmp(pName, "vkCreateSharedSwapchainsKHR")) { + addr = (PFN_vkVoidFunction)terminator_CreateSharedSwapchainsKHR; + + // ---- VK_EXT_debug_marker extension commands + } else if(!strcmp(pName, "vkDebugMarkerSetObjectTagEXT")) { + addr = (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectTagEXT; + } else if(!strcmp(pName, "vkDebugMarkerSetObjectNameEXT")) { + addr = (PFN_vkVoidFunction)terminator_DebugMarkerSetObjectNameEXT; + + // ---- VK_KHX_device_group extension commands + } else if(!strcmp(pName, "vkGetDeviceGroupSurfacePresentModesKHX")) { + addr = (PFN_vkVoidFunction)terminator_GetDeviceGroupSurfacePresentModesKHX; + } + return addr; +} + +// This table contains the loader's instance dispatch table, which contains +// default functions if no instance layers are activated. This contains +// pointers to "terminator functions". +const VkLayerInstanceDispatchTable instance_disp = { + + // ---- Core 1_0 commands + .DestroyInstance = terminator_DestroyInstance, + .EnumeratePhysicalDevices = terminator_EnumeratePhysicalDevices, + .GetPhysicalDeviceFeatures = terminator_GetPhysicalDeviceFeatures, + .GetPhysicalDeviceFormatProperties = terminator_GetPhysicalDeviceFormatProperties, + .GetPhysicalDeviceImageFormatProperties = terminator_GetPhysicalDeviceImageFormatProperties, + .GetPhysicalDeviceProperties = terminator_GetPhysicalDeviceProperties, + .GetPhysicalDeviceQueueFamilyProperties = terminator_GetPhysicalDeviceQueueFamilyProperties, + .GetPhysicalDeviceMemoryProperties = terminator_GetPhysicalDeviceMemoryProperties, + .GetInstanceProcAddr = vkGetInstanceProcAddr, + .EnumerateDeviceExtensionProperties = terminator_EnumerateDeviceExtensionProperties, + .EnumerateDeviceLayerProperties = terminator_EnumerateDeviceLayerProperties, + .GetPhysicalDeviceSparseImageFormatProperties = terminator_GetPhysicalDeviceSparseImageFormatProperties, + + // ---- VK_KHR_surface extension commands + .DestroySurfaceKHR = terminator_DestroySurfaceKHR, + .GetPhysicalDeviceSurfaceSupportKHR = terminator_GetPhysicalDeviceSurfaceSupportKHR, + .GetPhysicalDeviceSurfaceCapabilitiesKHR = terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR, + .GetPhysicalDeviceSurfaceFormatsKHR = terminator_GetPhysicalDeviceSurfaceFormatsKHR, + .GetPhysicalDeviceSurfacePresentModesKHR = terminator_GetPhysicalDeviceSurfacePresentModesKHR, + + // ---- VK_KHR_display extension commands + .GetPhysicalDeviceDisplayPropertiesKHR = terminator_GetPhysicalDeviceDisplayPropertiesKHR, + .GetPhysicalDeviceDisplayPlanePropertiesKHR = terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR, + .GetDisplayPlaneSupportedDisplaysKHR = terminator_GetDisplayPlaneSupportedDisplaysKHR, + .GetDisplayModePropertiesKHR = terminator_GetDisplayModePropertiesKHR, + .CreateDisplayModeKHR = terminator_CreateDisplayModeKHR, + .GetDisplayPlaneCapabilitiesKHR = terminator_GetDisplayPlaneCapabilitiesKHR, + .CreateDisplayPlaneSurfaceKHR = terminator_CreateDisplayPlaneSurfaceKHR, + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + .CreateXlibSurfaceKHR = terminator_CreateXlibSurfaceKHR, +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + .GetPhysicalDeviceXlibPresentationSupportKHR = terminator_GetPhysicalDeviceXlibPresentationSupportKHR, +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + .CreateXcbSurfaceKHR = terminator_CreateXcbSurfaceKHR, +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + .GetPhysicalDeviceXcbPresentationSupportKHR = terminator_GetPhysicalDeviceXcbPresentationSupportKHR, +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + .CreateWaylandSurfaceKHR = terminator_CreateWaylandSurfaceKHR, +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + .GetPhysicalDeviceWaylandPresentationSupportKHR = terminator_GetPhysicalDeviceWaylandPresentationSupportKHR, +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + .CreateMirSurfaceKHR = terminator_CreateMirSurfaceKHR, +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + .GetPhysicalDeviceMirPresentationSupportKHR = terminator_GetPhysicalDeviceMirPresentationSupportKHR, +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + .CreateAndroidSurfaceKHR = terminator_CreateAndroidSurfaceKHR, +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + .CreateWin32SurfaceKHR = terminator_CreateWin32SurfaceKHR, +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + .GetPhysicalDeviceWin32PresentationSupportKHR = terminator_GetPhysicalDeviceWin32PresentationSupportKHR, +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + .GetPhysicalDeviceFeatures2KHR = terminator_GetPhysicalDeviceFeatures2KHR, + .GetPhysicalDeviceProperties2KHR = terminator_GetPhysicalDeviceProperties2KHR, + .GetPhysicalDeviceFormatProperties2KHR = terminator_GetPhysicalDeviceFormatProperties2KHR, + .GetPhysicalDeviceImageFormatProperties2KHR = terminator_GetPhysicalDeviceImageFormatProperties2KHR, + .GetPhysicalDeviceQueueFamilyProperties2KHR = terminator_GetPhysicalDeviceQueueFamilyProperties2KHR, + .GetPhysicalDeviceMemoryProperties2KHR = terminator_GetPhysicalDeviceMemoryProperties2KHR, + .GetPhysicalDeviceSparseImageFormatProperties2KHR = terminator_GetPhysicalDeviceSparseImageFormatProperties2KHR, + + // ---- VK_EXT_debug_report extension commands + .CreateDebugReportCallbackEXT = terminator_CreateDebugReportCallbackEXT, + .DestroyDebugReportCallbackEXT = terminator_DestroyDebugReportCallbackEXT, + .DebugReportMessageEXT = terminator_DebugReportMessageEXT, + + // ---- VK_NV_external_memory_capabilities extension commands + .GetPhysicalDeviceExternalImageFormatPropertiesNV = terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV, + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + .CreateViSurfaceNN = terminator_CreateViSurfaceNN, +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + .EnumeratePhysicalDeviceGroupsKHX = terminator_EnumeratePhysicalDeviceGroupsKHX, + + // ---- VK_KHX_external_memory_capabilities extension commands + .GetPhysicalDeviceExternalBufferPropertiesKHX = terminator_GetPhysicalDeviceExternalBufferPropertiesKHX, + + // ---- VK_KHX_external_semaphore_capabilities extension commands + .GetPhysicalDeviceExternalSemaphorePropertiesKHX = terminator_GetPhysicalDeviceExternalSemaphorePropertiesKHX, + + // ---- VK_EXT_direct_mode_display extension commands + .ReleaseDisplayEXT = terminator_ReleaseDisplayEXT, + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + .AcquireXlibDisplayEXT = terminator_AcquireXlibDisplayEXT, +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + .GetRandROutputDisplayEXT = terminator_GetRandROutputDisplayEXT, +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + .GetPhysicalDeviceSurfaceCapabilities2EXT = terminator_GetPhysicalDeviceSurfaceCapabilities2EXT, + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + .CreateIOSSurfaceMVK = terminator_CreateIOSSurfaceMVK, +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + .CreateMacOSSurfaceMVK = terminator_CreateMacOSSurfaceMVK, +#endif // VK_USE_PLATFORM_MACOS_MVK +}; + +// A null-terminated list of all of the instance extensions supported by the loader. +// If an instance extension name is not in this list, but it is exported by one or more of the +// ICDs detected by the loader, then the extension name not in the list will be filtered out +// before passing the list of extensions to the application. +const char *const LOADER_INSTANCE_EXTENSIONS[] = { + VK_KHR_SURFACE_EXTENSION_NAME, + VK_KHR_DISPLAY_EXTENSION_NAME, +#ifdef VK_USE_PLATFORM_XLIB_KHR + VK_KHR_XLIB_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + VK_KHR_XCB_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + VK_KHR_MIR_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + VK_KHR_WIN32_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_WIN32_KHR + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, + VK_EXT_DEBUG_REPORT_EXTENSION_NAME, + VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, + VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME, +#ifdef VK_USE_PLATFORM_VI_NN + VK_NN_VI_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_VI_NN + VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME, + VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, + VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, + VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, + VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, +#ifdef VK_USE_PLATFORM_IOS_MVK + VK_MVK_IOS_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_IOS_MVK +#ifdef VK_USE_PLATFORM_MACOS_MVK + VK_MVK_MACOS_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_MACOS_MVK + NULL }; + diff --git a/third_party/vulkan/loader/vk_loader_extensions.h b/third_party/vulkan/loader/vk_loader_extensions.h new file mode 100644 index 000000000..b8700250f --- /dev/null +++ b/third_party/vulkan/loader/vk_loader_extensions.h @@ -0,0 +1,328 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See loader_extension_generator.py for modifications + +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Mark Lobodzinski + * Author: Mark Young + */ + +#pragma once + +// Structures defined externally, but used here +struct loader_instance; +struct loader_icd_term; +struct loader_dev_dispatch_table; + +// Device extension error function +VKAPI_ATTR VkResult VKAPI_CALL vkDevExtError(VkDevice dev); + +// Extension interception for vkGetInstanceProcAddr function, so we can return +// the appropriate information for any instance extensions we know about. +bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); + +// Extension interception for vkCreateInstance function, so we can properly +// detect and enable any instance extension information for extensions we know +// about. +void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); + +// Extension interception for vkGetDeviceProcAddr function, so we can return +// an appropriate terminator if this is one of those few device commands requiring +// a terminator. +PFN_vkVoidFunction get_extension_device_proc_terminator(const char *pName); + +// Dispatch table properly filled in with appropriate terminators for the +// supported extensions. +extern const VkLayerInstanceDispatchTable instance_disp; + +// Array of extension strings for instance extensions we support. +extern const char *const LOADER_INSTANCE_EXTENSIONS[]; + +VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst, + const PFN_vkGetInstanceProcAddr fp_gipa); + +// Init Device function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa, + VkDevice dev); + +// Init Device function pointer dispatch table with extension commands +VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct loader_dev_dispatch_table *dev_table, + PFN_vkGetDeviceProcAddr gpa, VkDevice dev); + +// Init Instance function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, + VkInstance inst); + +// Init Instance function pointer dispatch table with core commands +VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, + VkInstance inst); + +// Device command lookup function +VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, const char *name); + +// Instance command lookup function +VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, const char *name, + bool *found_name); + +VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_term, VkInstance inst, + const PFN_vkGetInstanceProcAddr fp_gipa); + +// Loader core instance terminators +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( + const VkInstanceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkInstance* pInstance); +VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance( + VkInstance instance, + const VkAllocationCallbacks* pAllocator); +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDevices( + VkInstance instance, + uint32_t* pPhysicalDeviceCount, + VkPhysicalDevice* pPhysicalDevices); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFeatures( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures* pFeatures); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties* pFormatProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkImageTiling tiling, + VkImageUsageFlags usage, + VkImageCreateFlags flags, + VkImageFormatProperties* pImageFormatProperties); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties* pProperties); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pQueueFamilyPropertyCount, + VkQueueFamilyProperties* pQueueFamilyProperties); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties* pMemoryProperties); +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL terminator_GetInstanceProcAddr( + VkInstance instance, + const char* pName); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice( + VkPhysicalDevice physicalDevice, + const VkDeviceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDevice* pDevice); +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceExtensionProperties( + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties( + VkPhysicalDevice physicalDevice, + const char* pLayerName, + uint32_t* pPropertyCount, + VkExtensionProperties* pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceLayerProperties( + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceLayerProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkLayerProperties* pProperties); +VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceSparseImageFormatProperties( + VkPhysicalDevice physicalDevice, + VkFormat format, + VkImageType type, + VkSampleCountFlagBits samples, + VkImageUsageFlags usage, + VkImageTiling tiling, + uint32_t* pPropertyCount, + VkSparseImageFormatProperties* pProperties); + +// ICD function pointer dispatch table +struct loader_icd_term_dispatch { + + // ---- Core 1_0 commands + PFN_vkCreateInstance CreateInstance; + PFN_vkDestroyInstance DestroyInstance; + PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; + PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; + PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; + PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; + PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; + PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; + PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; + PFN_vkGetDeviceProcAddr GetDeviceProcAddr; + PFN_vkCreateDevice CreateDevice; + PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; + PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; + PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; + + // ---- VK_KHR_surface extension commands + PFN_vkDestroySurfaceKHR DestroySurfaceKHR; + PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; + PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; + PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; + PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; + + // ---- VK_KHR_swapchain extension commands + PFN_vkCreateSwapchainKHR CreateSwapchainKHR; + + // ---- VK_KHR_display extension commands + PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR; + PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR; + PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR; + PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR; + PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR; + PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR; + PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR; + + // ---- VK_KHR_display_swapchain extension commands + PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR; +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR; +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; + PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; + PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR; + PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR; + PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR; + + // ---- VK_EXT_debug_report extension commands + PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; + PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; + PFN_vkDebugReportMessageEXT DebugReportMessageEXT; + + // ---- VK_EXT_debug_marker extension commands + PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; + PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; + + // ---- VK_NV_external_memory_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV; + + // ---- VK_KHX_device_group extension commands + PFN_vkGetDeviceGroupSurfacePresentModesKHX GetDeviceGroupSurfacePresentModesKHX; + PFN_vkGetPhysicalDevicePresentRectanglesKHX GetPhysicalDevicePresentRectanglesKHX; + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + PFN_vkCreateViSurfaceNN CreateViSurfaceNN; +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + PFN_vkEnumeratePhysicalDeviceGroupsKHX EnumeratePhysicalDeviceGroupsKHX; + + // ---- VK_KHX_external_memory_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX GetPhysicalDeviceExternalBufferPropertiesKHX; + + // ---- VK_KHX_external_semaphore_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX GetPhysicalDeviceExternalSemaphorePropertiesKHX; + + // ---- VK_NVX_device_generated_commands extension commands + PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + + // ---- VK_EXT_direct_mode_display extension commands + PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT; + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + PFN_vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK; +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + PFN_vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK; +#endif // VK_USE_PLATFORM_MACOS_MVK +}; + +union loader_instance_extension_enables { + struct { + uint8_t khr_get_physical_device_properties2 : 1; + uint8_t ext_debug_report : 1; + uint8_t nv_external_memory_capabilities : 1; + uint8_t nn_vi_surface : 1; + uint8_t khx_device_group_creation : 1; + uint8_t khx_external_memory_capabilities : 1; + uint8_t khx_external_semaphore_capabilities : 1; + uint8_t ext_direct_mode_display : 1; + uint8_t ext_acquire_xlib_display : 1; + uint8_t ext_display_surface_counter : 1; + uint8_t mvk_ios_surface : 1; + uint8_t mvk_macos_surface : 1; + }; + uint64_t padding[4]; +}; + + diff --git a/third_party/vulkan/loader/vk_loader_layer.h b/third_party/vulkan/loader/vk_loader_layer.h index 2207c029d..425154d82 100644 --- a/third_party/vulkan/loader/vk_loader_layer.h +++ b/third_party/vulkan/loader/vk_loader_layer.h @@ -29,4 +29,3 @@ typedef struct VkLayerDbgFunctionNode_ { void *pUserData; struct VkLayerDbgFunctionNode_ *pNext; } VkLayerDbgFunctionNode; - diff --git a/third_party/vulkan/loader/vk_loader_platform.h b/third_party/vulkan/loader/vk_loader_platform.h index dc4ac1091..436f3b48b 100644 --- a/third_party/vulkan/loader/vk_loader_platform.h +++ b/third_party/vulkan/loader/vk_loader_platform.h @@ -25,7 +25,7 @@ #if defined(_WIN32) // WinSock2.h must be included *BEFORE* windows.h #include -#endif // _WIN32 +#endif // _WIN32 #include "vulkan/vk_platform.h" #include "vulkan/vk_sdk_platform.h" @@ -50,54 +50,16 @@ #define PATH_SEPARATOR ':' #define DIRECTORY_SYMBOL '/' -#define VULKAN_DIR "/vulkan/" -#define VULKAN_ICDCONF_DIR "icd.d" -#define VULKAN_ICD_DIR "icd" +#define VULKAN_DIR "/vulkan/" +#define VULKAN_ICDCONF_DIR "icd.d" +#define VULKAN_ICD_DIR "icd" #define VULKAN_ELAYERCONF_DIR "explicit_layer.d" #define VULKAN_ILAYERCONF_DIR "implicit_layer.d" -#define VULKAN_LAYER_DIR "layer" +#define VULKAN_LAYER_DIR "layer" -#if defined(EXTRASYSCONFDIR) -#define EXTRA_DRIVERS_SYSCONFDIR_INFO ":" \ - EXTRASYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR -#define EXTRA_ELAYERS_SYSCONFDIR_INFO ":" \ - EXTRASYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR -#define EXTRA_ILAYERS_SYSCONFDIR_INFO ":" \ - EXTRASYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR -#else -#define EXTRA_DRIVERS_SYSCONFDIR_INFO -#define EXTRA_ELAYERS_SYSCONFDIR_INFO -#define EXTRA_ILAYERS_SYSCONFDIR_INFO -#endif - -#if defined(EXTRADATADIR) -#define EXTRA_DRIVERS_DATADIR_INFO ":" \ - EXTRADATADIR VULKAN_DIR VULKAN_ICDCONF_DIR -#define EXTRA_ELAYERS_DATADIR_INFO ":" \ - EXTRADATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR -#define EXTRA_ILAYERS_DATADIR_INFO ":" \ - EXTRADATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR -#else -#define EXTRA_DRIVERS_DATADIR_INFO -#define EXTRA_ELAYERS_DATADIR_INFO -#define EXTRA_ILAYERS_DATADIR_INFO -#endif - -#define DEFAULT_VK_DRIVERS_INFO \ - SYSCONFDIR VULKAN_DIR VULKAN_ICDCONF_DIR ":" \ - DATADIR VULKAN_DIR VULKAN_ICDCONF_DIR \ - EXTRA_DRIVERS_SYSCONFDIR_INFO \ - EXTRA_DRIVERS_DATADIR_INFO -#define DEFAULT_VK_ELAYERS_INFO \ - SYSCONFDIR VULKAN_DIR VULKAN_ELAYERCONF_DIR ":" \ - DATADIR VULKAN_DIR VULKAN_ELAYERCONF_DIR \ - EXTRA_ELAYERS_SYSCONFDIR_INFO \ - EXTRA_ELAYERS_DATADIR_INFO -#define DEFAULT_VK_ILAYERS_INFO \ - SYSCONFDIR VULKAN_DIR VULKAN_ILAYERCONF_DIR ":" \ - DATADIR VULKAN_DIR VULKAN_ILAYERCONF_DIR \ - EXTRA_ILAYERS_SYSCONFDIR_INFO \ - EXTRA_ILAYERS_DATADIR_INFO +#define DEFAULT_VK_DRIVERS_INFO "" +#define DEFAULT_VK_ELAYERS_INFO "" +#define DEFAULT_VK_ILAYERS_INFO "" #define DEFAULT_VK_DRIVERS_PATH "" #if !defined(DEFAULT_VK_LAYERS_PATH) @@ -109,9 +71,9 @@ #endif #define LAYERS_PATH_ENV "VK_LAYER_PATH" -#define HOME_VK_DRIVERS_INFO VULKAN_DIR VULKAN_ICDCONF_DIR -#define HOME_VK_ELAYERS_INFO VULKAN_DIR VULKAN_ELAYERCONF_DIR -#define HOME_VK_ILAYERS_INFO VULKAN_DIR VULKAN_ILAYERCONF_DIR +#define RELATIVE_VK_DRIVERS_INFO VULKAN_DIR VULKAN_ICDCONF_DIR +#define RELATIVE_VK_ELAYERS_INFO VULKAN_DIR VULKAN_ELAYERCONF_DIR +#define RELATIVE_VK_ILAYERS_INFO VULKAN_DIR VULKAN_ILAYERCONF_DIR // C99: #define PRINTF_SIZE_T_SPECIFIER "%zu" @@ -131,44 +93,28 @@ static inline bool loader_platform_is_path_absolute(const char *path) { return false; } -static inline char *loader_platform_dirname(char *path) { - return dirname(path); -} +static inline char *loader_platform_dirname(char *path) { return dirname(path); } // Dynamic Loading of libraries: typedef void *loader_platform_dl_handle; -static inline loader_platform_dl_handle -loader_platform_open_library(const char *libPath) { +static inline loader_platform_dl_handle loader_platform_open_library(const char *libPath) { return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL); } -static inline const char * -loader_platform_open_library_error(const char *libPath) { - return dlerror(); -} -static inline void -loader_platform_close_library(loader_platform_dl_handle library) { - dlclose(library); -} -static inline void * -loader_platform_get_proc_address(loader_platform_dl_handle library, - const char *name) { +static inline const char *loader_platform_open_library_error(const char *libPath) { return dlerror(); } +static inline void loader_platform_close_library(loader_platform_dl_handle library) { dlclose(library); } +static inline void *loader_platform_get_proc_address(loader_platform_dl_handle library, const char *name) { assert(library); assert(name); return dlsym(library, name); } -static inline const char * -loader_platform_get_proc_address_error(const char *name) { - return dlerror(); -} +static inline const char *loader_platform_get_proc_address_error(const char *name) { return dlerror(); } // Threads: typedef pthread_t loader_platform_thread; #define THREAD_LOCAL_DECL __thread -#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) \ - pthread_once_t var = PTHREAD_ONCE_INIT; +#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) pthread_once_t var = PTHREAD_ONCE_INIT; #define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) pthread_once_t var; -static inline void loader_platform_thread_once(pthread_once_t *ctl, - void (*func)(void)) { +static inline void loader_platform_thread_once(pthread_once_t *ctl, void (*func)(void)) { assert(func != NULL); assert(ctl != NULL); pthread_once(ctl, func); @@ -176,46 +122,24 @@ static inline void loader_platform_thread_once(pthread_once_t *ctl, // Thread IDs: typedef pthread_t loader_platform_thread_id; -static inline loader_platform_thread_id loader_platform_get_thread_id() { - return pthread_self(); -} +static inline loader_platform_thread_id loader_platform_get_thread_id() { return pthread_self(); } // Thread mutex: typedef pthread_mutex_t loader_platform_thread_mutex; -static inline void -loader_platform_thread_create_mutex(loader_platform_thread_mutex *pMutex) { - pthread_mutex_init(pMutex, NULL); -} -static inline void -loader_platform_thread_lock_mutex(loader_platform_thread_mutex *pMutex) { - pthread_mutex_lock(pMutex); -} -static inline void -loader_platform_thread_unlock_mutex(loader_platform_thread_mutex *pMutex) { - pthread_mutex_unlock(pMutex); -} -static inline void -loader_platform_thread_delete_mutex(loader_platform_thread_mutex *pMutex) { - pthread_mutex_destroy(pMutex); -} +static inline void loader_platform_thread_create_mutex(loader_platform_thread_mutex *pMutex) { pthread_mutex_init(pMutex, NULL); } +static inline void loader_platform_thread_lock_mutex(loader_platform_thread_mutex *pMutex) { pthread_mutex_lock(pMutex); } +static inline void loader_platform_thread_unlock_mutex(loader_platform_thread_mutex *pMutex) { pthread_mutex_unlock(pMutex); } +static inline void loader_platform_thread_delete_mutex(loader_platform_thread_mutex *pMutex) { pthread_mutex_destroy(pMutex); } typedef pthread_cond_t loader_platform_thread_cond; -static inline void -loader_platform_thread_init_cond(loader_platform_thread_cond *pCond) { - pthread_cond_init(pCond, NULL); -} -static inline void -loader_platform_thread_cond_wait(loader_platform_thread_cond *pCond, - loader_platform_thread_mutex *pMutex) { +static inline void loader_platform_thread_init_cond(loader_platform_thread_cond *pCond) { pthread_cond_init(pCond, NULL); } +static inline void loader_platform_thread_cond_wait(loader_platform_thread_cond *pCond, loader_platform_thread_mutex *pMutex) { pthread_cond_wait(pCond, pMutex); } -static inline void -loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { - pthread_cond_broadcast(pCond); -} +static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { pthread_cond_broadcast(pCond); } #define loader_stack_alloc(size) alloca(size) -#elif defined(_WIN32) // defined(__linux__) +#elif defined(_WIN32) // defined(__linux__) /* Windows-specific common code: */ // WinBase.h defines CreateSemaphore and synchapi.h defines CreateEvent // undefine them to avoid conflicts with VkLayerDispatchTable struct members. @@ -234,12 +158,15 @@ loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { #ifdef __cplusplus #include #include -#endif // __cplusplus +#endif // __cplusplus // VK Library Filenames, Paths, etc.: #define PATH_SEPARATOR ';' #define DIRECTORY_SYMBOL '\\' #define DEFAULT_VK_REGISTRY_HIVE HKEY_LOCAL_MACHINE +#define DEFAULT_VK_REGISTRY_HIVE_STR "HKEY_LOCAL_MACHINE" +#define SECONDARY_VK_REGISTRY_HIVE HKEY_CURRENT_USER +#define SECONDARY_VK_REGISTRY_HIVE_STR "HKEY_CURRENT_USER" #define DEFAULT_VK_DRIVERS_INFO "SOFTWARE\\Khronos\\" API_NAME "\\Drivers" #define DEFAULT_VK_DRIVERS_PATH "" #define DEFAULT_VK_ELAYERS_INFO "SOFTWARE\\Khronos\\" API_NAME "\\ExplicitLayers" @@ -251,9 +178,9 @@ loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { #define LAYERS_SOURCE_PATH NULL #endif #define LAYERS_PATH_ENV "VK_LAYER_PATH" -#define HOME_VK_DRIVERS_INFO "" -#define HOME_VK_ELAYERS_INFO "" -#define HOME_VK_ILAYERS_INFO "" +#define RELATIVE_VK_DRIVERS_INFO "" +#define RELATIVE_VK_ELAYERS_INFO "" +#define RELATIVE_VK_ILAYERS_INFO "" #define PRINTF_SIZE_T_SPECIFIER "%Iu" // File IO @@ -264,9 +191,7 @@ static bool loader_platform_file_exists(const char *path) { return true; } -static bool loader_platform_is_path_absolute(const char *path) { - return !PathIsRelative(path); -} +static bool loader_platform_is_path_absolute(const char *path) { return !PathIsRelative(path); } // WIN32 runtime doesn't have dirname(). static inline char *loader_platform_dirname(char *path) { @@ -277,8 +202,7 @@ static inline char *loader_platform_dirname(char *path) { for (current = path; *current != '\0'; current = next) { next = strchr(current, DIRECTORY_SYMBOL); if (next == NULL) { - if (current != path) - *(current - 1) = '\0'; + if (current != path) *(current - 1) = '\0'; return path; } else { // Point one character past the DIRECTORY_SYMBOL: @@ -315,40 +239,30 @@ static char *loader_platform_basename(char *pathname) { // Dynamic Loading: typedef HMODULE loader_platform_dl_handle; -static loader_platform_dl_handle -loader_platform_open_library(const char *libPath) { - return LoadLibrary(libPath); -} +static loader_platform_dl_handle loader_platform_open_library(const char *libPath) { return LoadLibrary(libPath); } static char *loader_platform_open_library_error(const char *libPath) { static char errorMsg[164]; - (void)snprintf(errorMsg, 163, "Failed to open dynamic library \"%s\"", - libPath); + (void)snprintf(errorMsg, 163, "Failed to open dynamic library \"%s\"", libPath); return errorMsg; } -static void loader_platform_close_library(loader_platform_dl_handle library) { - FreeLibrary(library); -} -static void *loader_platform_get_proc_address(loader_platform_dl_handle library, - const char *name) { +static void loader_platform_close_library(loader_platform_dl_handle library) { FreeLibrary(library); } +static void *loader_platform_get_proc_address(loader_platform_dl_handle library, const char *name) { assert(library); assert(name); return GetProcAddress(library, name); } static char *loader_platform_get_proc_address_error(const char *name) { static char errorMsg[120]; - (void)snprintf(errorMsg, 119, - "Failed to find function \"%s\" in dynamic library", name); + (void)snprintf(errorMsg, 119, "Failed to find function \"%s\" in dynamic library", name); return errorMsg; } // Threads: typedef HANDLE loader_platform_thread; #define THREAD_LOCAL_DECL __declspec(thread) -#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) \ - INIT_ONCE var = INIT_ONCE_STATIC_INIT; +#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) INIT_ONCE var = INIT_ONCE_STATIC_INIT; #define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) INIT_ONCE var; -static BOOL CALLBACK -InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { +static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { void (*func)(void) = (void (*)(void))Parameter; func(); return TRUE; @@ -362,49 +276,23 @@ static void loader_platform_thread_once(void *ctl, void (*func)(void)) { // Thread IDs: typedef DWORD loader_platform_thread_id; -static loader_platform_thread_id loader_platform_get_thread_id() { - return GetCurrentThreadId(); -} +static loader_platform_thread_id loader_platform_get_thread_id() { return GetCurrentThreadId(); } // Thread mutex: typedef CRITICAL_SECTION loader_platform_thread_mutex; -static void -loader_platform_thread_create_mutex(loader_platform_thread_mutex *pMutex) { - InitializeCriticalSection(pMutex); -} -static void -loader_platform_thread_lock_mutex(loader_platform_thread_mutex *pMutex) { - EnterCriticalSection(pMutex); -} -static void -loader_platform_thread_unlock_mutex(loader_platform_thread_mutex *pMutex) { - LeaveCriticalSection(pMutex); -} -static void -loader_platform_thread_delete_mutex(loader_platform_thread_mutex *pMutex) { - DeleteCriticalSection(pMutex); -} +static void loader_platform_thread_create_mutex(loader_platform_thread_mutex *pMutex) { InitializeCriticalSection(pMutex); } +static void loader_platform_thread_lock_mutex(loader_platform_thread_mutex *pMutex) { EnterCriticalSection(pMutex); } +static void loader_platform_thread_unlock_mutex(loader_platform_thread_mutex *pMutex) { LeaveCriticalSection(pMutex); } +static void loader_platform_thread_delete_mutex(loader_platform_thread_mutex *pMutex) { DeleteCriticalSection(pMutex); } typedef CONDITION_VARIABLE loader_platform_thread_cond; -static void -loader_platform_thread_init_cond(loader_platform_thread_cond *pCond) { - InitializeConditionVariable(pCond); -} -static void -loader_platform_thread_cond_wait(loader_platform_thread_cond *pCond, - loader_platform_thread_mutex *pMutex) { +static void loader_platform_thread_init_cond(loader_platform_thread_cond *pCond) { InitializeConditionVariable(pCond); } +static void loader_platform_thread_cond_wait(loader_platform_thread_cond *pCond, loader_platform_thread_mutex *pMutex) { SleepConditionVariableCS(pCond, pMutex, INFINITE); } -static void -loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { - WakeAllConditionVariable(pCond); -} - -// Windows Registry: -char *loader_get_registry_string(const HKEY hive, const LPCTSTR sub_key, - const char *value); +static void loader_platform_thread_cond_broadcast(loader_platform_thread_cond *pCond) { WakeAllConditionVariable(pCond); } #define loader_stack_alloc(size) _alloca(size) -#else // defined(_WIN32) +#else // defined(_WIN32) #error The "loader_platform.h" file must be modified for this OS. @@ -415,10 +303,8 @@ char *loader_get_registry_string(const HKEY hive, const LPCTSTR sub_key, // NOTE: Other OS-specific changes are also needed for this OS. Search for // files with "WIN32" in it, as a quick way to find files that must be changed. -#endif // defined(_WIN32) +#endif // defined(_WIN32) // returns true if the given string appears to be a relative or absolute // path, as opposed to a bare filename. -static inline bool loader_platform_is_path(const char *path) { - return strchr(path, DIRECTORY_SYMBOL) != NULL; -} +static inline bool loader_platform_is_path(const char *path) { return strchr(path, DIRECTORY_SYMBOL) != NULL; } diff --git a/third_party/vulkan/loader/wsi.c b/third_party/vulkan/loader/wsi.c index b2e96f8dd..131ca5184 100644 --- a/third_party/vulkan/loader/wsi.c +++ b/third_party/vulkan/loader/wsi.c @@ -34,81 +34,72 @@ // the ICDs. #define ICD_VER_SUPPORTS_ICD_SURFACE_KHR 3 -void wsi_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo) { +void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { ptr_instance->wsi_surface_enabled = false; #ifdef VK_USE_PLATFORM_WIN32_KHR ptr_instance->wsi_win32_surface_enabled = false; -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_MIR_KHR ptr_instance->wsi_mir_surface_enabled = false; -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR ptr_instance->wsi_wayland_surface_enabled = false; -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XCB_KHR ptr_instance->wsi_xcb_surface_enabled = false; -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR ptr_instance->wsi_xlib_surface_enabled = false; -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR ptr_instance->wsi_android_surface_enabled = false; -#endif // VK_USE_PLATFORM_ANDROID_KHR +#endif // VK_USE_PLATFORM_ANDROID_KHR ptr_instance->wsi_display_enabled = false; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_surface_enabled = true; continue; } #ifdef VK_USE_PLATFORM_WIN32_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_win32_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_MIR_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_MIR_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MIR_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_mir_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_wayland_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XCB_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_xcb_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_xlib_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_android_surface_enabled = true; continue; } -#endif // VK_USE_PLATFORM_ANDROID_KHR - if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], - VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { +#endif // VK_USE_PLATFORM_ANDROID_KHR + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { ptr_instance->wsi_display_enabled = true; continue; } @@ -126,21 +117,17 @@ void wsi_create_instance(struct loader_instance *ptr_instance, // built to support the extension. bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop) { #ifndef VK_USE_PLATFORM_MIR_KHR - if (!strcmp(ext_prop->extensionName, "VK_KHR_mir_surface")) - return true; -#endif // VK_USE_PLATFORM_MIR_KHR + if (!strcmp(ext_prop->extensionName, "VK_KHR_mir_surface")) return true; +#endif // VK_USE_PLATFORM_MIR_KHR #ifndef VK_USE_PLATFORM_WAYLAND_KHR - if (!strcmp(ext_prop->extensionName, "VK_KHR_wayland_surface")) - return true; -#endif // VK_USE_PLATFORM_WAYLAND_KHR + if (!strcmp(ext_prop->extensionName, "VK_KHR_wayland_surface")) return true; +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifndef VK_USE_PLATFORM_XCB_KHR - if (!strcmp(ext_prop->extensionName, "VK_KHR_xcb_surface")) - return true; -#endif // VK_USE_PLATFORM_XCB_KHR + if (!strcmp(ext_prop->extensionName, "VK_KHR_xcb_surface")) return true; +#endif // VK_USE_PLATFORM_XCB_KHR #ifndef VK_USE_PLATFORM_XLIB_KHR - if (!strcmp(ext_prop->extensionName, "VK_KHR_xlib_surface")) - return true; -#endif // VK_USE_PLATFORM_XLIB_KHR + if (!strcmp(ext_prop->extensionName, "VK_KHR_xlib_surface")) return true; +#endif // VK_USE_PLATFORM_XLIB_KHR return false; } @@ -148,9 +135,8 @@ bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop) { // Functions for the VK_KHR_surface extension: // This is the trampoline entrypoint for DestroySurfaceKHR -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, + const VkAllocationCallbacks *pAllocator) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); disp->DestroySurfaceKHR(instance, surface, pAllocator); @@ -159,37 +145,28 @@ vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, // TODO probably need to lock around all the loader_get_instance() calls. // This is the instance chain terminator function for DestroySurfaceKHR -VKAPI_ATTR void VKAPI_CALL -terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, - const VkAllocationCallbacks *pAllocator) { +VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, + const VkAllocationCallbacks *pAllocator) { struct loader_instance *ptr_instance = loader_get_instance(instance); VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; if (NULL != icd_surface) { if (NULL != icd_surface->real_icd_surfaces) { uint32_t i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->DestroySurfaceKHR && - (VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[i]) { - icd_term->DestroySurfaceKHR( - icd_term->instance, - icd_surface->real_icd_surfaces[i], pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.DestroySurfaceKHR && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[i]) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, icd_surface->real_icd_surfaces[i], pAllocator); icd_surface->real_icd_surfaces[i] = (VkSurfaceKHR)NULL; } } else { // The real_icd_surface for any ICD not supporting the // proper interface version should be NULL. If not, then // we have a problem. - assert((VkSurfaceKHR)NULL == - icd_surface->real_icd_surfaces[i]); + assert((VkSurfaceKHR)NULL == icd_surface->real_icd_surfaces[i]); } } - loader_instance_heap_free(ptr_instance, - icd_surface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, icd_surface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, (void *)(uintptr_t)surface); @@ -197,343 +174,285 @@ terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, } // This is the trampoline entrypoint for GetPhysicalDeviceSurfaceSupportKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - VkSurfaceKHR surface, - VkBool32 *pSupported) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, VkSurfaceKHR surface, + VkBool32 *pSupported) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceSurfaceSupportKHR( - unwrapped_phys_dev, queueFamilyIndex, surface, pSupported); + VkResult res = disp->GetPhysicalDeviceSurfaceSupportKHR(unwrapped_phys_dev, queueFamilyIndex, surface, pSupported); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceSurfaceSupportKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - VkSurfaceKHR surface, VkBool32 *pSupported) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, VkSurfaceKHR surface, + VkBool32 *pSupported) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceSupportKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pSupported && - "GetPhysicalDeviceSurfaceSupportKHR: Error, null pSupported"); + if (NULL == pSupported) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceSupportKHR for pSupported!\n"); + assert(false && "GetPhysicalDeviceSurfaceSupportKHR: Error, null pSupported"); + } *pSupported = false; - assert(icd_term->GetPhysicalDeviceSurfaceSupportKHR && - "loader: null GetPhysicalDeviceSurfaceSupportKHR ICD pointer"); - - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; - if (NULL != icd_surface->real_icd_surfaces && - (VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], - pSupported); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceSupportKHR ICD pointer"); } - return icd_term->GetPhysicalDeviceSurfaceSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, surface, pSupported); + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { + return icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR( + phys_dev_term->phys_dev, queueFamilyIndex, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pSupported); + } + + return icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, surface, pSupported); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfaceCapabilitiesKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { - +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR( + VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceSurfaceCapabilitiesKHR( - unwrapped_phys_dev, surface, pSurfaceCapabilities); + VkResult res = disp->GetPhysicalDeviceSurfaceCapabilitiesKHR(unwrapped_phys_dev, surface, pSurfaceCapabilities); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceSurfaceCapabilitiesKHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pSurfaceCapabilities && "GetPhysicalDeviceSurfaceCapabilitiesKHR: " - "Error, null pSurfaceCapabilities"); - - assert(icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR && - "loader: null GetPhysicalDeviceSurfaceCapabilitiesKHR ICD pointer"); - - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; - if (NULL != icd_surface->real_icd_surfaces && - (VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR( - phys_dev_term->phys_dev, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], - pSurfaceCapabilities); + if (NULL == pSurfaceCapabilities) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceCapabilitiesKHR for pSurfaceCapabilities!\n"); + assert(false && "GetPhysicalDeviceSurfaceCapabilitiesKHR: Error, null pSurfaceCapabilities"); } - return icd_term->GetPhysicalDeviceSurfaceCapabilitiesKHR( - phys_dev_term->phys_dev, surface, pSurfaceCapabilities); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceCapabilitiesKHR ICD pointer"); + } + + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR( + phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pSurfaceCapabilities); + } + + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, pSurfaceCapabilities); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfaceFormatsKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t *pSurfaceFormatCount, - VkSurfaceFormatKHR *pSurfaceFormats) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t *pSurfaceFormatCount, + VkSurfaceFormatKHR *pSurfaceFormats) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceSurfaceFormatsKHR( - unwrapped_phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats); + VkResult res = disp->GetPhysicalDeviceSurfaceFormatsKHR(unwrapped_phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceSurfaceFormatsKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, + uint32_t *pSurfaceFormatCount, + VkSurfaceFormatKHR *pSurfaceFormats) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfaceFormatsKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceFormatsKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert( - pSurfaceFormatCount && - "GetPhysicalDeviceSurfaceFormatsKHR: Error, null pSurfaceFormatCount"); - - assert(icd_term->GetPhysicalDeviceSurfaceFormatsKHR && - "loader: null GetPhysicalDeviceSurfaceFormatsKHR ICD pointer"); - - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; - if (NULL != icd_surface->real_icd_surfaces && - (VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfaceFormatsKHR( - phys_dev_term->phys_dev, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], - pSurfaceFormatCount, pSurfaceFormats); + if (NULL == pSurfaceFormatCount) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfaceFormatsKHR for pSurfaceFormatCount!\n"); + assert(false && "GetPhysicalDeviceSurfaceFormatsKHR(: Error, null pSurfaceFormatCount"); } - return icd_term->GetPhysicalDeviceSurfaceFormatsKHR( - phys_dev_term->phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfaceFormatsKHR ICD pointer"); + } + + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, + icd_surface->real_icd_surfaces[phys_dev_term->icd_index], + pSurfaceFormatCount, pSurfaceFormats); + } + + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount, + pSurfaceFormats); } // This is the trampoline entrypoint for GetPhysicalDeviceSurfacePresentModesKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t *pPresentModeCount, - VkPresentModeKHR *pPresentModes) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t *pPresentModeCount, + VkPresentModeKHR *pPresentModes) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceSurfacePresentModesKHR( - unwrapped_phys_dev, surface, pPresentModeCount, pPresentModes); + VkResult res = disp->GetPhysicalDeviceSurfacePresentModesKHR(unwrapped_phys_dev, surface, pPresentModeCount, pPresentModes); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceSurfacePresentModesKHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfacePresentModesKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, uint32_t *pPresentModeCount, + VkPresentModeKHR *pPresentModes) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkGetPhysicalDeviceSurfacePresentModesKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfacePresentModesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(pPresentModeCount && "GetPhysicalDeviceSurfacePresentModesKHR: " - "Error, null pPresentModeCount"); - - assert(icd_term->GetPhysicalDeviceSurfacePresentModesKHR && - "loader: null GetPhysicalDeviceSurfacePresentModesKHR ICD pointer"); - - VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; - if (NULL != icd_surface->real_icd_surfaces && - (VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { - return icd_term->GetPhysicalDeviceSurfacePresentModesKHR( - phys_dev_term->phys_dev, - icd_surface->real_icd_surfaces[phys_dev_term->icd_index], - pPresentModeCount, pPresentModes); + if (NULL == pPresentModeCount) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "NULL pointer passed into vkGetPhysicalDeviceSurfacePresentModesKHR for pPresentModeCount!\n"); + assert(false && "GetPhysicalDeviceSurfacePresentModesKHR(: Error, null pPresentModeCount"); } - return icd_term->GetPhysicalDeviceSurfacePresentModesKHR( - phys_dev_term->phys_dev, surface, pPresentModeCount, pPresentModes); + if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfacePresentModesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceSurfacePresentModesKHR ICD pointer"); + } + + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface; + if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[phys_dev_term->icd_index]) { + return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR( + phys_dev_term->phys_dev, icd_surface->real_icd_surfaces[phys_dev_term->icd_index], pPresentModeCount, pPresentModes); + } + + return icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR(phys_dev_term->phys_dev, surface, pPresentModeCount, + pPresentModes); } // Functions for the VK_KHR_swapchain extension: // This is the trampoline entrypoint for CreateSwapchainKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR( - VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchain) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateSwapchainKHR(device, pCreateInfo, pAllocator, - pSwapchain); + return disp->CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); } -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR( - VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchain) { uint32_t icd_index = 0; struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->CreateSwapchainKHR) { - VkIcdSurface *icd_surface = - (VkIcdSurface *)(uintptr_t)pCreateInfo->surface; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfo->surface; if (NULL != icd_surface->real_icd_surfaces) { - if ((VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[icd_index]) { + if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { // We found the ICD, and there is an ICD KHR surface // associated with it, so copy the CreateInfo struct // and point it at the ICD's surface. - VkSwapchainCreateInfoKHR *pCreateCopy = - loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR)); + VkSwapchainCreateInfoKHR *pCreateCopy = loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR)); if (NULL == pCreateCopy) { return VK_ERROR_OUT_OF_HOST_MEMORY; } - memcpy(pCreateCopy, pCreateInfo, - sizeof(VkSwapchainCreateInfoKHR)); - pCreateCopy->surface = - icd_surface->real_icd_surfaces[icd_index]; - return icd_term->CreateSwapchainKHR(device, pCreateCopy, - pAllocator, pSwapchain); + memcpy(pCreateCopy, pCreateInfo, sizeof(VkSwapchainCreateInfoKHR)); + pCreateCopy->surface = icd_surface->real_icd_surfaces[icd_index]; + return icd_term->dispatch.CreateSwapchainKHR(device, pCreateCopy, pAllocator, pSwapchain); } } - return icd_term->CreateSwapchainKHR(device, pCreateInfo, pAllocator, - pSwapchain); + return icd_term->dispatch.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); } return VK_SUCCESS; } // This is the trampoline entrypoint for DestroySwapchainKHR -LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL -vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, - const VkAllocationCallbacks *pAllocator) { +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, + const VkAllocationCallbacks *pAllocator) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); disp->DestroySwapchainKHR(device, swapchain, pAllocator); } -/* - * This is the trampoline entrypoint - * for GetSwapchainImagesKHR - */ -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR( - VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, - VkImage *pSwapchainImages) { +// This is the trampoline entrypoint for GetSwapchainImagesKHR +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, + uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, - pSwapchainImages); + return disp->GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); } -/* - * This is the trampoline entrypoint - * for AcquireNextImageKHR - */ -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR( - VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, - VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) { +// This is the trampoline entrypoint for AcquireNextImageKHR +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, + VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->AcquireNextImageKHR(device, swapchain, timeout, semaphore, - fence, pImageIndex); + return disp->AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); } // This is the trampoline entrypoint for QueuePresentKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(queue); return disp->QueuePresentKHR(queue, pPresentInfo); } -static VkIcdSurface *AllocateIcdSurfaceStruct(struct loader_instance *instance, - size_t base_size, - size_t platform_size) { +static VkIcdSurface *AllocateIcdSurfaceStruct(struct loader_instance *instance, size_t base_size, size_t platform_size) { // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = loader_instance_heap_alloc( - instance, sizeof(VkIcdSurface), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + VkIcdSurface *pIcdSurface = loader_instance_heap_alloc(instance, sizeof(VkIcdSurface), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (pIcdSurface != NULL) { // Setup the new sizes and offsets so we can grow the structures in the // future without having problems pIcdSurface->base_size = (uint32_t)base_size; pIcdSurface->platform_size = (uint32_t)platform_size; - pIcdSurface->non_platform_offset = (uint32_t)( - (uint8_t *)(&pIcdSurface->base_size) - (uint8_t *)pIcdSurface); + pIcdSurface->non_platform_offset = (uint32_t)((uint8_t *)(&pIcdSurface->base_size) - (uint8_t *)pIcdSurface); pIcdSurface->entire_size = sizeof(VkIcdSurface); - pIcdSurface->real_icd_surfaces = loader_instance_heap_alloc( - instance, sizeof(VkSurfaceKHR) * instance->total_icd_count, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + pIcdSurface->real_icd_surfaces = loader_instance_heap_alloc(instance, sizeof(VkSurfaceKHR) * instance->total_icd_count, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (pIcdSurface->real_icd_surfaces == NULL) { loader_instance_heap_free(instance, pIcdSurface); pIcdSurface = NULL; } else { - memset(pIcdSurface->real_icd_surfaces, 0, - sizeof(VkSurfaceKHR) * instance->total_icd_count); + memset(pIcdSurface->real_icd_surfaces, 0, sizeof(VkSurfaceKHR) * instance->total_icd_count); } } return pIcdSurface; @@ -544,22 +463,21 @@ static VkIcdSurface *AllocateIcdSurfaceStruct(struct loader_instance *instance, // Functions for the VK_KHR_win32_surface extension: // This is the trampoline entrypoint for CreateWin32SurfaceKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( - VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(VkInstance instance, + const VkWin32SurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = disp->CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, - pSurface); + res = disp->CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } // This is the instance chain terminator function for CreateWin32SurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR( - VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; VkIcdSurface *pIcdSurface = NULL; uint32_t i = 0; @@ -570,16 +488,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR( struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_win32_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_win32_surface extension not enabled. " - "vkCreateWin32SurfaceKHR not executed!\n"); + "VK_KHR_win32_surface extension not enabled. vkCreateWin32SurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, - sizeof(pIcdSurface->win_surf.base), - sizeof(pIcdSurface->win_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->win_surf.base), sizeof(pIcdSurface->win_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -590,14 +505,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR( pIcdSurface->win_surf.hwnd = pCreateInfo->hwnd; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateWin32SurfaceKHR) { - vkRes = icd_term->CreateWin32SurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateWin32SurfaceKHR) { + vkRes = icd_term->dispatch.CreateWin32SurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -612,17 +524,12 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } - loader_instance_heap_free(ptr_instance, - pIcdSurface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, pIcdSurface); } @@ -632,68 +539,59 @@ out: // This is the trampoline entrypoint for // GetPhysicalDeviceWin32PresentationSupportKHR -LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL -vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkBool32 res = disp->GetPhysicalDeviceWin32PresentationSupportKHR( - unwrapped_phys_dev, queueFamilyIndex); + VkBool32 res = disp->GetPhysicalDeviceWin32PresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceWin32PresentationSupportKHR -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceWin32PresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) { +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_win32_surface_enabled) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_win32_surface extension not enabled. " - "vkGetPhysicalDeviceWin32PresentationSupportKHR not executed!\n"); + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_win32_surface extension not enabled. vkGetPhysicalDeviceWin32PresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceWin32PresentationSupportKHR && - "loader: null GetPhysicalDeviceWin32PresentationSupportKHR ICD " - "pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceWin32PresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceWin32PresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceWin32PresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceWin32PresentationSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex); + return icd_term->dispatch.GetPhysicalDeviceWin32PresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex); } -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_MIR_KHR // Functions for the VK_KHR_mir_surface extension: // This is the trampoline entrypoint for CreateMirSurfaceKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( - VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(VkInstance instance, + const VkMirSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = - disp->CreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); + res = disp->CreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } // This is the instance chain terminator function for CreateMirSurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR( - VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; VkIcdSurface *pIcdSurface = NULL; uint32_t i = 0; @@ -702,16 +600,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR( struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_mir_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_mir_surface extension not enabled. " - "vkCreateMirSurfaceKHR not executed!\n"); + "VK_KHR_mir_surface extension not enabled. vkCreateMirSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, - sizeof(pIcdSurface->mir_surf.base), - sizeof(pIcdSurface->mir_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->mir_surf.base), sizeof(pIcdSurface->mir_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -722,14 +617,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR( pIcdSurface->mir_surf.mirSurface = pCreateInfo->mirSurface; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateMirSurfaceKHR) { - vkRes = icd_term->CreateMirSurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateMirSurfaceKHR) { + vkRes = icd_term->dispatch.CreateMirSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -744,17 +636,12 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } - loader_instance_heap_free(ptr_instance, - pIcdSurface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, pIcdSurface); } @@ -764,72 +651,60 @@ out: // This is the trampoline entrypoint for // GetPhysicalDeviceMirPresentationSupportKHR -LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL -vkGetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - MirConnection *connection) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection *connection) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkBool32 res = disp->GetPhysicalDeviceMirPresentationSupportKHR( - unwrapped_phys_dev, queueFamilyIndex, connection); + VkBool32 res = disp->GetPhysicalDeviceMirPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, connection); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceMirPresentationSupportKHR -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceMirPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - MirConnection *connection) { - +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection *connection) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_mir_surface_enabled) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_mir_surface extension not enabled. " - "vkGetPhysicalDeviceMirPresentationSupportKHR not executed!\n"); + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_mir_surface extension not enabled. vkGetPhysicalDeviceMirPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert( - icd_term->GetPhysicalDeviceMirPresentationSupportKHR && - "loader: null GetPhysicalDeviceMirPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceMirPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceMirPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceMirPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceMirPresentationSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, connection); + return icd_term->dispatch.GetPhysicalDeviceMirPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection); } -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR -/* - * This is the trampoline entrypoint - * for CreateWaylandSurfaceKHR - */ -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( - VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +// This is the trampoline entrypoint for CreateWaylandSurfaceKHR +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(VkInstance instance, + const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = disp->CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, - pSurface); + res = disp->CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } // This is the instance chain terminator function for CreateWaylandSurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( - VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance instance, + const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; VkIcdSurface *pIcdSurface = NULL; uint32_t i = 0; @@ -838,16 +713,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_wayland_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_wayland_surface extension not enabled. " - "vkCreateWaylandSurfaceKHR not executed!\n"); + "VK_KHR_wayland_surface extension not enabled. vkCreateWaylandSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = AllocateIcdSurfaceStruct( - ptr_instance, sizeof(pIcdSurface->wayland_surf.base), - sizeof(pIcdSurface->wayland_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->wayland_surf.base), sizeof(pIcdSurface->wayland_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -858,14 +730,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( pIcdSurface->wayland_surf.surface = pCreateInfo->surface; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateWaylandSurfaceKHR) { - vkRes = icd_term->CreateWaylandSurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateWaylandSurfaceKHR) { + vkRes = icd_term->dispatch.CreateWaylandSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -880,17 +749,12 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } - loader_instance_heap_free(ptr_instance, - pIcdSurface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, pIcdSurface); } @@ -900,71 +764,62 @@ out: // This is the trampoline entrypoint for // GetPhysicalDeviceWaylandPresentationSupportKHR -LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL -vkGetPhysicalDeviceWaylandPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - struct wl_display *display) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + struct wl_display *display) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkBool32 res = disp->GetPhysicalDeviceWaylandPresentationSupportKHR( - unwrapped_phys_dev, queueFamilyIndex, display); + VkBool32 res = disp->GetPhysicalDeviceWaylandPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, display); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceWaylandPresentationSupportKHR -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceWaylandPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - struct wl_display *display) { - +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + struct wl_display *display) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_wayland_surface_enabled) { loader_log( ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_wayland_surface extension not enabled. " - "vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n"); + "VK_KHR_wayland_surface extension not enabled. vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceWaylandPresentationSupportKHR && - "loader: null GetPhysicalDeviceWaylandPresentationSupportKHR ICD " - "pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceWaylandPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceWaylandPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceWaylandPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceWaylandPresentationSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, display); + return icd_term->dispatch.GetPhysicalDeviceWaylandPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, display); } -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XCB_KHR // Functions for the VK_KHR_xcb_surface extension: // This is the trampoline entrypoint for CreateXcbSurfaceKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( - VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance, + const VkXcbSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = - disp->CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); + res = disp->CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } // This is the instance chain terminator function for CreateXcbSurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR( - VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; VkIcdSurface *pIcdSurface = NULL; uint32_t i = 0; @@ -973,16 +828,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR( struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xcb_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xcb_surface extension not enabled. " - "vkCreateXcbSurfaceKHR not executed!\n"); + "VK_KHR_xcb_surface extension not enabled. vkCreateXcbSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, - sizeof(pIcdSurface->xcb_surf.base), - sizeof(pIcdSurface->xcb_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->xcb_surf.base), sizeof(pIcdSurface->xcb_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -993,14 +845,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR( pIcdSurface->xcb_surf.window = pCreateInfo->window; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateXcbSurfaceKHR) { - vkRes = icd_term->CreateXcbSurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateXcbSurfaceKHR) { + vkRes = icd_term->dispatch.CreateXcbSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -1015,17 +864,12 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } - loader_instance_heap_free(ptr_instance, - pIcdSurface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, pIcdSurface); } @@ -1035,72 +879,64 @@ out: // This is the trampoline entrypoint for // GetPhysicalDeviceXcbPresentationSupportKHR -LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL -vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - xcb_connection_t *connection, - xcb_visualid_t visual_id) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + xcb_connection_t *connection, + xcb_visualid_t visual_id) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkBool32 res = disp->GetPhysicalDeviceXcbPresentationSupportKHR( - unwrapped_phys_dev, queueFamilyIndex, connection, visual_id); + VkBool32 res = disp->GetPhysicalDeviceXcbPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, connection, visual_id); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceXcbPresentationSupportKHR -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceXcbPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - xcb_connection_t *connection, xcb_visualid_t visual_id) { - +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + xcb_connection_t *connection, + xcb_visualid_t visual_id) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_xcb_surface_enabled) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xcb_surface extension not enabled. " - "vkGetPhysicalDeviceXcbPresentationSupportKHR not executed!\n"); + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_xcb_surface extension not enabled. vkGetPhysicalDeviceXcbPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert( - icd_term->GetPhysicalDeviceXcbPresentationSupportKHR && - "loader: null GetPhysicalDeviceXcbPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceXcbPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceXcbPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceXcbPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceXcbPresentationSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, connection, visual_id); + return icd_term->dispatch.GetPhysicalDeviceXcbPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, connection, + visual_id); } -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR // Functions for the VK_KHR_xlib_surface extension: // This is the trampoline entrypoint for CreateXlibSurfaceKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( - VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(VkInstance instance, + const VkXlibSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = - disp->CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); + res = disp->CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } // This is the instance chain terminator function for CreateXlibSurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR( - VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; VkIcdSurface *pIcdSurface = NULL; uint32_t i = 0; @@ -1109,16 +945,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR( struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xlib_surface_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xlib_surface extension not enabled. " - "vkCreateXlibSurfaceKHR not executed!\n"); + "VK_KHR_xlib_surface extension not enabled. vkCreateXlibSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = AllocateIcdSurfaceStruct( - ptr_instance, sizeof(pIcdSurface->xlib_surf.base), - sizeof(pIcdSurface->xlib_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->xlib_surf.base), sizeof(pIcdSurface->xlib_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -1129,14 +962,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR( pIcdSurface->xlib_surf.window = pCreateInfo->window; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateXlibSurfaceKHR) { - vkRes = icd_term->CreateXlibSurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateXlibSurfaceKHR) { + vkRes = icd_term->dispatch.CreateXlibSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -1151,17 +981,12 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } - loader_instance_heap_free(ptr_instance, - pIcdSurface->real_icd_surfaces); + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); } loader_instance_heap_free(ptr_instance, pIcdSurface); } @@ -1171,58 +996,49 @@ out: // This is the trampoline entrypoint for // GetPhysicalDeviceXlibPresentationSupportKHR -LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL -vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - Display *dpy, VisualID visualID) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, Display *dpy, + VisualID visualID) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkBool32 res = disp->GetPhysicalDeviceXlibPresentationSupportKHR( - unwrapped_phys_dev, queueFamilyIndex, dpy, visualID); + VkBool32 res = disp->GetPhysicalDeviceXlibPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, dpy, visualID); return res; } // This is the instance chain terminator function for // GetPhysicalDeviceXlibPresentationSupportKHR -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceXlibPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display *dpy, - VisualID visualID) { - +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, Display *dpy, + VisualID visualID) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_xlib_surface_enabled) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_xlib_surface extension not enabled. " - "vkGetPhysicalDeviceXlibPresentationSupportKHR not executed!\n"); + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_xlib_surface extension not enabled. vkGetPhysicalDeviceXlibPresentationSupportKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert( - icd_term->GetPhysicalDeviceXlibPresentationSupportKHR && - "loader: null GetPhysicalDeviceXlibPresentationSupportKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceXlibPresentationSupportKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceXlibPresentationSupportKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceXlibPresentationSupportKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceXlibPresentationSupportKHR( - phys_dev_term->phys_dev, queueFamilyIndex, dpy, visualID); + return icd_term->dispatch.GetPhysicalDeviceXlibPresentationSupportKHR(phys_dev_term->phys_dev, queueFamilyIndex, dpy, visualID); } -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR // Functions for the VK_KHR_android_surface extension: // This is the trampoline entrypoint for CreateAndroidSurfaceKHR -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( - VkInstance instance, ANativeWindow *window, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(VkInstance instance, ANativeWindow *window, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; @@ -1232,22 +1048,19 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( } // This is the instance chain terminator function for CreateAndroidSurfaceKHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR( - VkInstance instance, Window window, const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR(VkInstance instance, Window window, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { // First, check to ensure the appropriate extension was enabled: struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkCreateAndroidSurfaceKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkCreateAndroidSurfaceKHR not executed!\n"); return VK_ERROR_EXTENSION_NOT_PRESENT; } // Next, if so, proceed with the implementation of this function: VkIcdSurfaceAndroid *pIcdSurface = - loader_instance_heap_alloc(ptr_instance, sizeof(VkIcdSurfaceAndroid), - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + loader_instance_heap_alloc(ptr_instance, sizeof(VkIcdSurfaceAndroid), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (pIcdSurface == NULL) { return VK_ERROR_OUT_OF_HOST_MEMORY; } @@ -1261,255 +1074,216 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateAndroidSurfaceKHR( return VK_SUCCESS; } -#endif // VK_USE_PLATFORM_ANDROID_KHR +#endif // VK_USE_PLATFORM_ANDROID_KHR // Functions for the VK_KHR_display instance extension: -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, - uint32_t *pPropertyCount, - VkDisplayPropertiesKHR *pProperties) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkDisplayPropertiesKHR *pProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceDisplayPropertiesKHR( - unwrapped_phys_dev, pPropertyCount, pProperties); + VkResult res = disp->GetPhysicalDeviceDisplayPropertiesKHR(unwrapped_phys_dev, pPropertyCount, pProperties); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkDisplayPropertiesKHR *pProperties) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkDisplayPropertiesKHR *pProperties) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetPhysicalDeviceDisplayPropertiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetPhysicalDeviceDisplayPropertiesKHR && - "loader: null GetPhysicalDeviceDisplayPropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPropertiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceDisplayPropertiesKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceDisplayPropertiesKHR( - phys_dev_term->phys_dev, pPropertyCount, pProperties); + return icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkDisplayPlanePropertiesKHR *pProperties) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceDisplayPlanePropertiesKHR( + VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkDisplayPlanePropertiesKHR *pProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetPhysicalDeviceDisplayPlanePropertiesKHR( - unwrapped_phys_dev, pPropertyCount, pProperties); + VkResult res = disp->GetPhysicalDeviceDisplayPlanePropertiesKHR(unwrapped_phys_dev, pPropertyCount, pProperties); return res; } -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkDisplayPlanePropertiesKHR *pProperties) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkDisplayPlanePropertiesKHR *pProperties) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { - loader_log( - ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetPhysicalDeviceDisplayPlanePropertiesKHR not executed!\n"); + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPlanePropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert( - icd_term->GetPhysicalDeviceDisplayPlanePropertiesKHR && - "loader: null GetPhysicalDeviceDisplayPlanePropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPlanePropertiesKHR!\n"); + assert(false && "loader: null GetPhysicalDeviceDisplayPlanePropertiesKHR ICD pointer"); + } - return icd_term->GetPhysicalDeviceDisplayPlanePropertiesKHR( - phys_dev_term->phys_dev, pPropertyCount, pProperties); + return icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL -vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, - uint32_t planeIndex, - uint32_t *pDisplayCount, - VkDisplayKHR *pDisplays) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, + uint32_t planeIndex, uint32_t *pDisplayCount, + VkDisplayKHR *pDisplays) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetDisplayPlaneSupportedDisplaysKHR( - unwrapped_phys_dev, planeIndex, pDisplayCount, pDisplays); + VkResult res = disp->GetDisplayPlaneSupportedDisplaysKHR(unwrapped_phys_dev, planeIndex, pDisplayCount, pDisplays); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR( - VkPhysicalDevice physicalDevice, uint32_t planeIndex, - uint32_t *pDisplayCount, VkDisplayKHR *pDisplays) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, + uint32_t *pDisplayCount, VkDisplayKHR *pDisplays) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayPlaneSupportedDisplaysKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayPlaneSupportedDisplaysKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayPlaneSupportedDisplaysKHR && - "loader: null GetDisplayPlaneSupportedDisplaysKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayPlaneSupportedDisplaysKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayPlaneSupportedDisplaysKHR!\n"); + assert(false && "loader: null GetDisplayPlaneSupportedDisplaysKHR ICD pointer"); + } - return icd_term->GetDisplayPlaneSupportedDisplaysKHR( - phys_dev_term->phys_dev, planeIndex, pDisplayCount, pDisplays); + return icd_term->dispatch.GetDisplayPlaneSupportedDisplaysKHR(phys_dev_term->phys_dev, planeIndex, pDisplayCount, pDisplays); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR( - VkPhysicalDevice physicalDevice, VkDisplayKHR display, - uint32_t *pPropertyCount, VkDisplayModePropertiesKHR *pProperties) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + uint32_t *pPropertyCount, + VkDisplayModePropertiesKHR *pProperties) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetDisplayModePropertiesKHR( - unwrapped_phys_dev, display, pPropertyCount, pProperties); + VkResult res = disp->GetDisplayModePropertiesKHR(unwrapped_phys_dev, display, pPropertyCount, pProperties); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR( - VkPhysicalDevice physicalDevice, VkDisplayKHR display, - uint32_t *pPropertyCount, VkDisplayModePropertiesKHR *pProperties) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + uint32_t *pPropertyCount, + VkDisplayModePropertiesKHR *pProperties) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayModePropertiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayModePropertiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayModePropertiesKHR && - "loader: null GetDisplayModePropertiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayModePropertiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayModePropertiesKHR!\n"); + assert(false && "loader: null GetDisplayModePropertiesKHR ICD pointer"); + } - return icd_term->GetDisplayModePropertiesKHR( - phys_dev_term->phys_dev, display, pPropertyCount, pProperties); + return icd_term->dispatch.GetDisplayModePropertiesKHR(phys_dev_term->phys_dev, display, pPropertyCount, pProperties); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR( - VkPhysicalDevice physicalDevice, VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + const VkDisplayModeCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkDisplayModeKHR *pMode) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->CreateDisplayModeKHR(unwrapped_phys_dev, display, - pCreateInfo, pAllocator, pMode); + VkResult res = disp->CreateDisplayModeKHR(unwrapped_phys_dev, display, pCreateInfo, pAllocator, pMode); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR( - VkPhysicalDevice physicalDevice, VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + const VkDisplayModeCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkCreateDisplayModeKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkCreateDisplayModeKHR not executed!\n"); return VK_ERROR_EXTENSION_NOT_PRESENT; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->CreateDisplayModeKHR && - "loader: null CreateDisplayModeKHR ICD pointer"); + if (NULL == icd_term->dispatch.CreateDisplayModeKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkCreateDisplayModeKHR!\n"); + assert(false && "loader: null CreateDisplayModeKHR ICD pointer"); + } - return icd_term->CreateDisplayModeKHR(phys_dev_term->phys_dev, display, - pCreateInfo, pAllocator, pMode); + return icd_term->dispatch.CreateDisplayModeKHR(phys_dev_term->phys_dev, display, pCreateInfo, pAllocator, pMode); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR *pCapabilities) { - VkPhysicalDevice unwrapped_phys_dev = - loader_unwrap_physical_device(physicalDevice); +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, + VkDisplayModeKHR mode, uint32_t planeIndex, + VkDisplayPlaneCapabilitiesKHR *pCapabilities) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(physicalDevice); - VkResult res = disp->GetDisplayPlaneCapabilitiesKHR( - unwrapped_phys_dev, mode, planeIndex, pCapabilities); + VkResult res = disp->GetDisplayPlaneCapabilitiesKHR(unwrapped_phys_dev, mode, planeIndex, pCapabilities); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR *pCapabilities) { - +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, + uint32_t planeIndex, + VkDisplayPlaneCapabilitiesKHR *pCapabilities) { // First, check to ensure the appropriate extension was enabled: - struct loader_physical_device_term *phys_dev_term = - (struct loader_physical_device_term *)physicalDevice; + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - struct loader_instance *ptr_instance = - (struct loader_instance *)icd_term->this_instance; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; if (!ptr_instance->wsi_display_enabled) { loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_display extension not enabled. " - "vkGetDisplayPlaneCapabilitiesKHR not executed!\n"); + "VK_KHR_display extension not enabled. vkGetDisplayPlaneCapabilitiesKHR not executed!\n"); return VK_SUCCESS; } - // Next, if so, proceed with the implementation of this function: - assert(icd_term->GetDisplayPlaneCapabilitiesKHR && - "loader: null GetDisplayPlaneCapabilitiesKHR ICD pointer"); + if (NULL == icd_term->dispatch.GetDisplayPlaneCapabilitiesKHR) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetDisplayPlaneCapabilitiesKHR!\n"); + assert(false && "loader: null GetDisplayPlaneCapabilitiesKHR ICD pointer"); + } - return icd_term->GetDisplayPlaneCapabilitiesKHR( - phys_dev_term->phys_dev, mode, planeIndex, pCapabilities); + return icd_term->dispatch.GetDisplayPlaneCapabilitiesKHR(phys_dev_term->phys_dev, mode, planeIndex, pCapabilities); } -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( - VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR(VkInstance instance, + const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { const VkLayerInstanceDispatchTable *disp; disp = loader_get_instance_layer_dispatch(instance); VkResult res; - res = disp->CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, - pSurface); + res = disp->CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); return res; } -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( - VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstance instance, + const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { struct loader_instance *inst = loader_get_instance(instance); VkIcdSurface *pIcdSurface = NULL; VkResult vkRes = VK_SUCCESS; @@ -1517,16 +1291,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( if (!inst->wsi_display_enabled) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "VK_KHR_surface extension not enabled. " - "vkCreateDisplayPlaneSurfaceKHR not executed!\n"); + "VK_KHR_surface extension not enabled. vkCreateDisplayPlaneSurfaceKHR not executed!\n"); vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; goto out; } // Next, if so, proceed with the implementation of this function: - pIcdSurface = - AllocateIcdSurfaceStruct(inst, sizeof(pIcdSurface->display_surf.base), - sizeof(pIcdSurface->display_surf)); + pIcdSurface = AllocateIcdSurfaceStruct(inst, sizeof(pIcdSurface->display_surf.base), sizeof(pIcdSurface->display_surf)); if (pIcdSurface == NULL) { vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; @@ -1542,14 +1313,11 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( pIcdSurface->display_surf.imageExtent = pCreateInfo->imageExtent; // Loop through each ICD and determine if they need to create a surface - for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; - icd_term = icd_term->next, i++) { - if (icd_term->scanned_icd->interface_version >= - ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { - if (NULL != icd_term->CreateDisplayPlaneSurfaceKHR) { - vkRes = icd_term->CreateDisplayPlaneSurfaceKHR( - icd_term->instance, pCreateInfo, pAllocator, - &pIcdSurface->real_icd_surfaces[i]); + for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateDisplayPlaneSurfaceKHR) { + vkRes = icd_term->dispatch.CreateDisplayPlaneSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); if (VK_SUCCESS != vkRes) { goto out; } @@ -1564,13 +1332,9 @@ out: if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { if (NULL != pIcdSurface->real_icd_surfaces) { i = 0; - for (struct loader_icd_term *icd_term = inst->icd_terms; - icd_term != NULL; icd_term = icd_term->next, i++) { - if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && - NULL != icd_term->DestroySurfaceKHR) { - icd_term->DestroySurfaceKHR( - icd_term->instance, pIcdSurface->real_icd_surfaces[i], - pAllocator); + for (struct loader_icd_term *icd_term = inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); } } loader_instance_heap_free(inst, pIcdSurface->real_icd_surfaces); @@ -1583,89 +1347,67 @@ out: // EXT_display_swapchain Extension command -LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( - VkDevice device, uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR *pCreateInfos, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) { +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchains) { const VkLayerDispatchTable *disp; disp = loader_get_dispatch(device); - return disp->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, - pAllocator, pSwapchains); + return disp->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); } -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSharedSwapchainsKHR( - VkDevice device, uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR *pCreateInfos, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) { +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchains) { uint32_t icd_index = 0; struct loader_device *dev; - struct loader_icd_term *icd_term = - loader_get_icd_and_device(device, &dev, &icd_index); - if (NULL != icd_term && NULL != icd_term->CreateSharedSwapchainsKHR) { - VkIcdSurface *icd_surface = - (VkIcdSurface *)(uintptr_t)pCreateInfos->surface; + struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index); + if (NULL != icd_term && NULL != icd_term->dispatch.CreateSharedSwapchainsKHR) { + VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pCreateInfos->surface; if (NULL != icd_surface->real_icd_surfaces) { - if ((VkSurfaceKHR)NULL != - icd_surface->real_icd_surfaces[icd_index]) { + if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) { // We found the ICD, and there is an ICD KHR surface // associated with it, so copy the CreateInfo struct // and point it at the ICD's surface. - VkSwapchainCreateInfoKHR *pCreateCopy = - loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR) * - swapchainCount); + VkSwapchainCreateInfoKHR *pCreateCopy = loader_stack_alloc(sizeof(VkSwapchainCreateInfoKHR) * swapchainCount); if (NULL == pCreateCopy) { return VK_ERROR_OUT_OF_HOST_MEMORY; } - memcpy(pCreateCopy, pCreateInfos, - sizeof(VkSwapchainCreateInfoKHR) * swapchainCount); + memcpy(pCreateCopy, pCreateInfos, sizeof(VkSwapchainCreateInfoKHR) * swapchainCount); for (uint32_t sc = 0; sc < swapchainCount; sc++) { - pCreateCopy[sc].surface = - icd_surface->real_icd_surfaces[icd_index]; + pCreateCopy[sc].surface = icd_surface->real_icd_surfaces[icd_index]; } - return icd_term->CreateSharedSwapchainsKHR( - device, swapchainCount, pCreateCopy, pAllocator, - pSwapchains); + return icd_term->dispatch.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateCopy, pAllocator, pSwapchains); } } - return icd_term->CreateSharedSwapchainsKHR(device, swapchainCount, - pCreateInfos, pAllocator, - pSwapchains); + return icd_term->dispatch.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); } return VK_SUCCESS; } -bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr) { +bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { *addr = NULL; // Functions for the VK_KHR_surface extension: if (!strcmp("vkDestroySurfaceKHR", name)) { - *addr = ptr_instance->wsi_surface_enabled ? (void *)vkDestroySurfaceKHR - : NULL; + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkDestroySurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceSurfaceSupportKHR", name)) { - *addr = ptr_instance->wsi_surface_enabled - ? (void *)vkGetPhysicalDeviceSurfaceSupportKHR - : NULL; + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceSupportKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilitiesKHR", name)) { - *addr = ptr_instance->wsi_surface_enabled - ? (void *)vkGetPhysicalDeviceSurfaceCapabilitiesKHR - : NULL; + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilitiesKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceSurfaceFormatsKHR", name)) { - *addr = ptr_instance->wsi_surface_enabled - ? (void *)vkGetPhysicalDeviceSurfaceFormatsKHR - : NULL; + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormatsKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceSurfacePresentModesKHR", name)) { - *addr = ptr_instance->wsi_surface_enabled - ? (void *)vkGetPhysicalDeviceSurfacePresentModesKHR - : NULL; + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfacePresentModesKHR : NULL; return true; } @@ -1700,134 +1442,98 @@ bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, // Functions for the VK_KHR_win32_surface extension: if (!strcmp("vkCreateWin32SurfaceKHR", name)) { - *addr = ptr_instance->wsi_win32_surface_enabled - ? (void *)vkCreateWin32SurfaceKHR - : NULL; + *addr = ptr_instance->wsi_win32_surface_enabled ? (void *)vkCreateWin32SurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceWin32PresentationSupportKHR", name)) { - *addr = ptr_instance->wsi_win32_surface_enabled - ? (void *)vkGetPhysicalDeviceWin32PresentationSupportKHR - : NULL; + *addr = ptr_instance->wsi_win32_surface_enabled ? (void *)vkGetPhysicalDeviceWin32PresentationSupportKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_MIR_KHR // Functions for the VK_KHR_mir_surface extension: if (!strcmp("vkCreateMirSurfaceKHR", name)) { - *addr = ptr_instance->wsi_mir_surface_enabled - ? (void *)vkCreateMirSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_mir_surface_enabled ? (void *)vkCreateMirSurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceMirPresentationSupportKHR", name)) { - *addr = ptr_instance->wsi_mir_surface_enabled - ? (void *)vkGetPhysicalDeviceMirPresentationSupportKHR - : NULL; + *addr = ptr_instance->wsi_mir_surface_enabled ? (void *)vkGetPhysicalDeviceMirPresentationSupportKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR // Functions for the VK_KHR_wayland_surface extension: if (!strcmp("vkCreateWaylandSurfaceKHR", name)) { - *addr = ptr_instance->wsi_wayland_surface_enabled - ? (void *)vkCreateWaylandSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_wayland_surface_enabled ? (void *)vkCreateWaylandSurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceWaylandPresentationSupportKHR", name)) { - *addr = ptr_instance->wsi_wayland_surface_enabled - ? (void *)vkGetPhysicalDeviceWaylandPresentationSupportKHR - : NULL; + *addr = ptr_instance->wsi_wayland_surface_enabled ? (void *)vkGetPhysicalDeviceWaylandPresentationSupportKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XCB_KHR // Functions for the VK_KHR_xcb_surface extension: if (!strcmp("vkCreateXcbSurfaceKHR", name)) { - *addr = ptr_instance->wsi_xcb_surface_enabled - ? (void *)vkCreateXcbSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_xcb_surface_enabled ? (void *)vkCreateXcbSurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceXcbPresentationSupportKHR", name)) { - *addr = ptr_instance->wsi_xcb_surface_enabled - ? (void *)vkGetPhysicalDeviceXcbPresentationSupportKHR - : NULL; + *addr = ptr_instance->wsi_xcb_surface_enabled ? (void *)vkGetPhysicalDeviceXcbPresentationSupportKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR // Functions for the VK_KHR_xlib_surface extension: if (!strcmp("vkCreateXlibSurfaceKHR", name)) { - *addr = ptr_instance->wsi_xlib_surface_enabled - ? (void *)vkCreateXlibSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkCreateXlibSurfaceKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceXlibPresentationSupportKHR", name)) { - *addr = ptr_instance->wsi_xlib_surface_enabled - ? (void *)vkGetPhysicalDeviceXlibPresentationSupportKHR - : NULL; + *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkGetPhysicalDeviceXlibPresentationSupportKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR // Functions for the VK_KHR_android_surface extension: if (!strcmp("vkCreateAndroidSurfaceKHR", name)) { - *addr = ptr_instance->wsi_xlib_surface_enabled - ? (void *)vkCreateAndroidSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkCreateAndroidSurfaceKHR : NULL; return true; } -#endif // VK_USE_PLATFORM_ANDROID_KHR +#endif // VK_USE_PLATFORM_ANDROID_KHR // Functions for VK_KHR_display extension: if (!strcmp("vkGetPhysicalDeviceDisplayPropertiesKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkGetPhysicalDeviceDisplayPropertiesKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPropertiesKHR : NULL; return true; } if (!strcmp("vkGetPhysicalDeviceDisplayPlanePropertiesKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkGetPhysicalDeviceDisplayPlanePropertiesKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPlanePropertiesKHR : NULL; return true; } if (!strcmp("vkGetDisplayPlaneSupportedDisplaysKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkGetDisplayPlaneSupportedDisplaysKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayPlaneSupportedDisplaysKHR : NULL; return true; } if (!strcmp("vkGetDisplayModePropertiesKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkGetDisplayModePropertiesKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayModePropertiesKHR : NULL; return true; } if (!strcmp("vkCreateDisplayModeKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkCreateDisplayModeKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkCreateDisplayModeKHR : NULL; return true; } if (!strcmp("vkGetDisplayPlaneCapabilitiesKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkGetDisplayPlaneCapabilitiesKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayPlaneCapabilitiesKHR : NULL; return true; } if (!strcmp("vkCreateDisplayPlaneSurfaceKHR", name)) { - *addr = ptr_instance->wsi_display_enabled - ? (void *)vkCreateDisplayPlaneSurfaceKHR - : NULL; + *addr = ptr_instance->wsi_display_enabled ? (void *)vkCreateDisplayPlaneSurfaceKHR : NULL; return true; } diff --git a/third_party/vulkan/loader/wsi.h b/third_party/vulkan/loader/wsi.h index b93a53c7a..519a7aacc 100644 --- a/third_party/vulkan/loader/wsi.h +++ b/third_party/vulkan/loader/wsi.h @@ -29,149 +29,117 @@ typedef struct { union { #ifdef VK_USE_PLATFORM_MIR_KHR VkIcdSurfaceMir mir_surf; -#endif // VK_USE_PLATFORM_MIR_KHR +#endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR VkIcdSurfaceWayland wayland_surf; -#endif // VK_USE_PLATFORM_WAYLAND_KHR +#endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR VkIcdSurfaceWin32 win_surf; -#endif // VK_USE_PLATFORM_WIN32_KHR +#endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_XCB_KHR VkIcdSurfaceXcb xcb_surf; -#endif // VK_USE_PLATFORM_XCB_KHR +#endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR VkIcdSurfaceXlib xlib_surf; -#endif // VK_USE_PLATFORM_XLIB_KHR +#endif // VK_USE_PLATFORM_XLIB_KHR VkIcdSurfaceDisplay display_surf; }; - uint32_t base_size; // Size of VkIcdSurfaceBase - uint32_t platform_size; // Size of corresponding VkIcdSurfaceXXX - uint32_t non_platform_offset; // Start offset to base_size - uint32_t entire_size; // Size of entire VkIcdSurface + uint32_t base_size; // Size of VkIcdSurfaceBase + uint32_t platform_size; // Size of corresponding VkIcdSurfaceXXX + uint32_t non_platform_offset; // Start offset to base_size + uint32_t entire_size; // Size of entire VkIcdSurface VkSurfaceKHR *real_icd_surfaces; } VkIcdSurface; -bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, - const char *name, void **addr); +bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); -void wsi_create_instance(struct loader_instance *ptr_instance, - const VkInstanceCreateInfo *pCreateInfo); +void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop); -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR( - VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); -VKAPI_ATTR void VKAPI_CALL -terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, - const VkAllocationCallbacks *pAllocator); +VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, + const VkAllocationCallbacks *pAllocator); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - VkSurfaceKHR surface, - VkBool32 *pSupported); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, VkSurfaceKHR surface, + VkBool32 *pSupported); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, + uint32_t *pSurfaceFormatCount, + VkSurfaceFormatKHR *pSurfaceFormats); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceSurfacePresentModesKHR( - VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, uint32_t *pPresentModeCount, + VkPresentModeKHR *pPresentModes); #ifdef VK_USE_PLATFORM_WIN32_KHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateWin32SurfaceKHR(VkInstance instance, - const VkWin32SurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface); -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceWin32PresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex); #endif #ifdef VK_USE_PLATFORM_MIR_KHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateMirSurfaceKHR(VkInstance instance, - const VkMirSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface); -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceMirPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - MirConnection *connection); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + MirConnection *connection); #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( - VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceWaylandPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - struct wl_display *display); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance instance, + const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + struct wl_display *display); #endif #ifdef VK_USE_PLATFORM_XCB_KHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateXcbSurfaceKHR(VkInstance instance, - const VkXcbSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceXcbPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, - xcb_connection_t *connection, xcb_visualid_t visual_id); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + xcb_connection_t *connection, + xcb_visualid_t visual_id); #endif #ifdef VK_USE_PLATFORM_XLIB_KHR -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateXlibSurfaceKHR(VkInstance instance, - const VkXlibSurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface); -VKAPI_ATTR VkBool32 VKAPI_CALL -terminator_GetPhysicalDeviceXlibPresentationSupportKHR( - VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display *dpy, - VisualID visualID); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, Display *dpy, + VisualID visualID); #endif -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkDisplayPropertiesKHR *pProperties); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR( - VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, - VkDisplayPlanePropertiesKHR *pProperties); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, - uint32_t planeIndex, - uint32_t *pDisplayCount, - VkDisplayKHR *pDisplays); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t *pPropertyCount, - VkDisplayModePropertiesKHR *pProperties); -VKAPI_ATTR VkResult VKAPI_CALL -terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, - VkDisplayModeKHR *pMode); -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR( - VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR *pCapabilities); -VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( - VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkDisplayPropertiesKHR *pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, + uint32_t *pPropertyCount, + VkDisplayPlanePropertiesKHR *pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, + uint32_t *pDisplayCount, VkDisplayKHR *pDisplays); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + uint32_t *pPropertyCount, + VkDisplayModePropertiesKHR *pProperties); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, + const VkDisplayModeCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, + uint32_t planeIndex, + VkDisplayPlaneCapabilitiesKHR *pCapabilities); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstance instance, + const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface); -VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSharedSwapchainsKHR( - VkDevice device, uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR *pCreateInfos, - const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains); +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, + const VkSwapchainCreateInfoKHR *pCreateInfos, + const VkAllocationCallbacks *pAllocator, + VkSwapchainKHR *pSwapchains); -#endif /* WSI_H */ +#endif // WSI_H diff --git a/third_party/vulkan/vk_icd.h b/third_party/vulkan/vk_icd.h index 748e552d5..668a4d183 100644 --- a/third_party/vulkan/vk_icd.h +++ b/third_party/vulkan/vk_icd.h @@ -24,6 +24,7 @@ #define VKICD_H #include "vulkan.h" +#include // Loader-ICD version negotiation API. Versions add the following features: // Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr diff --git a/third_party/vulkan/vk_layer.h b/third_party/vulkan/vk_layer.h index ebbb19804..4a502a33b 100644 --- a/third_party/vulkan/vk_layer.h +++ b/third_party/vulkan/vk_layer.h @@ -2,9 +2,9 @@ // File: vk_layer.h // /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,9 @@ #define VK_LAYER_EXPORT #endif +// Definition for VkLayerDispatchTable and VkLayerInstanceDispatchTable now appear in externally generated header +#include "vk_layer_dispatch_table.h" + #define MAX_NUM_UNKNOWN_EXTS 250 // Loader-Layer version negotiation API. Versions add the following features: @@ -45,9 +48,6 @@ #define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2 #define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1 - // Internal function -typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName); - // Version negotiation values typedef enum VkNegotiateLayerStructType { LAYER_NEGOTIATE_UNINTIALIZED = 0, @@ -70,263 +70,6 @@ typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegot // Function prototype for unknown physical device extension command typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device, ...); -typedef struct VkLayerDispatchTable_ { - PFN_vkGetDeviceProcAddr GetDeviceProcAddr; - PFN_vkDestroyDevice DestroyDevice; - PFN_vkGetDeviceQueue GetDeviceQueue; - PFN_vkQueueSubmit QueueSubmit; - PFN_vkQueueWaitIdle QueueWaitIdle; - PFN_vkDeviceWaitIdle DeviceWaitIdle; - PFN_vkAllocateMemory AllocateMemory; - PFN_vkFreeMemory FreeMemory; - PFN_vkMapMemory MapMemory; - PFN_vkUnmapMemory UnmapMemory; - PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; - PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; - PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment; - PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements; - PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements; - PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements; - PFN_vkBindImageMemory BindImageMemory; - PFN_vkBindBufferMemory BindBufferMemory; - PFN_vkQueueBindSparse QueueBindSparse; - PFN_vkCreateFence CreateFence; - PFN_vkDestroyFence DestroyFence; - PFN_vkGetFenceStatus GetFenceStatus; - PFN_vkResetFences ResetFences; - PFN_vkWaitForFences WaitForFences; - PFN_vkCreateSemaphore CreateSemaphore; - PFN_vkDestroySemaphore DestroySemaphore; - PFN_vkCreateEvent CreateEvent; - PFN_vkDestroyEvent DestroyEvent; - PFN_vkGetEventStatus GetEventStatus; - PFN_vkSetEvent SetEvent; - PFN_vkResetEvent ResetEvent; - PFN_vkCreateQueryPool CreateQueryPool; - PFN_vkDestroyQueryPool DestroyQueryPool; - PFN_vkGetQueryPoolResults GetQueryPoolResults; - PFN_vkCreateBuffer CreateBuffer; - PFN_vkDestroyBuffer DestroyBuffer; - PFN_vkCreateBufferView CreateBufferView; - PFN_vkDestroyBufferView DestroyBufferView; - PFN_vkCreateImage CreateImage; - PFN_vkDestroyImage DestroyImage; - PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout; - PFN_vkCreateImageView CreateImageView; - PFN_vkDestroyImageView DestroyImageView; - PFN_vkCreateShaderModule CreateShaderModule; - PFN_vkDestroyShaderModule DestroyShaderModule; - PFN_vkCreatePipelineCache CreatePipelineCache; - PFN_vkDestroyPipelineCache DestroyPipelineCache; - PFN_vkGetPipelineCacheData GetPipelineCacheData; - PFN_vkMergePipelineCaches MergePipelineCaches; - PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines; - PFN_vkCreateComputePipelines CreateComputePipelines; - PFN_vkDestroyPipeline DestroyPipeline; - PFN_vkCreatePipelineLayout CreatePipelineLayout; - PFN_vkDestroyPipelineLayout DestroyPipelineLayout; - PFN_vkCreateSampler CreateSampler; - PFN_vkDestroySampler DestroySampler; - PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; - PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout; - PFN_vkCreateDescriptorPool CreateDescriptorPool; - PFN_vkDestroyDescriptorPool DestroyDescriptorPool; - PFN_vkResetDescriptorPool ResetDescriptorPool; - PFN_vkAllocateDescriptorSets AllocateDescriptorSets; - PFN_vkFreeDescriptorSets FreeDescriptorSets; - PFN_vkUpdateDescriptorSets UpdateDescriptorSets; - PFN_vkCreateFramebuffer CreateFramebuffer; - PFN_vkDestroyFramebuffer DestroyFramebuffer; - PFN_vkCreateRenderPass CreateRenderPass; - PFN_vkDestroyRenderPass DestroyRenderPass; - PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; - PFN_vkCreateCommandPool CreateCommandPool; - PFN_vkDestroyCommandPool DestroyCommandPool; - PFN_vkResetCommandPool ResetCommandPool; - PFN_vkAllocateCommandBuffers AllocateCommandBuffers; - PFN_vkFreeCommandBuffers FreeCommandBuffers; - PFN_vkBeginCommandBuffer BeginCommandBuffer; - PFN_vkEndCommandBuffer EndCommandBuffer; - PFN_vkResetCommandBuffer ResetCommandBuffer; - PFN_vkCmdBindPipeline CmdBindPipeline; - PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; - PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; - PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; - PFN_vkCmdSetViewport CmdSetViewport; - PFN_vkCmdSetScissor CmdSetScissor; - PFN_vkCmdSetLineWidth CmdSetLineWidth; - PFN_vkCmdSetDepthBias CmdSetDepthBias; - PFN_vkCmdSetBlendConstants CmdSetBlendConstants; - PFN_vkCmdSetDepthBounds CmdSetDepthBounds; - PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask; - PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask; - PFN_vkCmdSetStencilReference CmdSetStencilReference; - PFN_vkCmdDraw CmdDraw; - PFN_vkCmdDrawIndexed CmdDrawIndexed; - PFN_vkCmdDrawIndirect CmdDrawIndirect; - PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; - PFN_vkCmdDispatch CmdDispatch; - PFN_vkCmdDispatchIndirect CmdDispatchIndirect; - PFN_vkCmdCopyBuffer CmdCopyBuffer; - PFN_vkCmdCopyImage CmdCopyImage; - PFN_vkCmdBlitImage CmdBlitImage; - PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; - PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; - PFN_vkCmdUpdateBuffer CmdUpdateBuffer; - PFN_vkCmdFillBuffer CmdFillBuffer; - PFN_vkCmdClearColorImage CmdClearColorImage; - PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage; - PFN_vkCmdClearAttachments CmdClearAttachments; - PFN_vkCmdResolveImage CmdResolveImage; - PFN_vkCmdSetEvent CmdSetEvent; - PFN_vkCmdResetEvent CmdResetEvent; - PFN_vkCmdWaitEvents CmdWaitEvents; - PFN_vkCmdPipelineBarrier CmdPipelineBarrier; - PFN_vkCmdBeginQuery CmdBeginQuery; - PFN_vkCmdEndQuery CmdEndQuery; - PFN_vkCmdResetQueryPool CmdResetQueryPool; - PFN_vkCmdWriteTimestamp CmdWriteTimestamp; - PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; - PFN_vkCmdPushConstants CmdPushConstants; - PFN_vkCmdBeginRenderPass CmdBeginRenderPass; - PFN_vkCmdNextSubpass CmdNextSubpass; - PFN_vkCmdEndRenderPass CmdEndRenderPass; - PFN_vkCmdExecuteCommands CmdExecuteCommands; - PFN_vkCreateSwapchainKHR CreateSwapchainKHR; - PFN_vkDestroySwapchainKHR DestroySwapchainKHR; - PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR; - PFN_vkAcquireNextImageKHR AcquireNextImageKHR; - PFN_vkQueuePresentKHR QueuePresentKHR; - PFN_vkCmdDrawIndirectCountAMD CmdDrawIndirectCountAMD; - PFN_vkCmdDrawIndexedIndirectCountAMD CmdDrawIndexedIndirectCountAMD; -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV; -#endif - PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; - PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; - PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; - PFN_vkCmdDebugMarkerBeginEXT CmdDebugMarkerBeginEXT; - PFN_vkCmdDebugMarkerEndEXT CmdDebugMarkerEndEXT; - PFN_vkCmdDebugMarkerInsertEXT CmdDebugMarkerInsertEXT; - // KHR_maintenance1 - PFN_vkTrimCommandPoolKHR TrimCommandPoolKHR; - // EXT_display_control - PFN_vkDisplayPowerControlEXT DisplayPowerControlEXT; - PFN_vkRegisterDeviceEventEXT RegisterDeviceEventEXT; - PFN_vkRegisterDisplayEventEXT RegisterDisplayEventEXT; - PFN_vkGetSwapchainCounterEXT GetSwapchainCounterEXT; - // NVX_device_generated_commands - PFN_vkCmdProcessCommandsNVX CmdProcessCommandsNVX; - PFN_vkCmdReserveSpaceForCommandsNVX CmdReserveSpaceForCommandsNVX; - PFN_vkCreateIndirectCommandsLayoutNVX CreateIndirectCommandsLayoutNVX; - PFN_vkDestroyIndirectCommandsLayoutNVX DestroyIndirectCommandsLayoutNVX; - PFN_vkCreateObjectTableNVX CreateObjectTableNVX; - PFN_vkDestroyObjectTableNVX DestroyObjectTableNVX; - PFN_vkRegisterObjectsNVX RegisterObjectsNVX; - PFN_vkUnregisterObjectsNVX UnregisterObjectsNVX; -} VkLayerDispatchTable; - -typedef struct VkLayerInstanceDispatchTable_ { - PFN_vkGetInstanceProcAddr GetInstanceProcAddr; - PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; - PFN_vkDestroyInstance DestroyInstance; - PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; - PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; - PFN_vkGetPhysicalDeviceImageFormatProperties - GetPhysicalDeviceImageFormatProperties; - PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties - GetPhysicalDeviceSparseImageFormatProperties; - PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; - PFN_vkGetPhysicalDeviceQueueFamilyProperties - GetPhysicalDeviceQueueFamilyProperties; - PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; - PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; - PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties; - PFN_vkDestroySurfaceKHR DestroySurfaceKHR; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR - GetPhysicalDeviceSurfaceCapabilitiesKHR; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR - GetPhysicalDeviceSurfacePresentModesKHR; -#ifdef VK_USE_PLATFORM_MIR_KHR - PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; - PFN_vkGetPhysicalDeviceMirPresentationSupportKHR - GetPhysicalDeviceMirPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR - GetPhysicalDeviceWaylandPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR - GetPhysicalDeviceWin32PresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XCB_KHR - PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR - GetPhysicalDeviceXcbPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_XLIB_KHR - PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR - GetPhysicalDeviceXlibPresentationSupportKHR; -#endif -#ifdef VK_USE_PLATFORM_ANDROID_KHR - PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR; -#endif - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR - GetPhysicalDeviceDisplayPropertiesKHR; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR - GetPhysicalDeviceDisplayPlanePropertiesKHR; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR - GetDisplayPlaneSupportedDisplaysKHR; - PFN_vkGetDisplayModePropertiesKHR - GetDisplayModePropertiesKHR; - PFN_vkCreateDisplayModeKHR - CreateDisplayModeKHR; - PFN_vkGetDisplayPlaneCapabilitiesKHR - GetDisplayPlaneCapabilitiesKHR; - PFN_vkCreateDisplayPlaneSurfaceKHR - CreateDisplayPlaneSurfaceKHR; - // KHR_get_physical_device_properties2 - PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; - PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; - PFN_vkGetPhysicalDeviceFormatProperties2KHR - GetPhysicalDeviceFormatProperties2KHR; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR - GetPhysicalDeviceImageFormatProperties2KHR; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR - GetPhysicalDeviceQueueFamilyProperties2KHR; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR - GetPhysicalDeviceMemoryProperties2KHR; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR - GetPhysicalDeviceSparseImageFormatProperties2KHR; -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - // EXT_acquire_xlib_display - PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; - PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; -#endif - // EXT_debug_report - PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; - PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; - PFN_vkDebugReportMessageEXT DebugReportMessageEXT; - // EXT_direct_mode_display - PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; - // EXT_display_surface_counter - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT - GetPhysicalDeviceSurfaceCapabilities2EXT; - // NV_external_memory_capabilities - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV - GetPhysicalDeviceExternalImageFormatPropertiesNV; - // NVX_device_generated_commands (phys dev commands) - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX - GetPhysicalDeviceGeneratedCommandsPropertiesNVX; -} VkLayerInstanceDispatchTable; - // ------------------------------------------------------------------------------------------------ // CreateInstance and CreateDevice support structures diff --git a/third_party/vulkan/vk_layer_dispatch_table.h b/third_party/vulkan/vk_layer_dispatch_table.h new file mode 100644 index 000000000..d6b3f11a2 --- /dev/null +++ b/third_party/vulkan/vk_layer_dispatch_table.h @@ -0,0 +1,403 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See loader_extension_generator.py for modifications + +/* + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Mark Lobodzinski + * Author: Mark Young + */ + +#pragma once + +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName); + +// Instance function pointer dispatch table +typedef struct VkLayerInstanceDispatchTable_ { + // Manually add in GetPhysicalDeviceProcAddr entry + PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; + + // ---- Core 1_0 commands + PFN_vkCreateInstance CreateInstance; + PFN_vkDestroyInstance DestroyInstance; + PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; + PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; + PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; + PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; + PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; + PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; + PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; + PFN_vkGetInstanceProcAddr GetInstanceProcAddr; + PFN_vkCreateDevice CreateDevice; + PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; + PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; + PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties; + PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; + + // ---- VK_KHR_surface extension commands + PFN_vkDestroySurfaceKHR DestroySurfaceKHR; + PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; + PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; + PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; + PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; + + // ---- VK_KHR_display extension commands + PFN_vkGetPhysicalDeviceDisplayPropertiesKHR GetPhysicalDeviceDisplayPropertiesKHR; + PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR GetPhysicalDeviceDisplayPlanePropertiesKHR; + PFN_vkGetDisplayPlaneSupportedDisplaysKHR GetDisplayPlaneSupportedDisplaysKHR; + PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR; + PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR; + PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR; + PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR; + + // ---- VK_KHR_xlib_surface extension commands +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_XLIB_KHR + PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XLIB_KHR + + // ---- VK_KHR_xcb_surface extension commands +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR; +#endif // VK_USE_PLATFORM_XCB_KHR +#ifdef VK_USE_PLATFORM_XCB_KHR + PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR; +#endif // VK_USE_PLATFORM_XCB_KHR + + // ---- VK_KHR_wayland_surface extension commands +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR; +#endif // VK_USE_PLATFORM_WAYLAND_KHR + + // ---- VK_KHR_mir_surface extension commands +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR; +#endif // VK_USE_PLATFORM_MIR_KHR +#ifdef VK_USE_PLATFORM_MIR_KHR + PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR; +#endif // VK_USE_PLATFORM_MIR_KHR + + // ---- VK_KHR_android_surface extension commands +#ifdef VK_USE_PLATFORM_ANDROID_KHR + PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR; +#endif // VK_USE_PLATFORM_ANDROID_KHR + + // ---- VK_KHR_win32_surface extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR; +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHR_get_physical_device_properties2 extension commands + PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; + PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; + PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR; + PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR; + PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR; + PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR; + PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR; + + // ---- VK_EXT_debug_report extension commands + PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; + PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; + PFN_vkDebugReportMessageEXT DebugReportMessageEXT; + + // ---- VK_NV_external_memory_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV GetPhysicalDeviceExternalImageFormatPropertiesNV; + + // ---- VK_KHX_device_group extension commands + PFN_vkGetPhysicalDevicePresentRectanglesKHX GetPhysicalDevicePresentRectanglesKHX; + + // ---- VK_NN_vi_surface extension commands +#ifdef VK_USE_PLATFORM_VI_NN + PFN_vkCreateViSurfaceNN CreateViSurfaceNN; +#endif // VK_USE_PLATFORM_VI_NN + + // ---- VK_KHX_device_group_creation extension commands + PFN_vkEnumeratePhysicalDeviceGroupsKHX EnumeratePhysicalDeviceGroupsKHX; + + // ---- VK_KHX_external_memory_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX GetPhysicalDeviceExternalBufferPropertiesKHX; + + // ---- VK_KHX_external_semaphore_capabilities extension commands + PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX GetPhysicalDeviceExternalSemaphorePropertiesKHX; + + // ---- VK_NVX_device_generated_commands extension commands + PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; + + // ---- VK_EXT_direct_mode_display extension commands + PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; + + // ---- VK_EXT_acquire_xlib_display extension commands +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT; +#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT + + // ---- VK_EXT_display_surface_counter extension commands + PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT GetPhysicalDeviceSurfaceCapabilities2EXT; + + // ---- VK_MVK_ios_surface extension commands +#ifdef VK_USE_PLATFORM_IOS_MVK + PFN_vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK; +#endif // VK_USE_PLATFORM_IOS_MVK + + // ---- VK_MVK_macos_surface extension commands +#ifdef VK_USE_PLATFORM_MACOS_MVK + PFN_vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK; +#endif // VK_USE_PLATFORM_MACOS_MVK +} VkLayerInstanceDispatchTable; + +// Device function pointer dispatch table +typedef struct VkLayerDispatchTable_ { + + // ---- Core 1_0 commands + PFN_vkGetDeviceProcAddr GetDeviceProcAddr; + PFN_vkDestroyDevice DestroyDevice; + PFN_vkGetDeviceQueue GetDeviceQueue; + PFN_vkQueueSubmit QueueSubmit; + PFN_vkQueueWaitIdle QueueWaitIdle; + PFN_vkDeviceWaitIdle DeviceWaitIdle; + PFN_vkAllocateMemory AllocateMemory; + PFN_vkFreeMemory FreeMemory; + PFN_vkMapMemory MapMemory; + PFN_vkUnmapMemory UnmapMemory; + PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; + PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; + PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment; + PFN_vkBindBufferMemory BindBufferMemory; + PFN_vkBindImageMemory BindImageMemory; + PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements; + PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements; + PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements; + PFN_vkQueueBindSparse QueueBindSparse; + PFN_vkCreateFence CreateFence; + PFN_vkDestroyFence DestroyFence; + PFN_vkResetFences ResetFences; + PFN_vkGetFenceStatus GetFenceStatus; + PFN_vkWaitForFences WaitForFences; + PFN_vkCreateSemaphore CreateSemaphore; + PFN_vkDestroySemaphore DestroySemaphore; + PFN_vkCreateEvent CreateEvent; + PFN_vkDestroyEvent DestroyEvent; + PFN_vkGetEventStatus GetEventStatus; + PFN_vkSetEvent SetEvent; + PFN_vkResetEvent ResetEvent; + PFN_vkCreateQueryPool CreateQueryPool; + PFN_vkDestroyQueryPool DestroyQueryPool; + PFN_vkGetQueryPoolResults GetQueryPoolResults; + PFN_vkCreateBuffer CreateBuffer; + PFN_vkDestroyBuffer DestroyBuffer; + PFN_vkCreateBufferView CreateBufferView; + PFN_vkDestroyBufferView DestroyBufferView; + PFN_vkCreateImage CreateImage; + PFN_vkDestroyImage DestroyImage; + PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout; + PFN_vkCreateImageView CreateImageView; + PFN_vkDestroyImageView DestroyImageView; + PFN_vkCreateShaderModule CreateShaderModule; + PFN_vkDestroyShaderModule DestroyShaderModule; + PFN_vkCreatePipelineCache CreatePipelineCache; + PFN_vkDestroyPipelineCache DestroyPipelineCache; + PFN_vkGetPipelineCacheData GetPipelineCacheData; + PFN_vkMergePipelineCaches MergePipelineCaches; + PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines; + PFN_vkCreateComputePipelines CreateComputePipelines; + PFN_vkDestroyPipeline DestroyPipeline; + PFN_vkCreatePipelineLayout CreatePipelineLayout; + PFN_vkDestroyPipelineLayout DestroyPipelineLayout; + PFN_vkCreateSampler CreateSampler; + PFN_vkDestroySampler DestroySampler; + PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; + PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout; + PFN_vkCreateDescriptorPool CreateDescriptorPool; + PFN_vkDestroyDescriptorPool DestroyDescriptorPool; + PFN_vkResetDescriptorPool ResetDescriptorPool; + PFN_vkAllocateDescriptorSets AllocateDescriptorSets; + PFN_vkFreeDescriptorSets FreeDescriptorSets; + PFN_vkUpdateDescriptorSets UpdateDescriptorSets; + PFN_vkCreateFramebuffer CreateFramebuffer; + PFN_vkDestroyFramebuffer DestroyFramebuffer; + PFN_vkCreateRenderPass CreateRenderPass; + PFN_vkDestroyRenderPass DestroyRenderPass; + PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; + PFN_vkCreateCommandPool CreateCommandPool; + PFN_vkDestroyCommandPool DestroyCommandPool; + PFN_vkResetCommandPool ResetCommandPool; + PFN_vkAllocateCommandBuffers AllocateCommandBuffers; + PFN_vkFreeCommandBuffers FreeCommandBuffers; + PFN_vkBeginCommandBuffer BeginCommandBuffer; + PFN_vkEndCommandBuffer EndCommandBuffer; + PFN_vkResetCommandBuffer ResetCommandBuffer; + PFN_vkCmdBindPipeline CmdBindPipeline; + PFN_vkCmdSetViewport CmdSetViewport; + PFN_vkCmdSetScissor CmdSetScissor; + PFN_vkCmdSetLineWidth CmdSetLineWidth; + PFN_vkCmdSetDepthBias CmdSetDepthBias; + PFN_vkCmdSetBlendConstants CmdSetBlendConstants; + PFN_vkCmdSetDepthBounds CmdSetDepthBounds; + PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask; + PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask; + PFN_vkCmdSetStencilReference CmdSetStencilReference; + PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; + PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; + PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; + PFN_vkCmdDraw CmdDraw; + PFN_vkCmdDrawIndexed CmdDrawIndexed; + PFN_vkCmdDrawIndirect CmdDrawIndirect; + PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; + PFN_vkCmdDispatch CmdDispatch; + PFN_vkCmdDispatchIndirect CmdDispatchIndirect; + PFN_vkCmdCopyBuffer CmdCopyBuffer; + PFN_vkCmdCopyImage CmdCopyImage; + PFN_vkCmdBlitImage CmdBlitImage; + PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; + PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; + PFN_vkCmdUpdateBuffer CmdUpdateBuffer; + PFN_vkCmdFillBuffer CmdFillBuffer; + PFN_vkCmdClearColorImage CmdClearColorImage; + PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage; + PFN_vkCmdClearAttachments CmdClearAttachments; + PFN_vkCmdResolveImage CmdResolveImage; + PFN_vkCmdSetEvent CmdSetEvent; + PFN_vkCmdResetEvent CmdResetEvent; + PFN_vkCmdWaitEvents CmdWaitEvents; + PFN_vkCmdPipelineBarrier CmdPipelineBarrier; + PFN_vkCmdBeginQuery CmdBeginQuery; + PFN_vkCmdEndQuery CmdEndQuery; + PFN_vkCmdResetQueryPool CmdResetQueryPool; + PFN_vkCmdWriteTimestamp CmdWriteTimestamp; + PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; + PFN_vkCmdPushConstants CmdPushConstants; + PFN_vkCmdBeginRenderPass CmdBeginRenderPass; + PFN_vkCmdNextSubpass CmdNextSubpass; + PFN_vkCmdEndRenderPass CmdEndRenderPass; + PFN_vkCmdExecuteCommands CmdExecuteCommands; + + // ---- VK_KHR_swapchain extension commands + PFN_vkCreateSwapchainKHR CreateSwapchainKHR; + PFN_vkDestroySwapchainKHR DestroySwapchainKHR; + PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR; + PFN_vkAcquireNextImageKHR AcquireNextImageKHR; + PFN_vkQueuePresentKHR QueuePresentKHR; + + // ---- VK_KHR_display_swapchain extension commands + PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR; + + // ---- VK_KHR_maintenance1 extension commands + PFN_vkTrimCommandPoolKHR TrimCommandPoolKHR; + + // ---- VK_KHR_push_descriptor extension commands + PFN_vkCmdPushDescriptorSetKHR CmdPushDescriptorSetKHR; + + // ---- VK_KHR_descriptor_update_template extension commands + PFN_vkCreateDescriptorUpdateTemplateKHR CreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR DestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR UpdateDescriptorSetWithTemplateKHR; + PFN_vkCmdPushDescriptorSetWithTemplateKHR CmdPushDescriptorSetWithTemplateKHR; + + // ---- VK_EXT_debug_marker extension commands + PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; + PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; + PFN_vkCmdDebugMarkerBeginEXT CmdDebugMarkerBeginEXT; + PFN_vkCmdDebugMarkerEndEXT CmdDebugMarkerEndEXT; + PFN_vkCmdDebugMarkerInsertEXT CmdDebugMarkerInsertEXT; + + // ---- VK_AMD_draw_indirect_count extension commands + PFN_vkCmdDrawIndirectCountAMD CmdDrawIndirectCountAMD; + PFN_vkCmdDrawIndexedIndirectCountAMD CmdDrawIndexedIndirectCountAMD; + + // ---- VK_NV_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHR + PFN_vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV; +#endif // VK_USE_PLATFORM_WIN32_KHR + + // ---- VK_KHX_device_group extension commands + PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX GetDeviceGroupPeerMemoryFeaturesKHX; + PFN_vkBindBufferMemory2KHX BindBufferMemory2KHX; + PFN_vkBindImageMemory2KHX BindImageMemory2KHX; + PFN_vkCmdSetDeviceMaskKHX CmdSetDeviceMaskKHX; + PFN_vkGetDeviceGroupPresentCapabilitiesKHX GetDeviceGroupPresentCapabilitiesKHX; + PFN_vkGetDeviceGroupSurfacePresentModesKHX GetDeviceGroupSurfacePresentModesKHX; + PFN_vkAcquireNextImage2KHX AcquireNextImage2KHX; + PFN_vkCmdDispatchBaseKHX CmdDispatchBaseKHX; + + // ---- VK_KHX_external_memory_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + PFN_vkGetMemoryWin32HandleKHX GetMemoryWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + PFN_vkGetMemoryWin32HandlePropertiesKHX GetMemoryWin32HandlePropertiesKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_memory_fd extension commands + PFN_vkGetMemoryFdKHX GetMemoryFdKHX; + PFN_vkGetMemoryFdPropertiesKHX GetMemoryFdPropertiesKHX; + + // ---- VK_KHX_external_semaphore_win32 extension commands +#ifdef VK_USE_PLATFORM_WIN32_KHX + PFN_vkImportSemaphoreWin32HandleKHX ImportSemaphoreWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX +#ifdef VK_USE_PLATFORM_WIN32_KHX + PFN_vkGetSemaphoreWin32HandleKHX GetSemaphoreWin32HandleKHX; +#endif // VK_USE_PLATFORM_WIN32_KHX + + // ---- VK_KHX_external_semaphore_fd extension commands + PFN_vkImportSemaphoreFdKHX ImportSemaphoreFdKHX; + PFN_vkGetSemaphoreFdKHX GetSemaphoreFdKHX; + + // ---- VK_NVX_device_generated_commands extension commands + PFN_vkCmdProcessCommandsNVX CmdProcessCommandsNVX; + PFN_vkCmdReserveSpaceForCommandsNVX CmdReserveSpaceForCommandsNVX; + PFN_vkCreateIndirectCommandsLayoutNVX CreateIndirectCommandsLayoutNVX; + PFN_vkDestroyIndirectCommandsLayoutNVX DestroyIndirectCommandsLayoutNVX; + PFN_vkCreateObjectTableNVX CreateObjectTableNVX; + PFN_vkDestroyObjectTableNVX DestroyObjectTableNVX; + PFN_vkRegisterObjectsNVX RegisterObjectsNVX; + PFN_vkUnregisterObjectsNVX UnregisterObjectsNVX; + + // ---- VK_NV_clip_space_w_scaling extension commands + PFN_vkCmdSetViewportWScalingNV CmdSetViewportWScalingNV; + + // ---- VK_EXT_display_control extension commands + PFN_vkDisplayPowerControlEXT DisplayPowerControlEXT; + PFN_vkRegisterDeviceEventEXT RegisterDeviceEventEXT; + PFN_vkRegisterDisplayEventEXT RegisterDisplayEventEXT; + PFN_vkGetSwapchainCounterEXT GetSwapchainCounterEXT; + + // ---- VK_GOOGLE_display_timing extension commands + PFN_vkGetRefreshCycleDurationGOOGLE GetRefreshCycleDurationGOOGLE; + PFN_vkGetPastPresentationTimingGOOGLE GetPastPresentationTimingGOOGLE; + + // ---- VK_EXT_discard_rectangles extension commands + PFN_vkCmdSetDiscardRectangleEXT CmdSetDiscardRectangleEXT; + + // ---- VK_EXT_hdr_metadata extension commands + PFN_vkSetHdrMetadataEXT SetHdrMetadataEXT; +} VkLayerDispatchTable; + + diff --git a/third_party/vulkan/vk_platform.h b/third_party/vulkan/vk_platform.h index 0fa62ee23..72f80493c 100644 --- a/third_party/vulkan/vk_platform.h +++ b/third_party/vulkan/vk_platform.h @@ -2,7 +2,7 @@ // File: vk_platform.h // /* -** Copyright (c) 2014-2015 The Khronos Group Inc. +** Copyright (c) 2014-2017 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. diff --git a/third_party/vulkan/vulkan.h b/third_party/vulkan/vulkan.h index 81dedf777..ef0c24678 100644 --- a/third_party/vulkan/vulkan.h +++ b/third_party/vulkan/vulkan.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 39 +#define VK_HEADER_VERSION 46 #define VK_NULL_HANDLE 0 @@ -146,6 +146,7 @@ typedef enum VkResult { VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX = -1000072003, VK_RESULT_BEGIN_RANGE = VK_ERROR_FRAGMENTED_POOL, VK_RESULT_END_RANGE = VK_INCOMPLETE, VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FRAGMENTED_POOL + 1), @@ -221,6 +222,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX = 1000053000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX = 1000053001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX = 1000053002, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, @@ -235,19 +239,70 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX = 1000060000, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX = 1000060001, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX = 1000060002, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX = 1000060003, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX = 1000060004, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX = 1000060005, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX = 1000060006, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX = 1000060007, + VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX = 1000060008, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX = 1000060009, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX = 1000060010, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX = 1000060011, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX = 1000060012, VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX = 1000070001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX = 1000071000, + VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX = 1000071001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX = 1000071002, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX = 1000071003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX = 1000071004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX = 1000071005, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX = 1000071006, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX = 1000071007, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX = 1000072000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX = 1000072001, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX = 1000072002, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX = 1000073000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX = 1000073001, + VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX = 1000073002, + VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX = 1000074000, + VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX = 1000074001, + VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX = 1000075000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX = 1000076000, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX = 1000076001, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX = 1000077000, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078001, + VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX = 1000078002, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX = 1000079000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, + VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO, VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1), @@ -716,6 +771,8 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE, VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1), @@ -881,6 +938,7 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_BIND_SFR_BIT_KHX = 0x00000040, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkImageCreateFlagBits; @@ -919,6 +977,7 @@ typedef VkFlags VkMemoryPropertyFlags; typedef enum VkMemoryHeapFlagBits { VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX = 0x00000002, VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkMemoryHeapFlagBits; typedef VkFlags VkMemoryHeapFlags; @@ -1036,6 +1095,8 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX = 0x00000008, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHX = 0x00000010, VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkPipelineCreateFlagBits; typedef VkFlags VkPipelineCreateFlags; @@ -1082,6 +1143,11 @@ typedef VkFlags VkPipelineDynamicStateCreateFlags; typedef VkFlags VkPipelineLayoutCreateFlags; typedef VkFlags VkShaderStageFlags; typedef VkFlags VkSamplerCreateFlags; + +typedef enum VkDescriptorSetLayoutCreateFlagBits { + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkDescriptorSetLayoutCreateFlagBits; typedef VkFlags VkDescriptorSetLayoutCreateFlags; typedef enum VkDescriptorPoolCreateFlagBits { @@ -1098,6 +1164,12 @@ typedef enum VkAttachmentDescriptionFlagBits { VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkAttachmentDescriptionFlagBits; typedef VkFlags VkAttachmentDescriptionFlags; + +typedef enum VkSubpassDescriptionFlagBits { + VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX = 0x00000001, + VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002, + VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF +} VkSubpassDescriptionFlagBits; typedef VkFlags VkSubpassDescriptionFlags; typedef enum VkAccessFlagBits { @@ -1126,6 +1198,8 @@ typedef VkFlags VkAccessFlags; typedef enum VkDependencyFlagBits { VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX = 0x00000002, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX = 0x00000004, VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDependencyFlagBits; typedef VkFlags VkDependencyFlags; @@ -2388,7 +2462,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); typedef void (VKAPI_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z); +typedef void (VKAPI_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef void (VKAPI_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); typedef void (VKAPI_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); @@ -3024,9 +3098,9 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect( VKAPI_ATTR void VKAPI_CALL vkCmdDispatch( VkCommandBuffer commandBuffer, - uint32_t x, - uint32_t y, - uint32_t z); + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect( VkCommandBuffer commandBuffer, @@ -3225,18 +3299,19 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) typedef enum VkColorSpaceKHR { VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001, - VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002, - VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003, - VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004, - VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005, - VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006, - VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007, - VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008, - VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009, - VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010, + VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104001, + VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = 1000104002, + VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104003, + VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104004, + VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104005, + VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104006, + VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104007, + VK_COLOR_SPACE_HDR10_ST2084_EXT = 1000104008, + VK_COLOR_SPACE_DOLBYVISION_EXT = 1000104009, + VK_COLOR_SPACE_HDR10_HLG_EXT = 1000104010, VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, + VK_COLOR_SPACE_PASS_THROUGH_EXT = 1000104013, VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), @@ -3339,6 +3414,11 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) #define VK_KHR_SWAPCHAIN_SPEC_VERSION 68 #define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" + +typedef enum VkSwapchainCreateFlagBitsKHR { + VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX = 0x00000001, + VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; typedef struct VkSwapchainCreateInfoKHR { @@ -3639,7 +3719,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( #define VK_KHR_wayland_surface 1 #include -#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5 +#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 #define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; @@ -3902,10 +3982,129 @@ VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( VkCommandPoolTrimFlagsKHR flags); #endif +#define VK_KHR_push_descriptor 1 +#define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 1 +#define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" + +typedef struct VkPhysicalDevicePushDescriptorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxPushDescriptors; +} VkPhysicalDevicePushDescriptorPropertiesKHR; + + +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetKHR)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetKHR( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set, + uint32_t descriptorWriteCount, + const VkWriteDescriptorSet* pDescriptorWrites); +#endif + +#define VK_KHR_incremental_present 1 +#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 +#define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" + +typedef struct VkRectLayerKHR { + VkOffset2D offset; + VkExtent2D extent; + uint32_t layer; +} VkRectLayerKHR; + +typedef struct VkPresentRegionKHR { + uint32_t rectangleCount; + const VkRectLayerKHR* pRectangles; +} VkPresentRegionKHR; + +typedef struct VkPresentRegionsKHR { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentRegionKHR* pRegions; +} VkPresentRegionsKHR; + + + +#define VK_KHR_descriptor_update_template 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) + +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1 +#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME "VK_KHR_descriptor_update_template" + + +typedef enum VkDescriptorUpdateTemplateTypeKHR { + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE_KHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_RANGE_SIZE_KHR = (VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR + 1), + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkDescriptorUpdateTemplateTypeKHR; + +typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; + +typedef struct VkDescriptorUpdateTemplateEntryKHR { + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntryKHR; + +typedef struct VkDescriptorUpdateTemplateCreateInfoKHR { + VkStructureType sType; + void* pNext; + VkDescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateTypeKHR templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfoKHR; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateDescriptorUpdateTemplateKHR)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); +typedef void (VKAPI_PTR *PFN_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR( + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate); + +VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR( + VkDevice device, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( + VkDevice device, + VkDescriptorSet descriptorSet, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + const void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout layout, + uint32_t set, + const void* pData); +#endif + #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4 +#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 6 #define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" #define VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT @@ -3944,6 +4143,7 @@ typedef enum VkDebugReportObjectTypeEXT { VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = 1000085000, VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = (VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT + 1), @@ -4060,7 +4260,7 @@ typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { #define VK_EXT_debug_marker 1 -#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3 +#define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 #define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" typedef struct VkDebugMarkerObjectNameInfoEXT { @@ -4188,6 +4388,38 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( #define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" +#define VK_KHX_multiview 1 +#define VK_KHX_MULTIVIEW_SPEC_VERSION 1 +#define VK_KHX_MULTIVIEW_EXTENSION_NAME "VK_KHX_multiview" + +typedef struct VkRenderPassMultiviewCreateInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; +} VkRenderPassMultiviewCreateInfoKHX; + +typedef struct VkPhysicalDeviceMultiviewFeaturesKHX { + VkStructureType sType; + void* pNext; + VkBool32 multiview; + VkBool32 multiviewGeometryShader; + VkBool32 multiviewTessellationShader; +} VkPhysicalDeviceMultiviewFeaturesKHX; + +typedef struct VkPhysicalDeviceMultiviewPropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; +} VkPhysicalDeviceMultiviewPropertiesKHX; + + + #define VK_IMG_format_pvrtc 1 #define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 #define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" @@ -4306,6 +4538,204 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { #endif /* VK_USE_PLATFORM_WIN32_KHR */ +#define VK_KHX_device_group 1 +#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 +#define VK_KHX_DEVICE_GROUP_SPEC_VERSION 1 +#define VK_KHX_DEVICE_GROUP_EXTENSION_NAME "VK_KHX_device_group" + + +typedef enum VkPeerMemoryFeatureFlagBitsKHX { + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX = 0x00000001, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX = 0x00000002, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX = 0x00000004, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX = 0x00000008, + VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkPeerMemoryFeatureFlagBitsKHX; +typedef VkFlags VkPeerMemoryFeatureFlagsKHX; + +typedef enum VkMemoryAllocateFlagBitsKHX { + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX = 0x00000001, + VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkMemoryAllocateFlagBitsKHX; +typedef VkFlags VkMemoryAllocateFlagsKHX; + +typedef enum VkDeviceGroupPresentModeFlagBitsKHX { + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX = 0x00000001, + VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX = 0x00000002, + VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX = 0x00000004, + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX = 0x00000008, + VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkDeviceGroupPresentModeFlagBitsKHX; +typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; + +typedef struct VkMemoryAllocateFlagsInfoKHX { + VkStructureType sType; + const void* pNext; + VkMemoryAllocateFlagsKHX flags; + uint32_t deviceMask; +} VkMemoryAllocateFlagsInfoKHX; + +typedef struct VkBindBufferMemoryInfoKHX { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; +} VkBindBufferMemoryInfoKHX; + +typedef struct VkBindImageMemoryInfoKHX { + VkStructureType sType; + const void* pNext; + VkImage image; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t SFRRectCount; + const VkRect2D* pSFRRects; +} VkBindImageMemoryInfoKHX; + +typedef struct VkDeviceGroupRenderPassBeginInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const VkRect2D* pDeviceRenderAreas; +} VkDeviceGroupRenderPassBeginInfoKHX; + +typedef struct VkDeviceGroupCommandBufferBeginInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t deviceMask; +} VkDeviceGroupCommandBufferBeginInfoKHX; + +typedef struct VkDeviceGroupSubmitInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; +} VkDeviceGroupSubmitInfoKHX; + +typedef struct VkDeviceGroupBindSparseInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; +} VkDeviceGroupBindSparseInfoKHX; + +typedef struct VkDeviceGroupPresentCapabilitiesKHX { + VkStructureType sType; + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + VkDeviceGroupPresentModeFlagsKHX modes; +} VkDeviceGroupPresentCapabilitiesKHX; + +typedef struct VkImageSwapchainCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHX; + +typedef struct VkBindImageMemorySwapchainInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndex; +} VkBindImageMemorySwapchainInfoKHX; + +typedef struct VkAcquireNextImageInfoKHX { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint64_t timeout; + VkSemaphore semaphore; + VkFence fence; + uint32_t deviceMask; +} VkAcquireNextImageInfoKHX; + +typedef struct VkDeviceGroupPresentInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + VkDeviceGroupPresentModeFlagBitsKHX mode; +} VkDeviceGroupPresentInfoKHX; + +typedef struct VkDeviceGroupSwapchainCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkDeviceGroupPresentModeFlagsKHX modes; +} VkDeviceGroupSwapchainCreateInfoKHX; + + +typedef void (VKAPI_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); +typedef VkResult (VKAPI_PTR *PFN_vkBindBufferMemory2KHX)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfoKHX* pBindInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBindImageMemory2KHX)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHX* pBindInfos); +typedef void (VKAPI_PTR *PFN_vkCmdSetDeviceMaskKHX)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHX)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHX)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHX* pModes); +typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImage2KHX)(VkDevice device, const VkAcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchBaseKHX)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHX)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeaturesKHX( + VkDevice device, + uint32_t heapIndex, + uint32_t localDeviceIndex, + uint32_t remoteDeviceIndex, + VkPeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindBufferMemoryInfoKHX* pBindInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHX( + VkDevice device, + uint32_t bindInfoCount, + const VkBindImageMemoryInfoKHX* pBindInfos); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMaskKHX( + VkCommandBuffer commandBuffer, + uint32_t deviceMask); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHX( + VkDevice device, + VkDeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHX( + VkDevice device, + VkSurfaceKHR surface, + VkDeviceGroupPresentModeFlagsKHX* pModes); + +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHX( + VkDevice device, + const VkAcquireNextImageInfoKHX* pAcquireInfo, + uint32_t* pImageIndex); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHX( + VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDevicePresentRectanglesKHX( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + uint32_t* pRectCount, + VkRect2D* pRects); +#endif + #define VK_EXT_validation_flags 1 #define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 #define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" @@ -4364,6 +4794,370 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( #define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" +#define VK_KHX_device_group_creation 1 +#define VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION 1 +#define VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHX_device_group_creation" + +typedef struct VkPhysicalDeviceGroupPropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t physicalDeviceCount; + VkPhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + VkBool32 subsetAllocation; +} VkPhysicalDeviceGroupPropertiesKHX; + +typedef struct VkDeviceGroupDeviceCreateInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t physicalDeviceCount; + const VkPhysicalDevice* pPhysicalDevices; +} VkDeviceGroupDeviceCreateInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceGroupsKHX)(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHX( + VkInstance instance, + uint32_t* pPhysicalDeviceGroupCount, + VkPhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties); +#endif + +#define VK_KHX_external_memory_capabilities 1 +#define VK_LUID_SIZE_KHX 8 +#define VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHX_external_memory_capabilities" + + +typedef enum VkExternalMemoryHandleTypeFlagBitsKHX { + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX = 0x00000001, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX = 0x00000002, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX = 0x00000004, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHX = 0x00000008, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHX = 0x00000010, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHX = 0x00000020, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHX = 0x00000040, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalMemoryHandleTypeFlagBitsKHX; +typedef VkFlags VkExternalMemoryHandleTypeFlagsKHX; + +typedef enum VkExternalMemoryFeatureFlagBitsKHX { + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHX = 0x00000001, + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHX = 0x00000002, + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHX = 0x00000004, + VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalMemoryFeatureFlagBitsKHX; +typedef VkFlags VkExternalMemoryFeatureFlagsKHX; + +typedef struct VkExternalMemoryPropertiesKHX { + VkExternalMemoryFeatureFlagsKHX externalMemoryFeatures; + VkExternalMemoryHandleTypeFlagsKHX exportFromImportedHandleTypes; + VkExternalMemoryHandleTypeFlagsKHX compatibleHandleTypes; +} VkExternalMemoryPropertiesKHX; + +typedef struct VkPhysicalDeviceExternalImageFormatInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalImageFormatInfoKHX; + +typedef struct VkExternalImageFormatPropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalMemoryPropertiesKHX externalMemoryProperties; +} VkExternalImageFormatPropertiesKHX; + +typedef struct VkPhysicalDeviceExternalBufferInfoKHX { + VkStructureType sType; + const void* pNext; + VkBufferCreateFlags flags; + VkBufferUsageFlags usage; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalBufferInfoKHX; + +typedef struct VkExternalBufferPropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalMemoryPropertiesKHX externalMemoryProperties; +} VkExternalBufferPropertiesKHX; + +typedef struct VkPhysicalDeviceIDPropertiesKHX { + VkStructureType sType; + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE_KHX]; + VkBool32 deviceLUIDValid; +} VkPhysicalDeviceIDPropertiesKHX; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, VkExternalBufferPropertiesKHX* pExternalBufferProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, + VkExternalBufferPropertiesKHX* pExternalBufferProperties); +#endif + +#define VK_KHX_external_memory 1 +#define VK_KHX_EXTERNAL_MEMORY_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHX_external_memory" +#define VK_QUEUE_FAMILY_EXTERNAL_KHX (~0U-1) + +typedef struct VkExternalMemoryImageCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExternalMemoryImageCreateInfoKHX; + +typedef struct VkExternalMemoryBufferCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExternalMemoryBufferCreateInfoKHX; + +typedef struct VkExportMemoryAllocateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagsKHX handleTypes; +} VkExportMemoryAllocateInfoKHX; + + + +#ifdef VK_USE_PLATFORM_WIN32_KHX +#define VK_KHX_external_memory_win32 1 +#define VK_KHX_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHX_external_memory_win32" + +typedef struct VkImportMemoryWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; + HANDLE handle; +} VkImportMemoryWin32HandleInfoKHX; + +typedef struct VkExportMemoryWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportMemoryWin32HandleInfoKHX; + +typedef struct VkMemoryWin32HandlePropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryWin32HandlePropertiesKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHX)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHX)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + HANDLE handle, + VkMemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties); +#endif +#endif /* VK_USE_PLATFORM_WIN32_KHX */ + +#define VK_KHX_external_memory_fd 1 +#define VK_KHX_EXTERNAL_MEMORY_FD_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME "VK_KHX_external_memory_fd" + +typedef struct VkImportMemoryFdInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalMemoryHandleTypeFlagBitsKHX handleType; + int fd; +} VkImportMemoryFdInfoKHX; + +typedef struct VkMemoryFdPropertiesKHX { + VkStructureType sType; + void* pNext; + uint32_t memoryTypeBits; +} VkMemoryFdPropertiesKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdKHX)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd); +typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryFdPropertiesKHX)(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, VkMemoryFdPropertiesKHX* pMemoryFdProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdKHX( + VkDevice device, + VkDeviceMemory memory, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int* pFd); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHX( + VkDevice device, + VkExternalMemoryHandleTypeFlagBitsKHX handleType, + int fd, + VkMemoryFdPropertiesKHX* pMemoryFdProperties); +#endif + +#ifdef VK_USE_PLATFORM_WIN32_KHR +#define VK_KHX_win32_keyed_mutex 1 +#define VK_KHX_WIN32_KEYED_MUTEX_SPEC_VERSION 1 +#define VK_KHX_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHX_win32_keyed_mutex" + +typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t acquireCount; + const VkDeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const VkDeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; +} VkWin32KeyedMutexAcquireReleaseInfoKHX; + + +#endif /* VK_USE_PLATFORM_WIN32_KHR */ + +#define VK_KHX_external_semaphore_capabilities 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHX_external_semaphore_capabilities" + + +typedef enum VkExternalSemaphoreHandleTypeFlagBitsKHX { + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX = 0x00000001, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX = 0x00000002, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX = 0x00000004, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHX = 0x00000008, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX = 0x00000010, + VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalSemaphoreHandleTypeFlagBitsKHX; +typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHX; + +typedef enum VkExternalSemaphoreFeatureFlagBitsKHX { + VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX = 0x00000001, + VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX = 0x00000002, + VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM_KHX = 0x7FFFFFFF +} VkExternalSemaphoreFeatureFlagBitsKHX; +typedef VkFlags VkExternalSemaphoreFeatureFlagsKHX; + +typedef struct VkPhysicalDeviceExternalSemaphoreInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType; +} VkPhysicalDeviceExternalSemaphoreInfoKHX; + +typedef struct VkExternalSemaphorePropertiesKHX { + VkStructureType sType; + void* pNext; + VkExternalSemaphoreHandleTypeFlagsKHX exportFromImportedHandleTypes; + VkExternalSemaphoreHandleTypeFlagsKHX compatibleHandleTypes; + VkExternalSemaphoreFeatureFlagsKHX externalSemaphoreFeatures; +} VkExternalSemaphorePropertiesKHX; + + +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, + VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties); +#endif + +#define VK_KHX_external_semaphore 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHX_external_semaphore" + +typedef struct VkExportSemaphoreCreateInfoKHX { + VkStructureType sType; + const void* pNext; + VkExternalSemaphoreHandleTypeFlagsKHX handleTypes; +} VkExportSemaphoreCreateInfoKHX; + + + +#ifdef VK_USE_PLATFORM_WIN32_KHX +#define VK_KHX_external_semaphore_win32 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHX_external_semaphore_win32" + +typedef struct VkImportSemaphoreWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagsKHX handleType; + HANDLE handle; +} VkImportSemaphoreWin32HandleInfoKHX; + +typedef struct VkExportSemaphoreWin32HandleInfoKHX { + VkStructureType sType; + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHX; + +typedef struct VkD3D12FenceSubmitInfoKHX { + VkStructureType sType; + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHX)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHX)(VkDevice device, VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHX( + VkDevice device, + const VkImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + HANDLE* pHandle); +#endif +#endif /* VK_USE_PLATFORM_WIN32_KHX */ + +#define VK_KHX_external_semaphore_fd 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 +#define VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHX_external_semaphore_fd" + +typedef struct VkImportSemaphoreFdInfoKHX { + VkStructureType sType; + const void* pNext; + VkSemaphore semaphore; + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType; + int fd; +} VkImportSemaphoreFdInfoKHX; + + +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHX)(VkDevice device, const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHX)(VkDevice device, VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHX( + VkDevice device, + const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHX( + VkDevice device, + VkSemaphore semaphore, + VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, + int* pFd); +#endif + #define VK_NVX_device_generated_commands 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkObjectTableNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNVX) @@ -4591,6 +5385,34 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( VkDeviceGeneratedCommandsLimitsNVX* pLimits); #endif +#define VK_NV_clip_space_w_scaling 1 +#define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 +#define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" + +typedef struct VkViewportWScalingNV { + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + +typedef struct VkPipelineViewportWScalingStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 viewportWScalingEnable; + uint32_t viewportCount; + const VkViewportWScalingNV* pViewportWScalings; +} VkPipelineViewportWScalingStateCreateInfoNV; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportWScalingNV* pViewportWScalings); +#endif + #define VK_EXT_direct_mode_display 1 #define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1 #define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display" @@ -4751,10 +5573,248 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( uint64_t* pCounterValue); #endif -#define VK_EXT_swapchain_colorspace 1 -#define VK_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 1 -#define VK_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" +#define VK_GOOGLE_display_timing 1 +#define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1 +#define VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME "VK_GOOGLE_display_timing" +typedef struct VkRefreshCycleDurationGOOGLE { + uint64_t refreshDuration; +} VkRefreshCycleDurationGOOGLE; + +typedef struct VkPastPresentationTimingGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; + uint64_t actualPresentTime; + uint64_t earliestPresentTime; + uint64_t presentMargin; +} VkPastPresentationTimingGOOGLE; + +typedef struct VkPresentTimeGOOGLE { + uint32_t presentID; + uint64_t desiredPresentTime; +} VkPresentTimeGOOGLE; + +typedef struct VkPresentTimesInfoGOOGLE { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentTimeGOOGLE* pTimes; +} VkPresentTimesInfoGOOGLE; + + +typedef VkResult (VKAPI_PTR *PFN_vkGetRefreshCycleDurationGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetPastPresentationTimingGOOGLE)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetRefreshCycleDurationGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( + VkDevice device, + VkSwapchainKHR swapchain, + uint32_t* pPresentationTimingCount, + VkPastPresentationTimingGOOGLE* pPresentationTimings); +#endif + +#define VK_NV_sample_mask_override_coverage 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 +#define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" + + +#define VK_NV_geometry_shader_passthrough 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 +#define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" + + +#define VK_NV_viewport_array2 1 +#define VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME "VK_NV_viewport_array2" + + +#define VK_NVX_multiview_per_view_attributes 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION 1 +#define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME "VK_NVX_multiview_per_view_attributes" + +typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { + VkStructureType sType; + void* pNext; + VkBool32 perViewPositionAllComponents; +} VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; + + + +#define VK_NV_viewport_swizzle 1 +#define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 +#define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" + + +typedef enum VkViewportCoordinateSwizzleNV { + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV = 1, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV = 2, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV = 3, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV = 4, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV = 5, + VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV = 6, + VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV = 7, + VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV, + VK_VIEWPORT_COORDINATE_SWIZZLE_RANGE_SIZE_NV = (VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV + 1), + VK_VIEWPORT_COORDINATE_SWIZZLE_MAX_ENUM_NV = 0x7FFFFFFF +} VkViewportCoordinateSwizzleNV; + +typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; + +typedef struct VkViewportSwizzleNV { + VkViewportCoordinateSwizzleNV x; + VkViewportCoordinateSwizzleNV y; + VkViewportCoordinateSwizzleNV z; + VkViewportCoordinateSwizzleNV w; +} VkViewportSwizzleNV; + +typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const VkViewportSwizzleNV* pViewportSwizzles; +} VkPipelineViewportSwizzleStateCreateInfoNV; + + + +#define VK_EXT_discard_rectangles 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" + + +typedef enum VkDiscardRectangleModeEXT { + VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0, + VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1, + VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT, + VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1), + VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDiscardRectangleModeEXT; + +typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; + +typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxDiscardRectangles; +} VkPhysicalDeviceDiscardRectanglePropertiesEXT; + +typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPipelineDiscardRectangleStateCreateFlagsEXT flags; + VkDiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const VkRect2D* pDiscardRectangles; +} VkPipelineDiscardRectangleStateCreateInfoEXT; + + +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( + VkCommandBuffer commandBuffer, + uint32_t firstDiscardRectangle, + uint32_t discardRectangleCount, + const VkRect2D* pDiscardRectangles); +#endif + +#define VK_EXT_swapchain_colorspace 1 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 2 +#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" + + +#define VK_EXT_hdr_metadata 1 +#define VK_EXT_HDR_METADATA_SPEC_VERSION 1 +#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" + +typedef struct VkXYColorEXT { + float x; + float y; +} VkXYColorEXT; + +typedef struct VkHdrMetadataEXT { + VkStructureType sType; + const void* pNext; + VkXYColorEXT displayPrimaryRed; + VkXYColorEXT displayPrimaryGreen; + VkXYColorEXT displayPrimaryBlue; + VkXYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} VkHdrMetadataEXT; + + +typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( + VkDevice device, + uint32_t swapchainCount, + const VkSwapchainKHR* pSwapchains, + const VkHdrMetadataEXT* pMetadata); +#endif + +#ifdef VK_USE_PLATFORM_IOS_MVK +#define VK_MVK_ios_surface 1 +#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" + +typedef VkFlags VkIOSSurfaceCreateFlagsMVK; + +typedef struct VkIOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkIOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkIOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( + VkInstance instance, + const VkIOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif +#endif /* VK_USE_PLATFORM_IOS_MVK */ + +#ifdef VK_USE_PLATFORM_MACOS_MVK +#define VK_MVK_macos_surface 1 +#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 +#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" + +typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; + +typedef struct VkMacOSSurfaceCreateInfoMVK { + VkStructureType sType; + const void* pNext; + VkMacOSSurfaceCreateFlagsMVK flags; + const void* pView; +} VkMacOSSurfaceCreateInfoMVK; + + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( + VkInstance instance, + const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSurfaceKHR* pSurface); +#endif +#endif /* VK_USE_PLATFORM_MACOS_MVK */ #ifdef __cplusplus } diff --git a/third_party/vulkan/vulkan.hpp b/third_party/vulkan/vulkan.hpp index dd346512e..0199195b2 100644 --- a/third_party/vulkan/vulkan.hpp +++ b/third_party/vulkan/vulkan.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -41,12 +42,14 @@ # include #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -static_assert( VK_HEADER_VERSION == 39 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 46 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) -#define VULKAN_HPP_TYPESAFE_CONVERSION 1 +# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION ) +# define VULKAN_HPP_TYPESAFE_CONVERSION +# endif #endif #if !defined(VULKAN_HPP_HAS_UNRESTRICTED_UNIONS) @@ -66,7 +69,6 @@ static_assert( VK_HEADER_VERSION == 39 , "Wrong VK_HEADER_VERSION!" ); # endif #endif - #if !defined(VULKAN_HPP_INLINE) # if defined(__clang___) # if __has_attribute(always_inline) @@ -83,6 +85,12 @@ static_assert( VK_HEADER_VERSION == 39 , "Wrong VK_HEADER_VERSION!" ); # endif #endif +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) +# define VULKAN_HPP_TYPESAFE_EXPLICIT +#else +# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit +#endif + namespace vk { template struct FlagTraits @@ -317,6 +325,115 @@ namespace vk }; #endif + +#if defined(VULKAN_HPP_NO_EXCEPTIONS) && !defined(VULKAN_HPP_NO_SMART_HANDLE) +# define VULKAN_HPP_NO_SMART_HANDLE +#endif + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + class UniqueHandle + { + public: + explicit UniqueHandle( Type const& value = Type(), Deleter const& deleter = Deleter() ) + : m_value( value ) + , m_deleter( deleter ) + {} + + UniqueHandle( UniqueHandle const& ) = delete; + + UniqueHandle( UniqueHandle && other ) + : m_value( other.release() ) + , m_deleter( std::move( other.m_deleter ) ) + {} + + ~UniqueHandle() + { + destroy(); + } + + UniqueHandle & operator=( UniqueHandle const& ) = delete; + + UniqueHandle & operator=( UniqueHandle && other ) + { + reset( other.release() ); + m_deleter = std::move( other.m_deleter ); + return *this; + } + + explicit operator bool() const + { + return m_value.operator bool(); + } + + Type const* operator->() const + { + return &m_value; + } + + Type const& operator*() const + { + return m_value; + } + + Type get() const + { + return m_value; + } + + Deleter & getDeleter() + { + return m_deleter; + } + + Deleter const& getDeleter() const + { + return m_deleter; + } + + void reset( Type const& value = Type() ) + { + if ( m_value != value ) + { + destroy(); + m_value = value; + } + } + + Type release() + { + Type value = m_value; + m_value = nullptr; + return value; + } + + void swap( UniqueHandle & rhs ) + { + std::swap(m_value, rhs.m_value); + std::swap(m_deleter, rhs.m_deleter); + } + + private: + void destroy() + { + if ( m_value ) + { + m_deleter( m_value ); + } + } + + private: + Type m_value; + Deleter m_deleter; + }; + + template + VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) + { + lhs.swap( rhs ); + } +#endif + enum class Result { eSuccess = VK_SUCCESS, @@ -344,7 +461,8 @@ namespace vk eErrorIncompatibleDisplayKHR = VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, eErrorValidationFailedEXT = VK_ERROR_VALIDATION_FAILED_EXT, eErrorInvalidShaderNV = VK_ERROR_INVALID_SHADER_NV, - eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR + eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR, + eErrorInvalidExternalHandleKHX = VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX }; VULKAN_HPP_INLINE std::string to_string(Result value) @@ -377,6 +495,7 @@ namespace vk case Result::eErrorValidationFailedEXT: return "ErrorValidationFailedEXT"; case Result::eErrorInvalidShaderNV: return "ErrorInvalidShaderNV"; case Result::eErrorOutOfPoolMemoryKHR: return "ErrorOutOfPoolMemoryKHR"; + case Result::eErrorInvalidExternalHandleKHX: return "ErrorInvalidExternalHandleKHX"; default: return "invalid"; } } @@ -693,17 +812,6 @@ namespace vk return PipelineShaderStageCreateFlags( bit0 ) | bit1; } - enum class DescriptorSetLayoutCreateFlagBits - { - }; - - using DescriptorSetLayoutCreateFlags = Flags; - - VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator|( DescriptorSetLayoutCreateFlagBits bit0, DescriptorSetLayoutCreateFlagBits bit1 ) - { - return DescriptorSetLayoutCreateFlags( bit0 ) | bit1; - } - enum class BufferViewCreateFlagBits { }; @@ -803,17 +911,6 @@ namespace vk return MemoryMapFlags( bit0 ) | bit1; } - enum class SubpassDescriptionFlagBits - { - }; - - using SubpassDescriptionFlags = Flags; - - VULKAN_HPP_INLINE SubpassDescriptionFlags operator|( SubpassDescriptionFlagBits bit0, SubpassDescriptionFlagBits bit1 ) - { - return SubpassDescriptionFlags( bit0 ) | bit1; - } - enum class DescriptorPoolResetFlagBits { }; @@ -825,15 +922,15 @@ namespace vk return DescriptorPoolResetFlags( bit0 ) | bit1; } - enum class SwapchainCreateFlagBitsKHR + enum class DescriptorUpdateTemplateCreateFlagBitsKHR { }; - using SwapchainCreateFlagsKHR = Flags; + using DescriptorUpdateTemplateCreateFlagsKHR = Flags; - VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator|( SwapchainCreateFlagBitsKHR bit0, SwapchainCreateFlagBitsKHR bit1 ) + VULKAN_HPP_INLINE DescriptorUpdateTemplateCreateFlagsKHR operator|( DescriptorUpdateTemplateCreateFlagBitsKHR bit0, DescriptorUpdateTemplateCreateFlagBitsKHR bit1 ) { - return SwapchainCreateFlagsKHR( bit0 ) | bit1; + return DescriptorUpdateTemplateCreateFlagsKHR( bit0 ) | bit1; } enum class DisplayModeCreateFlagBitsKHR @@ -963,6 +1060,36 @@ namespace vk } #endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_IOS_MVK + enum class IOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + using IOSSurfaceCreateFlagsMVK = Flags; + + VULKAN_HPP_INLINE IOSSurfaceCreateFlagsMVK operator|( IOSSurfaceCreateFlagBitsMVK bit0, IOSSurfaceCreateFlagBitsMVK bit1 ) + { + return IOSSurfaceCreateFlagsMVK( bit0 ) | bit1; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + enum class MacOSSurfaceCreateFlagBitsMVK + { + }; +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + using MacOSSurfaceCreateFlagsMVK = Flags; + + VULKAN_HPP_INLINE MacOSSurfaceCreateFlagsMVK operator|( MacOSSurfaceCreateFlagBitsMVK bit0, MacOSSurfaceCreateFlagBitsMVK bit1 ) + { + return MacOSSurfaceCreateFlagsMVK( bit0 ) | bit1; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + enum class CommandPoolTrimFlagBitsKHR { }; @@ -974,6 +1101,28 @@ namespace vk return CommandPoolTrimFlagsKHR( bit0 ) | bit1; } + enum class PipelineViewportSwizzleStateCreateFlagBitsNV + { + }; + + using PipelineViewportSwizzleStateCreateFlagsNV = Flags; + + VULKAN_HPP_INLINE PipelineViewportSwizzleStateCreateFlagsNV operator|( PipelineViewportSwizzleStateCreateFlagBitsNV bit0, PipelineViewportSwizzleStateCreateFlagBitsNV bit1 ) + { + return PipelineViewportSwizzleStateCreateFlagsNV( bit0 ) | bit1; + } + + enum class PipelineDiscardRectangleStateCreateFlagBitsEXT + { + }; + + using PipelineDiscardRectangleStateCreateFlagsEXT = Flags; + + VULKAN_HPP_INLINE PipelineDiscardRectangleStateCreateFlagsEXT operator|( PipelineDiscardRectangleStateCreateFlagBitsEXT bit0, PipelineDiscardRectangleStateCreateFlagBitsEXT bit1 ) + { + return PipelineDiscardRectangleStateCreateFlagsEXT( bit0 ) | bit1; + } + class DeviceMemory { public: @@ -981,11 +1130,15 @@ namespace vk : m_deviceMemory(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DeviceMemory(VkDeviceMemory deviceMemory) + DeviceMemory( std::nullptr_t ) + : m_deviceMemory(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DeviceMemory(VkDeviceMemory deviceMemory) : m_deviceMemory(deviceMemory) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DeviceMemory& operator=(VkDeviceMemory deviceMemory) { m_deviceMemory = deviceMemory; @@ -993,6 +1146,12 @@ namespace vk } #endif + DeviceMemory& operator=( std::nullptr_t ) + { + m_deviceMemory = VK_NULL_HANDLE; + return *this; + } + bool operator==(DeviceMemory const &rhs) const { return m_deviceMemory == rhs.m_deviceMemory; @@ -1008,10 +1167,7 @@ namespace vk return m_deviceMemory < rhs.m_deviceMemory; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDeviceMemory() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDeviceMemory() const { return m_deviceMemory; } @@ -1038,11 +1194,15 @@ namespace vk : m_commandPool(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - CommandPool(VkCommandPool commandPool) + CommandPool( std::nullptr_t ) + : m_commandPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT CommandPool(VkCommandPool commandPool) : m_commandPool(commandPool) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) CommandPool& operator=(VkCommandPool commandPool) { m_commandPool = commandPool; @@ -1050,6 +1210,12 @@ namespace vk } #endif + CommandPool& operator=( std::nullptr_t ) + { + m_commandPool = VK_NULL_HANDLE; + return *this; + } + bool operator==(CommandPool const &rhs) const { return m_commandPool == rhs.m_commandPool; @@ -1065,10 +1231,7 @@ namespace vk return m_commandPool < rhs.m_commandPool; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkCommandPool() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandPool() const { return m_commandPool; } @@ -1095,11 +1258,15 @@ namespace vk : m_buffer(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Buffer(VkBuffer buffer) + Buffer( std::nullptr_t ) + : m_buffer(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Buffer(VkBuffer buffer) : m_buffer(buffer) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Buffer& operator=(VkBuffer buffer) { m_buffer = buffer; @@ -1107,6 +1274,12 @@ namespace vk } #endif + Buffer& operator=( std::nullptr_t ) + { + m_buffer = VK_NULL_HANDLE; + return *this; + } + bool operator==(Buffer const &rhs) const { return m_buffer == rhs.m_buffer; @@ -1122,10 +1295,7 @@ namespace vk return m_buffer < rhs.m_buffer; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkBuffer() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBuffer() const { return m_buffer; } @@ -1152,11 +1322,15 @@ namespace vk : m_bufferView(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - BufferView(VkBufferView bufferView) + BufferView( std::nullptr_t ) + : m_bufferView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT BufferView(VkBufferView bufferView) : m_bufferView(bufferView) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) BufferView& operator=(VkBufferView bufferView) { m_bufferView = bufferView; @@ -1164,6 +1338,12 @@ namespace vk } #endif + BufferView& operator=( std::nullptr_t ) + { + m_bufferView = VK_NULL_HANDLE; + return *this; + } + bool operator==(BufferView const &rhs) const { return m_bufferView == rhs.m_bufferView; @@ -1179,10 +1359,7 @@ namespace vk return m_bufferView < rhs.m_bufferView; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkBufferView() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBufferView() const { return m_bufferView; } @@ -1209,11 +1386,15 @@ namespace vk : m_image(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Image(VkImage image) + Image( std::nullptr_t ) + : m_image(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Image(VkImage image) : m_image(image) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Image& operator=(VkImage image) { m_image = image; @@ -1221,6 +1402,12 @@ namespace vk } #endif + Image& operator=( std::nullptr_t ) + { + m_image = VK_NULL_HANDLE; + return *this; + } + bool operator==(Image const &rhs) const { return m_image == rhs.m_image; @@ -1236,10 +1423,7 @@ namespace vk return m_image < rhs.m_image; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkImage() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImage() const { return m_image; } @@ -1266,11 +1450,15 @@ namespace vk : m_imageView(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ImageView(VkImageView imageView) + ImageView( std::nullptr_t ) + : m_imageView(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ImageView(VkImageView imageView) : m_imageView(imageView) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) ImageView& operator=(VkImageView imageView) { m_imageView = imageView; @@ -1278,6 +1466,12 @@ namespace vk } #endif + ImageView& operator=( std::nullptr_t ) + { + m_imageView = VK_NULL_HANDLE; + return *this; + } + bool operator==(ImageView const &rhs) const { return m_imageView == rhs.m_imageView; @@ -1293,10 +1487,7 @@ namespace vk return m_imageView < rhs.m_imageView; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkImageView() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImageView() const { return m_imageView; } @@ -1323,11 +1514,15 @@ namespace vk : m_shaderModule(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ShaderModule(VkShaderModule shaderModule) + ShaderModule( std::nullptr_t ) + : m_shaderModule(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ShaderModule(VkShaderModule shaderModule) : m_shaderModule(shaderModule) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) ShaderModule& operator=(VkShaderModule shaderModule) { m_shaderModule = shaderModule; @@ -1335,6 +1530,12 @@ namespace vk } #endif + ShaderModule& operator=( std::nullptr_t ) + { + m_shaderModule = VK_NULL_HANDLE; + return *this; + } + bool operator==(ShaderModule const &rhs) const { return m_shaderModule == rhs.m_shaderModule; @@ -1350,10 +1551,7 @@ namespace vk return m_shaderModule < rhs.m_shaderModule; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkShaderModule() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkShaderModule() const { return m_shaderModule; } @@ -1380,11 +1578,15 @@ namespace vk : m_pipeline(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Pipeline(VkPipeline pipeline) + Pipeline( std::nullptr_t ) + : m_pipeline(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Pipeline(VkPipeline pipeline) : m_pipeline(pipeline) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Pipeline& operator=(VkPipeline pipeline) { m_pipeline = pipeline; @@ -1392,6 +1594,12 @@ namespace vk } #endif + Pipeline& operator=( std::nullptr_t ) + { + m_pipeline = VK_NULL_HANDLE; + return *this; + } + bool operator==(Pipeline const &rhs) const { return m_pipeline == rhs.m_pipeline; @@ -1407,10 +1615,7 @@ namespace vk return m_pipeline < rhs.m_pipeline; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkPipeline() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipeline() const { return m_pipeline; } @@ -1437,11 +1642,15 @@ namespace vk : m_pipelineLayout(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - PipelineLayout(VkPipelineLayout pipelineLayout) + PipelineLayout( std::nullptr_t ) + : m_pipelineLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT PipelineLayout(VkPipelineLayout pipelineLayout) : m_pipelineLayout(pipelineLayout) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) PipelineLayout& operator=(VkPipelineLayout pipelineLayout) { m_pipelineLayout = pipelineLayout; @@ -1449,6 +1658,12 @@ namespace vk } #endif + PipelineLayout& operator=( std::nullptr_t ) + { + m_pipelineLayout = VK_NULL_HANDLE; + return *this; + } + bool operator==(PipelineLayout const &rhs) const { return m_pipelineLayout == rhs.m_pipelineLayout; @@ -1464,10 +1679,7 @@ namespace vk return m_pipelineLayout < rhs.m_pipelineLayout; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkPipelineLayout() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineLayout() const { return m_pipelineLayout; } @@ -1494,11 +1706,15 @@ namespace vk : m_sampler(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Sampler(VkSampler sampler) + Sampler( std::nullptr_t ) + : m_sampler(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Sampler(VkSampler sampler) : m_sampler(sampler) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Sampler& operator=(VkSampler sampler) { m_sampler = sampler; @@ -1506,6 +1722,12 @@ namespace vk } #endif + Sampler& operator=( std::nullptr_t ) + { + m_sampler = VK_NULL_HANDLE; + return *this; + } + bool operator==(Sampler const &rhs) const { return m_sampler == rhs.m_sampler; @@ -1521,10 +1743,7 @@ namespace vk return m_sampler < rhs.m_sampler; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkSampler() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSampler() const { return m_sampler; } @@ -1551,11 +1770,15 @@ namespace vk : m_descriptorSet(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorSet(VkDescriptorSet descriptorSet) + DescriptorSet( std::nullptr_t ) + : m_descriptorSet(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSet(VkDescriptorSet descriptorSet) : m_descriptorSet(descriptorSet) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DescriptorSet& operator=(VkDescriptorSet descriptorSet) { m_descriptorSet = descriptorSet; @@ -1563,6 +1786,12 @@ namespace vk } #endif + DescriptorSet& operator=( std::nullptr_t ) + { + m_descriptorSet = VK_NULL_HANDLE; + return *this; + } + bool operator==(DescriptorSet const &rhs) const { return m_descriptorSet == rhs.m_descriptorSet; @@ -1578,10 +1807,7 @@ namespace vk return m_descriptorSet < rhs.m_descriptorSet; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDescriptorSet() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSet() const { return m_descriptorSet; } @@ -1608,11 +1834,15 @@ namespace vk : m_descriptorSetLayout(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) + DescriptorSetLayout( std::nullptr_t ) + : m_descriptorSetLayout(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) : m_descriptorSetLayout(descriptorSetLayout) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DescriptorSetLayout& operator=(VkDescriptorSetLayout descriptorSetLayout) { m_descriptorSetLayout = descriptorSetLayout; @@ -1620,6 +1850,12 @@ namespace vk } #endif + DescriptorSetLayout& operator=( std::nullptr_t ) + { + m_descriptorSetLayout = VK_NULL_HANDLE; + return *this; + } + bool operator==(DescriptorSetLayout const &rhs) const { return m_descriptorSetLayout == rhs.m_descriptorSetLayout; @@ -1635,10 +1871,7 @@ namespace vk return m_descriptorSetLayout < rhs.m_descriptorSetLayout; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDescriptorSetLayout() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSetLayout() const { return m_descriptorSetLayout; } @@ -1665,11 +1898,15 @@ namespace vk : m_descriptorPool(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DescriptorPool(VkDescriptorPool descriptorPool) + DescriptorPool( std::nullptr_t ) + : m_descriptorPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorPool(VkDescriptorPool descriptorPool) : m_descriptorPool(descriptorPool) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DescriptorPool& operator=(VkDescriptorPool descriptorPool) { m_descriptorPool = descriptorPool; @@ -1677,6 +1914,12 @@ namespace vk } #endif + DescriptorPool& operator=( std::nullptr_t ) + { + m_descriptorPool = VK_NULL_HANDLE; + return *this; + } + bool operator==(DescriptorPool const &rhs) const { return m_descriptorPool == rhs.m_descriptorPool; @@ -1692,10 +1935,7 @@ namespace vk return m_descriptorPool < rhs.m_descriptorPool; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDescriptorPool() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorPool() const { return m_descriptorPool; } @@ -1722,11 +1962,15 @@ namespace vk : m_fence(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Fence(VkFence fence) + Fence( std::nullptr_t ) + : m_fence(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Fence(VkFence fence) : m_fence(fence) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Fence& operator=(VkFence fence) { m_fence = fence; @@ -1734,6 +1978,12 @@ namespace vk } #endif + Fence& operator=( std::nullptr_t ) + { + m_fence = VK_NULL_HANDLE; + return *this; + } + bool operator==(Fence const &rhs) const { return m_fence == rhs.m_fence; @@ -1749,10 +1999,7 @@ namespace vk return m_fence < rhs.m_fence; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkFence() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFence() const { return m_fence; } @@ -1779,11 +2026,15 @@ namespace vk : m_semaphore(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Semaphore(VkSemaphore semaphore) + Semaphore( std::nullptr_t ) + : m_semaphore(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Semaphore(VkSemaphore semaphore) : m_semaphore(semaphore) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Semaphore& operator=(VkSemaphore semaphore) { m_semaphore = semaphore; @@ -1791,6 +2042,12 @@ namespace vk } #endif + Semaphore& operator=( std::nullptr_t ) + { + m_semaphore = VK_NULL_HANDLE; + return *this; + } + bool operator==(Semaphore const &rhs) const { return m_semaphore == rhs.m_semaphore; @@ -1806,10 +2063,7 @@ namespace vk return m_semaphore < rhs.m_semaphore; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkSemaphore() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSemaphore() const { return m_semaphore; } @@ -1836,11 +2090,15 @@ namespace vk : m_event(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Event(VkEvent event) + Event( std::nullptr_t ) + : m_event(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Event(VkEvent event) : m_event(event) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Event& operator=(VkEvent event) { m_event = event; @@ -1848,6 +2106,12 @@ namespace vk } #endif + Event& operator=( std::nullptr_t ) + { + m_event = VK_NULL_HANDLE; + return *this; + } + bool operator==(Event const &rhs) const { return m_event == rhs.m_event; @@ -1863,10 +2127,7 @@ namespace vk return m_event < rhs.m_event; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkEvent() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkEvent() const { return m_event; } @@ -1893,11 +2154,15 @@ namespace vk : m_queryPool(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - QueryPool(VkQueryPool queryPool) + QueryPool( std::nullptr_t ) + : m_queryPool(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT QueryPool(VkQueryPool queryPool) : m_queryPool(queryPool) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) QueryPool& operator=(VkQueryPool queryPool) { m_queryPool = queryPool; @@ -1905,6 +2170,12 @@ namespace vk } #endif + QueryPool& operator=( std::nullptr_t ) + { + m_queryPool = VK_NULL_HANDLE; + return *this; + } + bool operator==(QueryPool const &rhs) const { return m_queryPool == rhs.m_queryPool; @@ -1920,10 +2191,7 @@ namespace vk return m_queryPool < rhs.m_queryPool; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkQueryPool() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkQueryPool() const { return m_queryPool; } @@ -1950,11 +2218,15 @@ namespace vk : m_framebuffer(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Framebuffer(VkFramebuffer framebuffer) + Framebuffer( std::nullptr_t ) + : m_framebuffer(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Framebuffer(VkFramebuffer framebuffer) : m_framebuffer(framebuffer) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Framebuffer& operator=(VkFramebuffer framebuffer) { m_framebuffer = framebuffer; @@ -1962,6 +2234,12 @@ namespace vk } #endif + Framebuffer& operator=( std::nullptr_t ) + { + m_framebuffer = VK_NULL_HANDLE; + return *this; + } + bool operator==(Framebuffer const &rhs) const { return m_framebuffer == rhs.m_framebuffer; @@ -1977,10 +2255,7 @@ namespace vk return m_framebuffer < rhs.m_framebuffer; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkFramebuffer() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFramebuffer() const { return m_framebuffer; } @@ -2007,11 +2282,15 @@ namespace vk : m_renderPass(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - RenderPass(VkRenderPass renderPass) + RenderPass( std::nullptr_t ) + : m_renderPass(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT RenderPass(VkRenderPass renderPass) : m_renderPass(renderPass) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) RenderPass& operator=(VkRenderPass renderPass) { m_renderPass = renderPass; @@ -2019,6 +2298,12 @@ namespace vk } #endif + RenderPass& operator=( std::nullptr_t ) + { + m_renderPass = VK_NULL_HANDLE; + return *this; + } + bool operator==(RenderPass const &rhs) const { return m_renderPass == rhs.m_renderPass; @@ -2034,10 +2319,7 @@ namespace vk return m_renderPass < rhs.m_renderPass; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkRenderPass() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkRenderPass() const { return m_renderPass; } @@ -2064,11 +2346,15 @@ namespace vk : m_pipelineCache(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - PipelineCache(VkPipelineCache pipelineCache) + PipelineCache( std::nullptr_t ) + : m_pipelineCache(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT PipelineCache(VkPipelineCache pipelineCache) : m_pipelineCache(pipelineCache) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) PipelineCache& operator=(VkPipelineCache pipelineCache) { m_pipelineCache = pipelineCache; @@ -2076,6 +2362,12 @@ namespace vk } #endif + PipelineCache& operator=( std::nullptr_t ) + { + m_pipelineCache = VK_NULL_HANDLE; + return *this; + } + bool operator==(PipelineCache const &rhs) const { return m_pipelineCache == rhs.m_pipelineCache; @@ -2091,10 +2383,7 @@ namespace vk return m_pipelineCache < rhs.m_pipelineCache; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkPipelineCache() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineCache() const { return m_pipelineCache; } @@ -2121,11 +2410,15 @@ namespace vk : m_objectTableNVX(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - ObjectTableNVX(VkObjectTableNVX objectTableNVX) + ObjectTableNVX( std::nullptr_t ) + : m_objectTableNVX(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT ObjectTableNVX(VkObjectTableNVX objectTableNVX) : m_objectTableNVX(objectTableNVX) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) ObjectTableNVX& operator=(VkObjectTableNVX objectTableNVX) { m_objectTableNVX = objectTableNVX; @@ -2133,6 +2426,12 @@ namespace vk } #endif + ObjectTableNVX& operator=( std::nullptr_t ) + { + m_objectTableNVX = VK_NULL_HANDLE; + return *this; + } + bool operator==(ObjectTableNVX const &rhs) const { return m_objectTableNVX == rhs.m_objectTableNVX; @@ -2148,10 +2447,7 @@ namespace vk return m_objectTableNVX < rhs.m_objectTableNVX; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkObjectTableNVX() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkObjectTableNVX() const { return m_objectTableNVX; } @@ -2178,11 +2474,15 @@ namespace vk : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - IndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX) + IndirectCommandsLayoutNVX( std::nullptr_t ) + : m_indirectCommandsLayoutNVX(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT IndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX) : m_indirectCommandsLayoutNVX(indirectCommandsLayoutNVX) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) IndirectCommandsLayoutNVX& operator=(VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX) { m_indirectCommandsLayoutNVX = indirectCommandsLayoutNVX; @@ -2190,6 +2490,12 @@ namespace vk } #endif + IndirectCommandsLayoutNVX& operator=( std::nullptr_t ) + { + m_indirectCommandsLayoutNVX = VK_NULL_HANDLE; + return *this; + } + bool operator==(IndirectCommandsLayoutNVX const &rhs) const { return m_indirectCommandsLayoutNVX == rhs.m_indirectCommandsLayoutNVX; @@ -2205,10 +2511,7 @@ namespace vk return m_indirectCommandsLayoutNVX < rhs.m_indirectCommandsLayoutNVX; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkIndirectCommandsLayoutNVX() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkIndirectCommandsLayoutNVX() const { return m_indirectCommandsLayoutNVX; } @@ -2228,6 +2531,70 @@ namespace vk }; static_assert( sizeof( IndirectCommandsLayoutNVX ) == sizeof( VkIndirectCommandsLayoutNVX ), "handle and wrapper have different size!" ); + class DescriptorUpdateTemplateKHR + { + public: + DescriptorUpdateTemplateKHR() + : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) + {} + + DescriptorUpdateTemplateKHR( std::nullptr_t ) + : m_descriptorUpdateTemplateKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplateKHR(VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR) + : m_descriptorUpdateTemplateKHR(descriptorUpdateTemplateKHR) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + DescriptorUpdateTemplateKHR& operator=(VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR) + { + m_descriptorUpdateTemplateKHR = descriptorUpdateTemplateKHR; + return *this; + } +#endif + + DescriptorUpdateTemplateKHR& operator=( std::nullptr_t ) + { + m_descriptorUpdateTemplateKHR = VK_NULL_HANDLE; + return *this; + } + + bool operator==(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR == rhs.m_descriptorUpdateTemplateKHR; + } + + bool operator!=(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR != rhs.m_descriptorUpdateTemplateKHR; + } + + bool operator<(DescriptorUpdateTemplateKHR const &rhs) const + { + return m_descriptorUpdateTemplateKHR < rhs.m_descriptorUpdateTemplateKHR; + } + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorUpdateTemplateKHR() const + { + return m_descriptorUpdateTemplateKHR; + } + + explicit operator bool() const + { + return m_descriptorUpdateTemplateKHR != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_descriptorUpdateTemplateKHR == VK_NULL_HANDLE; + } + + private: + VkDescriptorUpdateTemplateKHR m_descriptorUpdateTemplateKHR; + }; + static_assert( sizeof( DescriptorUpdateTemplateKHR ) == sizeof( VkDescriptorUpdateTemplateKHR ), "handle and wrapper have different size!" ); + class DisplayKHR { public: @@ -2235,11 +2602,15 @@ namespace vk : m_displayKHR(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DisplayKHR(VkDisplayKHR displayKHR) + DisplayKHR( std::nullptr_t ) + : m_displayKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DisplayKHR(VkDisplayKHR displayKHR) : m_displayKHR(displayKHR) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DisplayKHR& operator=(VkDisplayKHR displayKHR) { m_displayKHR = displayKHR; @@ -2247,6 +2618,12 @@ namespace vk } #endif + DisplayKHR& operator=( std::nullptr_t ) + { + m_displayKHR = VK_NULL_HANDLE; + return *this; + } + bool operator==(DisplayKHR const &rhs) const { return m_displayKHR == rhs.m_displayKHR; @@ -2262,10 +2639,7 @@ namespace vk return m_displayKHR < rhs.m_displayKHR; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDisplayKHR() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayKHR() const { return m_displayKHR; } @@ -2292,11 +2666,15 @@ namespace vk : m_displayModeKHR(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DisplayModeKHR(VkDisplayModeKHR displayModeKHR) + DisplayModeKHR( std::nullptr_t ) + : m_displayModeKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DisplayModeKHR(VkDisplayModeKHR displayModeKHR) : m_displayModeKHR(displayModeKHR) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DisplayModeKHR& operator=(VkDisplayModeKHR displayModeKHR) { m_displayModeKHR = displayModeKHR; @@ -2304,6 +2682,12 @@ namespace vk } #endif + DisplayModeKHR& operator=( std::nullptr_t ) + { + m_displayModeKHR = VK_NULL_HANDLE; + return *this; + } + bool operator==(DisplayModeKHR const &rhs) const { return m_displayModeKHR == rhs.m_displayModeKHR; @@ -2319,10 +2703,7 @@ namespace vk return m_displayModeKHR < rhs.m_displayModeKHR; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDisplayModeKHR() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayModeKHR() const { return m_displayModeKHR; } @@ -2349,11 +2730,15 @@ namespace vk : m_surfaceKHR(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - SurfaceKHR(VkSurfaceKHR surfaceKHR) + SurfaceKHR( std::nullptr_t ) + : m_surfaceKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT SurfaceKHR(VkSurfaceKHR surfaceKHR) : m_surfaceKHR(surfaceKHR) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) SurfaceKHR& operator=(VkSurfaceKHR surfaceKHR) { m_surfaceKHR = surfaceKHR; @@ -2361,6 +2746,12 @@ namespace vk } #endif + SurfaceKHR& operator=( std::nullptr_t ) + { + m_surfaceKHR = VK_NULL_HANDLE; + return *this; + } + bool operator==(SurfaceKHR const &rhs) const { return m_surfaceKHR == rhs.m_surfaceKHR; @@ -2376,10 +2767,7 @@ namespace vk return m_surfaceKHR < rhs.m_surfaceKHR; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkSurfaceKHR() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSurfaceKHR() const { return m_surfaceKHR; } @@ -2406,11 +2794,15 @@ namespace vk : m_swapchainKHR(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - SwapchainKHR(VkSwapchainKHR swapchainKHR) + SwapchainKHR( std::nullptr_t ) + : m_swapchainKHR(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT SwapchainKHR(VkSwapchainKHR swapchainKHR) : m_swapchainKHR(swapchainKHR) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) SwapchainKHR& operator=(VkSwapchainKHR swapchainKHR) { m_swapchainKHR = swapchainKHR; @@ -2418,6 +2810,12 @@ namespace vk } #endif + SwapchainKHR& operator=( std::nullptr_t ) + { + m_swapchainKHR = VK_NULL_HANDLE; + return *this; + } + bool operator==(SwapchainKHR const &rhs) const { return m_swapchainKHR == rhs.m_swapchainKHR; @@ -2433,10 +2831,7 @@ namespace vk return m_swapchainKHR < rhs.m_swapchainKHR; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkSwapchainKHR() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSwapchainKHR() const { return m_swapchainKHR; } @@ -2463,11 +2858,15 @@ namespace vk : m_debugReportCallbackEXT(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - DebugReportCallbackEXT(VkDebugReportCallbackEXT debugReportCallbackEXT) + DebugReportCallbackEXT( std::nullptr_t ) + : m_debugReportCallbackEXT(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT DebugReportCallbackEXT(VkDebugReportCallbackEXT debugReportCallbackEXT) : m_debugReportCallbackEXT(debugReportCallbackEXT) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) DebugReportCallbackEXT& operator=(VkDebugReportCallbackEXT debugReportCallbackEXT) { m_debugReportCallbackEXT = debugReportCallbackEXT; @@ -2475,6 +2874,12 @@ namespace vk } #endif + DebugReportCallbackEXT& operator=( std::nullptr_t ) + { + m_debugReportCallbackEXT = VK_NULL_HANDLE; + return *this; + } + bool operator==(DebugReportCallbackEXT const &rhs) const { return m_debugReportCallbackEXT == rhs.m_debugReportCallbackEXT; @@ -2490,10 +2895,7 @@ namespace vk return m_debugReportCallbackEXT < rhs.m_debugReportCallbackEXT; } -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDebugReportCallbackEXT() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugReportCallbackEXT() const { return m_debugReportCallbackEXT; } @@ -4386,6 +4788,397 @@ namespace vk }; static_assert( sizeof( DisplayModePropertiesKHR ) == sizeof( VkDisplayModePropertiesKHR ), "struct and wrapper have different size!" ); + struct RectLayerKHR + { + RectLayerKHR( Offset2D offset_ = Offset2D(), Extent2D extent_ = Extent2D(), uint32_t layer_ = 0 ) + : offset( offset_ ) + , extent( extent_ ) + , layer( layer_ ) + { + } + + RectLayerKHR( VkRectLayerKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(RectLayerKHR) ); + } + + RectLayerKHR& operator=( VkRectLayerKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(RectLayerKHR) ); + return *this; + } + + RectLayerKHR& setOffset( Offset2D offset_ ) + { + offset = offset_; + return *this; + } + + RectLayerKHR& setExtent( Extent2D extent_ ) + { + extent = extent_; + return *this; + } + + RectLayerKHR& setLayer( uint32_t layer_ ) + { + layer = layer_; + return *this; + } + + operator const VkRectLayerKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( RectLayerKHR const& rhs ) const + { + return ( offset == rhs.offset ) + && ( extent == rhs.extent ) + && ( layer == rhs.layer ); + } + + bool operator!=( RectLayerKHR const& rhs ) const + { + return !operator==( rhs ); + } + + Offset2D offset; + Extent2D extent; + uint32_t layer; + }; + static_assert( sizeof( RectLayerKHR ) == sizeof( VkRectLayerKHR ), "struct and wrapper have different size!" ); + + struct PresentRegionKHR + { + PresentRegionKHR( uint32_t rectangleCount_ = 0, const RectLayerKHR* pRectangles_ = nullptr ) + : rectangleCount( rectangleCount_ ) + , pRectangles( pRectangles_ ) + { + } + + PresentRegionKHR( VkPresentRegionKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentRegionKHR) ); + } + + PresentRegionKHR& operator=( VkPresentRegionKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentRegionKHR) ); + return *this; + } + + PresentRegionKHR& setRectangleCount( uint32_t rectangleCount_ ) + { + rectangleCount = rectangleCount_; + return *this; + } + + PresentRegionKHR& setPRectangles( const RectLayerKHR* pRectangles_ ) + { + pRectangles = pRectangles_; + return *this; + } + + operator const VkPresentRegionKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentRegionKHR const& rhs ) const + { + return ( rectangleCount == rhs.rectangleCount ) + && ( pRectangles == rhs.pRectangles ); + } + + bool operator!=( PresentRegionKHR const& rhs ) const + { + return !operator==( rhs ); + } + + uint32_t rectangleCount; + const RectLayerKHR* pRectangles; + }; + static_assert( sizeof( PresentRegionKHR ) == sizeof( VkPresentRegionKHR ), "struct and wrapper have different size!" ); + + struct XYColorEXT + { + XYColorEXT( float x_ = 0, float y_ = 0 ) + : x( x_ ) + , y( y_ ) + { + } + + XYColorEXT( VkXYColorEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(XYColorEXT) ); + } + + XYColorEXT& operator=( VkXYColorEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(XYColorEXT) ); + return *this; + } + + XYColorEXT& setX( float x_ ) + { + x = x_; + return *this; + } + + XYColorEXT& setY( float y_ ) + { + y = y_; + return *this; + } + + operator const VkXYColorEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( XYColorEXT const& rhs ) const + { + return ( x == rhs.x ) + && ( y == rhs.y ); + } + + bool operator!=( XYColorEXT const& rhs ) const + { + return !operator==( rhs ); + } + + float x; + float y; + }; + static_assert( sizeof( XYColorEXT ) == sizeof( VkXYColorEXT ), "struct and wrapper have different size!" ); + + struct RefreshCycleDurationGOOGLE + { + RefreshCycleDurationGOOGLE( uint64_t refreshDuration_ = 0 ) + : refreshDuration( refreshDuration_ ) + { + } + + RefreshCycleDurationGOOGLE( VkRefreshCycleDurationGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(RefreshCycleDurationGOOGLE) ); + } + + RefreshCycleDurationGOOGLE& operator=( VkRefreshCycleDurationGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(RefreshCycleDurationGOOGLE) ); + return *this; + } + + RefreshCycleDurationGOOGLE& setRefreshDuration( uint64_t refreshDuration_ ) + { + refreshDuration = refreshDuration_; + return *this; + } + + operator const VkRefreshCycleDurationGOOGLE&() const + { + return *reinterpret_cast(this); + } + + bool operator==( RefreshCycleDurationGOOGLE const& rhs ) const + { + return ( refreshDuration == rhs.refreshDuration ); + } + + bool operator!=( RefreshCycleDurationGOOGLE const& rhs ) const + { + return !operator==( rhs ); + } + + uint64_t refreshDuration; + }; + static_assert( sizeof( RefreshCycleDurationGOOGLE ) == sizeof( VkRefreshCycleDurationGOOGLE ), "struct and wrapper have different size!" ); + + struct PastPresentationTimingGOOGLE + { + PastPresentationTimingGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0, uint64_t actualPresentTime_ = 0, uint64_t earliestPresentTime_ = 0, uint64_t presentMargin_ = 0 ) + : presentID( presentID_ ) + , desiredPresentTime( desiredPresentTime_ ) + , actualPresentTime( actualPresentTime_ ) + , earliestPresentTime( earliestPresentTime_ ) + , presentMargin( presentMargin_ ) + { + } + + PastPresentationTimingGOOGLE( VkPastPresentationTimingGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PastPresentationTimingGOOGLE) ); + } + + PastPresentationTimingGOOGLE& operator=( VkPastPresentationTimingGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PastPresentationTimingGOOGLE) ); + return *this; + } + + PastPresentationTimingGOOGLE& setPresentID( uint32_t presentID_ ) + { + presentID = presentID_; + return *this; + } + + PastPresentationTimingGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) + { + desiredPresentTime = desiredPresentTime_; + return *this; + } + + PastPresentationTimingGOOGLE& setActualPresentTime( uint64_t actualPresentTime_ ) + { + actualPresentTime = actualPresentTime_; + return *this; + } + + PastPresentationTimingGOOGLE& setEarliestPresentTime( uint64_t earliestPresentTime_ ) + { + earliestPresentTime = earliestPresentTime_; + return *this; + } + + PastPresentationTimingGOOGLE& setPresentMargin( uint64_t presentMargin_ ) + { + presentMargin = presentMargin_; + return *this; + } + + operator const VkPastPresentationTimingGOOGLE&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PastPresentationTimingGOOGLE const& rhs ) const + { + return ( presentID == rhs.presentID ) + && ( desiredPresentTime == rhs.desiredPresentTime ) + && ( actualPresentTime == rhs.actualPresentTime ) + && ( earliestPresentTime == rhs.earliestPresentTime ) + && ( presentMargin == rhs.presentMargin ); + } + + bool operator!=( PastPresentationTimingGOOGLE const& rhs ) const + { + return !operator==( rhs ); + } + + uint32_t presentID; + uint64_t desiredPresentTime; + uint64_t actualPresentTime; + uint64_t earliestPresentTime; + uint64_t presentMargin; + }; + static_assert( sizeof( PastPresentationTimingGOOGLE ) == sizeof( VkPastPresentationTimingGOOGLE ), "struct and wrapper have different size!" ); + + struct PresentTimeGOOGLE + { + PresentTimeGOOGLE( uint32_t presentID_ = 0, uint64_t desiredPresentTime_ = 0 ) + : presentID( presentID_ ) + , desiredPresentTime( desiredPresentTime_ ) + { + } + + PresentTimeGOOGLE( VkPresentTimeGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentTimeGOOGLE) ); + } + + PresentTimeGOOGLE& operator=( VkPresentTimeGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentTimeGOOGLE) ); + return *this; + } + + PresentTimeGOOGLE& setPresentID( uint32_t presentID_ ) + { + presentID = presentID_; + return *this; + } + + PresentTimeGOOGLE& setDesiredPresentTime( uint64_t desiredPresentTime_ ) + { + desiredPresentTime = desiredPresentTime_; + return *this; + } + + operator const VkPresentTimeGOOGLE&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentTimeGOOGLE const& rhs ) const + { + return ( presentID == rhs.presentID ) + && ( desiredPresentTime == rhs.desiredPresentTime ); + } + + bool operator!=( PresentTimeGOOGLE const& rhs ) const + { + return !operator==( rhs ); + } + + uint32_t presentID; + uint64_t desiredPresentTime; + }; + static_assert( sizeof( PresentTimeGOOGLE ) == sizeof( VkPresentTimeGOOGLE ), "struct and wrapper have different size!" ); + + struct ViewportWScalingNV + { + ViewportWScalingNV( float xcoeff_ = 0, float ycoeff_ = 0 ) + : xcoeff( xcoeff_ ) + , ycoeff( ycoeff_ ) + { + } + + ViewportWScalingNV( VkViewportWScalingNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportWScalingNV) ); + } + + ViewportWScalingNV& operator=( VkViewportWScalingNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportWScalingNV) ); + return *this; + } + + ViewportWScalingNV& setXcoeff( float xcoeff_ ) + { + xcoeff = xcoeff_; + return *this; + } + + ViewportWScalingNV& setYcoeff( float ycoeff_ ) + { + ycoeff = ycoeff_; + return *this; + } + + operator const VkViewportWScalingNV&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ViewportWScalingNV const& rhs ) const + { + return ( xcoeff == rhs.xcoeff ) + && ( ycoeff == rhs.ycoeff ); + } + + bool operator!=( ViewportWScalingNV const& rhs ) const + { + return !operator==( rhs ); + } + + float xcoeff; + float ycoeff; + }; + static_assert( sizeof( ViewportWScalingNV ) == sizeof( VkViewportWScalingNV ), "struct and wrapper have different size!" ); + enum class ImageLayout { eUndefined = VK_IMAGE_LAYOUT_UNDEFINED, @@ -4704,6 +5497,94 @@ namespace vk }; static_assert( sizeof( DescriptorPoolSize ) == sizeof( VkDescriptorPoolSize ), "struct and wrapper have different size!" ); + struct DescriptorUpdateTemplateEntryKHR + { + DescriptorUpdateTemplateEntryKHR( uint32_t dstBinding_ = 0, uint32_t dstArrayElement_ = 0, uint32_t descriptorCount_ = 0, DescriptorType descriptorType_ = DescriptorType::eSampler, size_t offset_ = 0, size_t stride_ = 0 ) + : dstBinding( dstBinding_ ) + , dstArrayElement( dstArrayElement_ ) + , descriptorCount( descriptorCount_ ) + , descriptorType( descriptorType_ ) + , offset( offset_ ) + , stride( stride_ ) + { + } + + DescriptorUpdateTemplateEntryKHR( VkDescriptorUpdateTemplateEntryKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateEntryKHR) ); + } + + DescriptorUpdateTemplateEntryKHR& operator=( VkDescriptorUpdateTemplateEntryKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateEntryKHR) ); + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setDstBinding( uint32_t dstBinding_ ) + { + dstBinding = dstBinding_; + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setDstArrayElement( uint32_t dstArrayElement_ ) + { + dstArrayElement = dstArrayElement_; + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setDescriptorCount( uint32_t descriptorCount_ ) + { + descriptorCount = descriptorCount_; + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setDescriptorType( DescriptorType descriptorType_ ) + { + descriptorType = descriptorType_; + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setOffset( size_t offset_ ) + { + offset = offset_; + return *this; + } + + DescriptorUpdateTemplateEntryKHR& setStride( size_t stride_ ) + { + stride = stride_; + return *this; + } + + operator const VkDescriptorUpdateTemplateEntryKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DescriptorUpdateTemplateEntryKHR const& rhs ) const + { + return ( dstBinding == rhs.dstBinding ) + && ( dstArrayElement == rhs.dstArrayElement ) + && ( descriptorCount == rhs.descriptorCount ) + && ( descriptorType == rhs.descriptorType ) + && ( offset == rhs.offset ) + && ( stride == rhs.stride ); + } + + bool operator!=( DescriptorUpdateTemplateEntryKHR const& rhs ) const + { + return !operator==( rhs ); + } + + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + DescriptorType descriptorType; + size_t offset; + size_t stride; + }; + static_assert( sizeof( DescriptorUpdateTemplateEntryKHR ) == sizeof( VkDescriptorUpdateTemplateEntryKHR ), "struct and wrapper have different size!" ); + enum class QueryType { eOcclusion = VK_QUERY_TYPE_OCCLUSION, @@ -4727,130 +5608,6 @@ namespace vk eCompute = VK_PIPELINE_BIND_POINT_COMPUTE }; - struct SubpassDescription - { - SubpassDescription( SubpassDescriptionFlags flags_ = SubpassDescriptionFlags(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, uint32_t inputAttachmentCount_ = 0, const AttachmentReference* pInputAttachments_ = nullptr, uint32_t colorAttachmentCount_ = 0, const AttachmentReference* pColorAttachments_ = nullptr, const AttachmentReference* pResolveAttachments_ = nullptr, const AttachmentReference* pDepthStencilAttachment_ = nullptr, uint32_t preserveAttachmentCount_ = 0, const uint32_t* pPreserveAttachments_ = nullptr ) - : flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , inputAttachmentCount( inputAttachmentCount_ ) - , pInputAttachments( pInputAttachments_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachments( pColorAttachments_ ) - , pResolveAttachments( pResolveAttachments_ ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( preserveAttachmentCount_ ) - , pPreserveAttachments( pPreserveAttachments_ ) - { - } - - SubpassDescription( VkSubpassDescription const & rhs ) - { - memcpy( this, &rhs, sizeof(SubpassDescription) ); - } - - SubpassDescription& operator=( VkSubpassDescription const & rhs ) - { - memcpy( this, &rhs, sizeof(SubpassDescription) ); - return *this; - } - - SubpassDescription& setFlags( SubpassDescriptionFlags flags_ ) - { - flags = flags_; - return *this; - } - - SubpassDescription& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - SubpassDescription& setInputAttachmentCount( uint32_t inputAttachmentCount_ ) - { - inputAttachmentCount = inputAttachmentCount_; - return *this; - } - - SubpassDescription& setPInputAttachments( const AttachmentReference* pInputAttachments_ ) - { - pInputAttachments = pInputAttachments_; - return *this; - } - - SubpassDescription& setColorAttachmentCount( uint32_t colorAttachmentCount_ ) - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - SubpassDescription& setPColorAttachments( const AttachmentReference* pColorAttachments_ ) - { - pColorAttachments = pColorAttachments_; - return *this; - } - - SubpassDescription& setPResolveAttachments( const AttachmentReference* pResolveAttachments_ ) - { - pResolveAttachments = pResolveAttachments_; - return *this; - } - - SubpassDescription& setPDepthStencilAttachment( const AttachmentReference* pDepthStencilAttachment_ ) - { - pDepthStencilAttachment = pDepthStencilAttachment_; - return *this; - } - - SubpassDescription& setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) - { - preserveAttachmentCount = preserveAttachmentCount_; - return *this; - } - - SubpassDescription& setPPreserveAttachments( const uint32_t* pPreserveAttachments_ ) - { - pPreserveAttachments = pPreserveAttachments_; - return *this; - } - - operator const VkSubpassDescription&() const - { - return *reinterpret_cast(this); - } - - bool operator==( SubpassDescription const& rhs ) const - { - return ( flags == rhs.flags ) - && ( pipelineBindPoint == rhs.pipelineBindPoint ) - && ( inputAttachmentCount == rhs.inputAttachmentCount ) - && ( pInputAttachments == rhs.pInputAttachments ) - && ( colorAttachmentCount == rhs.colorAttachmentCount ) - && ( pColorAttachments == rhs.pColorAttachments ) - && ( pResolveAttachments == rhs.pResolveAttachments ) - && ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) - && ( preserveAttachmentCount == rhs.preserveAttachmentCount ) - && ( pPreserveAttachments == rhs.pPreserveAttachments ); - } - - bool operator!=( SubpassDescription const& rhs ) const - { - return !operator==( rhs ); - } - - SubpassDescriptionFlags flags; - PipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const AttachmentReference* pInputAttachments; - uint32_t colorAttachmentCount; - const AttachmentReference* pColorAttachments; - const AttachmentReference* pResolveAttachments; - const AttachmentReference* pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t* pPreserveAttachments; - }; - static_assert( sizeof( SubpassDescription ) == sizeof( VkSubpassDescription ), "struct and wrapper have different size!" ); - enum class PipelineCacheHeaderVersion { eOne = VK_PIPELINE_CACHE_HEADER_VERSION_ONE @@ -5546,6 +6303,9 @@ namespace vk eDedicatedAllocationImageCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV, eDedicatedAllocationBufferCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV, eDedicatedAllocationMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV, + eRenderPassMultiviewCreateInfoKHX = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX, + ePhysicalDeviceMultiviewFeaturesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX, + ePhysicalDeviceMultiviewPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX, eExternalMemoryImageCreateInfoNV = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV, eExportMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV, eImportMemoryWin32HandleInfoNV = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV, @@ -5560,19 +6320,70 @@ namespace vk ePhysicalDeviceMemoryProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR, eSparseImageFormatProperties2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR, ePhysicalDeviceSparseImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR, + eMemoryAllocateFlagsInfoKHX = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX, + eBindBufferMemoryInfoKHX = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX, + eBindImageMemoryInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX, + eDeviceGroupRenderPassBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHX, + eDeviceGroupCommandBufferBeginInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHX, + eDeviceGroupSubmitInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHX, + eDeviceGroupBindSparseInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHX, + eDeviceGroupPresentCapabilitiesKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHX, + eImageSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX, + eBindImageMemorySwapchainInfoKHX = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHX, + eAcquireNextImageInfoKHX = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX, + eDeviceGroupPresentInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHX, + eDeviceGroupSwapchainCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHX, eValidationFlagsEXT = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT, eViSurfaceCreateInfoNN = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, + ePhysicalDeviceGroupPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX, + eDeviceGroupDeviceCreateInfoKHX = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX, + ePhysicalDeviceExternalImageFormatInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX, + eExternalImageFormatPropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX, + ePhysicalDeviceExternalBufferInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX, + eExternalBufferPropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX, + ePhysicalDeviceIdPropertiesKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX, + ePhysicalDeviceProperties2KHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHX, + eImageFormatProperties2KHX = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHX, + ePhysicalDeviceImageFormatInfo2KHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHX, + eExternalMemoryBufferCreateInfoKHX = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHX, + eExternalMemoryImageCreateInfoKHX = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHX, + eExportMemoryAllocateInfoKHX = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHX, + eImportMemoryWin32HandleInfoKHX = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHX, + eExportMemoryWin32HandleInfoKHX = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHX, + eMemoryWin32HandlePropertiesKHX = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHX, + eImportMemoryFdInfoKHX = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX, + eMemoryFdPropertiesKHX = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX, + eWin32KeyedMutexAcquireReleaseInfoKHX = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX, + ePhysicalDeviceExternalSemaphoreInfoKHX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX, + eExternalSemaphorePropertiesKHX = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX, + eExportSemaphoreCreateInfoKHX = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX, + eImportSemaphoreWin32HandleInfoKHX = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX, + eExportSemaphoreWin32HandleInfoKHX = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX, + eD3D12FenceSubmitInfoKHX = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX, + eImportSemaphoreFdInfoKHX = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX, + ePhysicalDevicePushDescriptorPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, + ePresentRegionsKHR = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR, + eDescriptorUpdateTemplateCreateInfoKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, eObjectTableCreateInfoNVX = VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX, eIndirectCommandsLayoutCreateInfoNVX = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX, eCmdProcessCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX, eCmdReserveSpaceForCommandsInfoNVX = VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX, eDeviceGeneratedCommandsLimitsNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX, eDeviceGeneratedCommandsFeaturesNVX = VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX, + ePipelineViewportWScalingStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV, eSurfaceCapabilities2EXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT, eDisplayPowerInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT, eDeviceEventInfoEXT = VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT, eDisplayEventInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT, - eSwapchainCounterCreateInfoEXT = VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT + eSwapchainCounterCreateInfoEXT = VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT, + ePresentTimesInfoGOOGLE = VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE, + ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX, + ePipelineViewportSwizzleStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, + ePhysicalDeviceDiscardRectanglePropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, + ePipelineDiscardRectangleStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT, + eHdrMetadataEXT = VK_STRUCTURE_TYPE_HDR_METADATA_EXT, + eIosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, + eMacosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK }; struct ApplicationInfo @@ -5599,12 +6410,6 @@ namespace vk return *this; } - ApplicationInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ApplicationInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -5698,12 +6503,6 @@ namespace vk return *this; } - DeviceQueueCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DeviceQueueCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -5793,12 +6592,6 @@ namespace vk return *this; } - DeviceCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DeviceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -5918,12 +6711,6 @@ namespace vk return *this; } - InstanceCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - InstanceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6023,12 +6810,6 @@ namespace vk return *this; } - MemoryAllocateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - MemoryAllocateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6097,12 +6878,6 @@ namespace vk return *this; } - MappedMemoryRange& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - MappedMemoryRange& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6184,12 +6959,6 @@ namespace vk return *this; } - WriteDescriptorSet& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - WriteDescriptorSet& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6310,12 +7079,6 @@ namespace vk return *this; } - CopyDescriptorSet& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CopyDescriptorSet& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6426,12 +7189,6 @@ namespace vk return *this; } - BufferViewCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - BufferViewCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6524,12 +7281,6 @@ namespace vk return *this; } - ShaderModuleCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ShaderModuleCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6606,12 +7357,6 @@ namespace vk return *this; } - DescriptorSetAllocateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DescriptorSetAllocateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6690,12 +7435,6 @@ namespace vk return *this; } - PipelineVertexInputStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineVertexInputStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6788,12 +7527,6 @@ namespace vk return *this; } - PipelineInputAssemblyStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineInputAssemblyStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6869,12 +7602,6 @@ namespace vk return *this; } - PipelineTessellationStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineTessellationStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -6945,12 +7672,6 @@ namespace vk return *this; } - PipelineViewportStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineViewportStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7051,12 +7772,6 @@ namespace vk return *this; } - PipelineRasterizationStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineRasterizationStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7204,12 +7919,6 @@ namespace vk return *this; } - PipelineDepthStencilStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineDepthStencilStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7342,12 +8051,6 @@ namespace vk return *this; } - PipelineCacheCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineCacheCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7437,12 +8140,6 @@ namespace vk return *this; } - SamplerCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - SamplerCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7623,12 +8320,6 @@ namespace vk return *this; } - CommandBufferAllocateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CommandBufferAllocateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7707,12 +8398,6 @@ namespace vk return *this; } - RenderPassBeginInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - RenderPassBeginInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7803,12 +8488,6 @@ namespace vk return *this; } - EventCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - EventCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7867,12 +8546,6 @@ namespace vk return *this; } - SemaphoreCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - SemaphoreCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -7937,12 +8610,6 @@ namespace vk return *this; } - FramebufferCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - FramebufferCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8050,12 +8717,6 @@ namespace vk return *this; } - DisplayModeCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DisplayModeCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8124,12 +8785,6 @@ namespace vk return *this; } - DisplayPresentInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DisplayPresentInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8206,12 +8861,6 @@ namespace vk return *this; } - AndroidSurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - AndroidSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8282,12 +8931,6 @@ namespace vk return *this; } - MirSurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - MirSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8365,12 +9008,6 @@ namespace vk return *this; } - ViSurfaceCreateInfoNN& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ViSurfaceCreateInfoNN& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8441,12 +9078,6 @@ namespace vk return *this; } - WaylandSurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - WaylandSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8525,12 +9156,6 @@ namespace vk return *this; } - Win32SurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - Win32SurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8609,12 +9234,6 @@ namespace vk return *this; } - XlibSurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - XlibSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8693,12 +9312,6 @@ namespace vk return *this; } - XcbSurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - XcbSurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8775,12 +9388,6 @@ namespace vk return *this; } - DebugMarkerMarkerInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DebugMarkerMarkerInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8847,12 +9454,6 @@ namespace vk return *this; } - DedicatedAllocationImageCreateInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DedicatedAllocationImageCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8911,12 +9512,6 @@ namespace vk return *this; } - DedicatedAllocationBufferCreateInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DedicatedAllocationBufferCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -8976,12 +9571,6 @@ namespace vk return *this; } - DedicatedAllocationMemoryAllocateInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DedicatedAllocationMemoryAllocateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9050,12 +9639,6 @@ namespace vk return *this; } - ExportMemoryWin32HandleInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ExportMemoryWin32HandleInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9130,12 +9713,6 @@ namespace vk return *this; } - Win32KeyedMutexAcquireReleaseInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - Win32KeyedMutexAcquireReleaseInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9243,12 +9820,6 @@ namespace vk return *this; } - DeviceGeneratedCommandsFeaturesNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DeviceGeneratedCommandsFeaturesNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9311,12 +9882,6 @@ namespace vk return *this; } - DeviceGeneratedCommandsLimitsNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DeviceGeneratedCommandsLimitsNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9409,12 +9974,6 @@ namespace vk return *this; } - CmdReserveSpaceForCommandsInfoNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CmdReserveSpaceForCommandsInfoNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9489,12 +10048,6 @@ namespace vk return *this; } - PhysicalDeviceFeatures2KHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PhysicalDeviceFeatures2KHR& setPNext( void* pNext_ ) { pNext = pNext_; @@ -9533,6 +10086,2006 @@ namespace vk }; static_assert( sizeof( PhysicalDeviceFeatures2KHR ) == sizeof( VkPhysicalDeviceFeatures2KHR ), "struct and wrapper have different size!" ); + struct PhysicalDevicePushDescriptorPropertiesKHR + { + PhysicalDevicePushDescriptorPropertiesKHR( uint32_t maxPushDescriptors_ = 0 ) + : sType( StructureType::ePhysicalDevicePushDescriptorPropertiesKHR ) + , pNext( nullptr ) + , maxPushDescriptors( maxPushDescriptors_ ) + { + } + + PhysicalDevicePushDescriptorPropertiesKHR( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDevicePushDescriptorPropertiesKHR) ); + } + + PhysicalDevicePushDescriptorPropertiesKHR& operator=( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDevicePushDescriptorPropertiesKHR) ); + return *this; + } + + PhysicalDevicePushDescriptorPropertiesKHR& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDevicePushDescriptorPropertiesKHR& setMaxPushDescriptors( uint32_t maxPushDescriptors_ ) + { + maxPushDescriptors = maxPushDescriptors_; + return *this; + } + + operator const VkPhysicalDevicePushDescriptorPropertiesKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxPushDescriptors == rhs.maxPushDescriptors ); + } + + bool operator!=( PhysicalDevicePushDescriptorPropertiesKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t maxPushDescriptors; + }; + static_assert( sizeof( PhysicalDevicePushDescriptorPropertiesKHR ) == sizeof( VkPhysicalDevicePushDescriptorPropertiesKHR ), "struct and wrapper have different size!" ); + + struct PresentRegionsKHR + { + PresentRegionsKHR( uint32_t swapchainCount_ = 0, const PresentRegionKHR* pRegions_ = nullptr ) + : sType( StructureType::ePresentRegionsKHR ) + , pNext( nullptr ) + , swapchainCount( swapchainCount_ ) + , pRegions( pRegions_ ) + { + } + + PresentRegionsKHR( VkPresentRegionsKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentRegionsKHR) ); + } + + PresentRegionsKHR& operator=( VkPresentRegionsKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentRegionsKHR) ); + return *this; + } + + PresentRegionsKHR& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PresentRegionsKHR& setSwapchainCount( uint32_t swapchainCount_ ) + { + swapchainCount = swapchainCount_; + return *this; + } + + PresentRegionsKHR& setPRegions( const PresentRegionKHR* pRegions_ ) + { + pRegions = pRegions_; + return *this; + } + + operator const VkPresentRegionsKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentRegionsKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchainCount == rhs.swapchainCount ) + && ( pRegions == rhs.pRegions ); + } + + bool operator!=( PresentRegionsKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t swapchainCount; + const PresentRegionKHR* pRegions; + }; + static_assert( sizeof( PresentRegionsKHR ) == sizeof( VkPresentRegionsKHR ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceIDPropertiesKHX + { + operator const VkPhysicalDeviceIDPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceIDPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memcmp( deviceUUID, rhs.deviceUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( driverUUID, rhs.driverUUID, VK_UUID_SIZE * sizeof( uint8_t ) ) == 0 ) + && ( memcmp( deviceLUID, rhs.deviceLUID, VK_LUID_SIZE_KHX * sizeof( uint8_t ) ) == 0 ) + && ( deviceLUIDValid == rhs.deviceLUIDValid ); + } + + bool operator!=( PhysicalDeviceIDPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint8_t deviceUUID[VK_UUID_SIZE]; + uint8_t driverUUID[VK_UUID_SIZE]; + uint8_t deviceLUID[VK_LUID_SIZE_KHX]; + Bool32 deviceLUIDValid; + }; + static_assert( sizeof( PhysicalDeviceIDPropertiesKHX ) == sizeof( VkPhysicalDeviceIDPropertiesKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ExportMemoryWin32HandleInfoKHX + { + ExportMemoryWin32HandleInfoKHX( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : sType( StructureType::eExportMemoryWin32HandleInfoKHX ) + , pNext( nullptr ) + , pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) + { + } + + ExportMemoryWin32HandleInfoKHX( VkExportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryWin32HandleInfoKHX) ); + } + + ExportMemoryWin32HandleInfoKHX& operator=( VkExportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryWin32HandleInfoKHX) ); + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + { + pAttributes = pAttributes_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setDwAccess( DWORD dwAccess_ ) + { + dwAccess = dwAccess_; + return *this; + } + + ExportMemoryWin32HandleInfoKHX& setName( LPCWSTR name_ ) + { + name = name_; + return *this; + } + + operator const VkExportMemoryWin32HandleInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExportMemoryWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); + } + + bool operator!=( ExportMemoryWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; + }; + static_assert( sizeof( ExportMemoryWin32HandleInfoKHX ) == sizeof( VkExportMemoryWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct MemoryWin32HandlePropertiesKHX + { + operator const VkMemoryWin32HandlePropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MemoryWin32HandlePropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); + } + + bool operator!=( MemoryWin32HandlePropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryWin32HandlePropertiesKHX ) == sizeof( VkMemoryWin32HandlePropertiesKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct MemoryFdPropertiesKHX + { + operator const VkMemoryFdPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MemoryFdPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memoryTypeBits == rhs.memoryTypeBits ); + } + + bool operator!=( MemoryFdPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t memoryTypeBits; + }; + static_assert( sizeof( MemoryFdPropertiesKHX ) == sizeof( VkMemoryFdPropertiesKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHR + struct Win32KeyedMutexAcquireReleaseInfoKHX + { + Win32KeyedMutexAcquireReleaseInfoKHX( uint32_t acquireCount_ = 0, const DeviceMemory* pAcquireSyncs_ = nullptr, const uint64_t* pAcquireKeys_ = nullptr, const uint32_t* pAcquireTimeouts_ = nullptr, uint32_t releaseCount_ = 0, const DeviceMemory* pReleaseSyncs_ = nullptr, const uint64_t* pReleaseKeys_ = nullptr ) + : sType( StructureType::eWin32KeyedMutexAcquireReleaseInfoKHX ) + , pNext( nullptr ) + , acquireCount( acquireCount_ ) + , pAcquireSyncs( pAcquireSyncs_ ) + , pAcquireKeys( pAcquireKeys_ ) + , pAcquireTimeouts( pAcquireTimeouts_ ) + , releaseCount( releaseCount_ ) + , pReleaseSyncs( pReleaseSyncs_ ) + , pReleaseKeys( pReleaseKeys_ ) + { + } + + Win32KeyedMutexAcquireReleaseInfoKHX( VkWin32KeyedMutexAcquireReleaseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(Win32KeyedMutexAcquireReleaseInfoKHX) ); + } + + Win32KeyedMutexAcquireReleaseInfoKHX& operator=( VkWin32KeyedMutexAcquireReleaseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(Win32KeyedMutexAcquireReleaseInfoKHX) ); + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setAcquireCount( uint32_t acquireCount_ ) + { + acquireCount = acquireCount_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireSyncs( const DeviceMemory* pAcquireSyncs_ ) + { + pAcquireSyncs = pAcquireSyncs_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireKeys( const uint64_t* pAcquireKeys_ ) + { + pAcquireKeys = pAcquireKeys_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPAcquireTimeouts( const uint32_t* pAcquireTimeouts_ ) + { + pAcquireTimeouts = pAcquireTimeouts_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setReleaseCount( uint32_t releaseCount_ ) + { + releaseCount = releaseCount_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPReleaseSyncs( const DeviceMemory* pReleaseSyncs_ ) + { + pReleaseSyncs = pReleaseSyncs_; + return *this; + } + + Win32KeyedMutexAcquireReleaseInfoKHX& setPReleaseKeys( const uint64_t* pReleaseKeys_ ) + { + pReleaseKeys = pReleaseKeys_; + return *this; + } + + operator const VkWin32KeyedMutexAcquireReleaseInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( Win32KeyedMutexAcquireReleaseInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( acquireCount == rhs.acquireCount ) + && ( pAcquireSyncs == rhs.pAcquireSyncs ) + && ( pAcquireKeys == rhs.pAcquireKeys ) + && ( pAcquireTimeouts == rhs.pAcquireTimeouts ) + && ( releaseCount == rhs.releaseCount ) + && ( pReleaseSyncs == rhs.pReleaseSyncs ) + && ( pReleaseKeys == rhs.pReleaseKeys ); + } + + bool operator!=( Win32KeyedMutexAcquireReleaseInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t acquireCount; + const DeviceMemory* pAcquireSyncs; + const uint64_t* pAcquireKeys; + const uint32_t* pAcquireTimeouts; + uint32_t releaseCount; + const DeviceMemory* pReleaseSyncs; + const uint64_t* pReleaseKeys; + }; + static_assert( sizeof( Win32KeyedMutexAcquireReleaseInfoKHX ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ExportSemaphoreWin32HandleInfoKHX + { + ExportSemaphoreWin32HandleInfoKHX( const SECURITY_ATTRIBUTES* pAttributes_ = nullptr, DWORD dwAccess_ = 0, LPCWSTR name_ = 0 ) + : sType( StructureType::eExportSemaphoreWin32HandleInfoKHX ) + , pNext( nullptr ) + , pAttributes( pAttributes_ ) + , dwAccess( dwAccess_ ) + , name( name_ ) + { + } + + ExportSemaphoreWin32HandleInfoKHX( VkExportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreWin32HandleInfoKHX) ); + } + + ExportSemaphoreWin32HandleInfoKHX& operator=( VkExportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreWin32HandleInfoKHX) ); + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setPAttributes( const SECURITY_ATTRIBUTES* pAttributes_ ) + { + pAttributes = pAttributes_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setDwAccess( DWORD dwAccess_ ) + { + dwAccess = dwAccess_; + return *this; + } + + ExportSemaphoreWin32HandleInfoKHX& setName( LPCWSTR name_ ) + { + name = name_; + return *this; + } + + operator const VkExportSemaphoreWin32HandleInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( pAttributes == rhs.pAttributes ) + && ( dwAccess == rhs.dwAccess ) + && ( name == rhs.name ); + } + + bool operator!=( ExportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + const SECURITY_ATTRIBUTES* pAttributes; + DWORD dwAccess; + LPCWSTR name; + }; + static_assert( sizeof( ExportSemaphoreWin32HandleInfoKHX ) == sizeof( VkExportSemaphoreWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct D3D12FenceSubmitInfoKHX + { + D3D12FenceSubmitInfoKHX( uint32_t waitSemaphoreValuesCount_ = 0, const uint64_t* pWaitSemaphoreValues_ = nullptr, uint32_t signalSemaphoreValuesCount_ = 0, const uint64_t* pSignalSemaphoreValues_ = nullptr ) + : sType( StructureType::eD3D12FenceSubmitInfoKHX ) + , pNext( nullptr ) + , waitSemaphoreValuesCount( waitSemaphoreValuesCount_ ) + , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) + , signalSemaphoreValuesCount( signalSemaphoreValuesCount_ ) + , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) + { + } + + D3D12FenceSubmitInfoKHX( VkD3D12FenceSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(D3D12FenceSubmitInfoKHX) ); + } + + D3D12FenceSubmitInfoKHX& operator=( VkD3D12FenceSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(D3D12FenceSubmitInfoKHX) ); + return *this; + } + + D3D12FenceSubmitInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setWaitSemaphoreValuesCount( uint32_t waitSemaphoreValuesCount_ ) + { + waitSemaphoreValuesCount = waitSemaphoreValuesCount_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setPWaitSemaphoreValues( const uint64_t* pWaitSemaphoreValues_ ) + { + pWaitSemaphoreValues = pWaitSemaphoreValues_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setSignalSemaphoreValuesCount( uint32_t signalSemaphoreValuesCount_ ) + { + signalSemaphoreValuesCount = signalSemaphoreValuesCount_; + return *this; + } + + D3D12FenceSubmitInfoKHX& setPSignalSemaphoreValues( const uint64_t* pSignalSemaphoreValues_ ) + { + pSignalSemaphoreValues = pSignalSemaphoreValues_; + return *this; + } + + operator const VkD3D12FenceSubmitInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( D3D12FenceSubmitInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( waitSemaphoreValuesCount == rhs.waitSemaphoreValuesCount ) + && ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) + && ( signalSemaphoreValuesCount == rhs.signalSemaphoreValuesCount ) + && ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); + } + + bool operator!=( D3D12FenceSubmitInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t* pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t* pSignalSemaphoreValues; + }; + static_assert( sizeof( D3D12FenceSubmitInfoKHX ) == sizeof( VkD3D12FenceSubmitInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct PhysicalDeviceMultiviewFeaturesKHX + { + PhysicalDeviceMultiviewFeaturesKHX( Bool32 multiview_ = 0, Bool32 multiviewGeometryShader_ = 0, Bool32 multiviewTessellationShader_ = 0 ) + : sType( StructureType::ePhysicalDeviceMultiviewFeaturesKHX ) + , pNext( nullptr ) + , multiview( multiview_ ) + , multiviewGeometryShader( multiviewGeometryShader_ ) + , multiviewTessellationShader( multiviewTessellationShader_ ) + { + } + + PhysicalDeviceMultiviewFeaturesKHX( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceMultiviewFeaturesKHX) ); + } + + PhysicalDeviceMultiviewFeaturesKHX& operator=( VkPhysicalDeviceMultiviewFeaturesKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceMultiviewFeaturesKHX) ); + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiview( Bool32 multiview_ ) + { + multiview = multiview_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiviewGeometryShader( Bool32 multiviewGeometryShader_ ) + { + multiviewGeometryShader = multiviewGeometryShader_; + return *this; + } + + PhysicalDeviceMultiviewFeaturesKHX& setMultiviewTessellationShader( Bool32 multiviewTessellationShader_ ) + { + multiviewTessellationShader = multiviewTessellationShader_; + return *this; + } + + operator const VkPhysicalDeviceMultiviewFeaturesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( multiview == rhs.multiview ) + && ( multiviewGeometryShader == rhs.multiviewGeometryShader ) + && ( multiviewTessellationShader == rhs.multiviewTessellationShader ); + } + + bool operator!=( PhysicalDeviceMultiviewFeaturesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + Bool32 multiview; + Bool32 multiviewGeometryShader; + Bool32 multiviewTessellationShader; + }; + static_assert( sizeof( PhysicalDeviceMultiviewFeaturesKHX ) == sizeof( VkPhysicalDeviceMultiviewFeaturesKHX ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceMultiviewPropertiesKHX + { + operator const VkPhysicalDeviceMultiviewPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) + && ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ); + } + + bool operator!=( PhysicalDeviceMultiviewPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t maxMultiviewViewCount; + uint32_t maxMultiviewInstanceIndex; + }; + static_assert( sizeof( PhysicalDeviceMultiviewPropertiesKHX ) == sizeof( VkPhysicalDeviceMultiviewPropertiesKHX ), "struct and wrapper have different size!" ); + + struct RenderPassMultiviewCreateInfoKHX + { + RenderPassMultiviewCreateInfoKHX( uint32_t subpassCount_ = 0, const uint32_t* pViewMasks_ = nullptr, uint32_t dependencyCount_ = 0, const int32_t* pViewOffsets_ = nullptr, uint32_t correlationMaskCount_ = 0, const uint32_t* pCorrelationMasks_ = nullptr ) + : sType( StructureType::eRenderPassMultiviewCreateInfoKHX ) + , pNext( nullptr ) + , subpassCount( subpassCount_ ) + , pViewMasks( pViewMasks_ ) + , dependencyCount( dependencyCount_ ) + , pViewOffsets( pViewOffsets_ ) + , correlationMaskCount( correlationMaskCount_ ) + , pCorrelationMasks( pCorrelationMasks_ ) + { + } + + RenderPassMultiviewCreateInfoKHX( VkRenderPassMultiviewCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassMultiviewCreateInfoKHX) ); + } + + RenderPassMultiviewCreateInfoKHX& operator=( VkRenderPassMultiviewCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassMultiviewCreateInfoKHX) ); + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setSubpassCount( uint32_t subpassCount_ ) + { + subpassCount = subpassCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPViewMasks( const uint32_t* pViewMasks_ ) + { + pViewMasks = pViewMasks_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setDependencyCount( uint32_t dependencyCount_ ) + { + dependencyCount = dependencyCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPViewOffsets( const int32_t* pViewOffsets_ ) + { + pViewOffsets = pViewOffsets_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setCorrelationMaskCount( uint32_t correlationMaskCount_ ) + { + correlationMaskCount = correlationMaskCount_; + return *this; + } + + RenderPassMultiviewCreateInfoKHX& setPCorrelationMasks( const uint32_t* pCorrelationMasks_ ) + { + pCorrelationMasks = pCorrelationMasks_; + return *this; + } + + operator const VkRenderPassMultiviewCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( RenderPassMultiviewCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( subpassCount == rhs.subpassCount ) + && ( pViewMasks == rhs.pViewMasks ) + && ( dependencyCount == rhs.dependencyCount ) + && ( pViewOffsets == rhs.pViewOffsets ) + && ( correlationMaskCount == rhs.correlationMaskCount ) + && ( pCorrelationMasks == rhs.pCorrelationMasks ); + } + + bool operator!=( RenderPassMultiviewCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t subpassCount; + const uint32_t* pViewMasks; + uint32_t dependencyCount; + const int32_t* pViewOffsets; + uint32_t correlationMaskCount; + const uint32_t* pCorrelationMasks; + }; + static_assert( sizeof( RenderPassMultiviewCreateInfoKHX ) == sizeof( VkRenderPassMultiviewCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct BindBufferMemoryInfoKHX + { + BindBufferMemoryInfoKHX( Buffer buffer_ = Buffer(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0, uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr ) + : sType( StructureType::eBindBufferMemoryInfoKHX ) + , pNext( nullptr ) + , buffer( buffer_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) + , deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) + { + } + + BindBufferMemoryInfoKHX( VkBindBufferMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindBufferMemoryInfoKHX) ); + } + + BindBufferMemoryInfoKHX& operator=( VkBindBufferMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindBufferMemoryInfoKHX) ); + return *this; + } + + BindBufferMemoryInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindBufferMemoryInfoKHX& setBuffer( Buffer buffer_ ) + { + buffer = buffer_; + return *this; + } + + BindBufferMemoryInfoKHX& setMemory( DeviceMemory memory_ ) + { + memory = memory_; + return *this; + } + + BindBufferMemoryInfoKHX& setMemoryOffset( DeviceSize memoryOffset_ ) + { + memoryOffset = memoryOffset_; + return *this; + } + + BindBufferMemoryInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) + { + deviceIndexCount = deviceIndexCount_; + return *this; + } + + BindBufferMemoryInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + { + pDeviceIndices = pDeviceIndices_; + return *this; + } + + operator const VkBindBufferMemoryInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( BindBufferMemoryInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( buffer == rhs.buffer ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ) + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ); + } + + bool operator!=( BindBufferMemoryInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Buffer buffer; + DeviceMemory memory; + DeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + }; + static_assert( sizeof( BindBufferMemoryInfoKHX ) == sizeof( VkBindBufferMemoryInfoKHX ), "struct and wrapper have different size!" ); + + struct BindImageMemoryInfoKHX + { + BindImageMemoryInfoKHX( Image image_ = Image(), DeviceMemory memory_ = DeviceMemory(), DeviceSize memoryOffset_ = 0, uint32_t deviceIndexCount_ = 0, const uint32_t* pDeviceIndices_ = nullptr, uint32_t SFRRectCount_ = 0, const Rect2D* pSFRRects_ = nullptr ) + : sType( StructureType::eBindImageMemoryInfoKHX ) + , pNext( nullptr ) + , image( image_ ) + , memory( memory_ ) + , memoryOffset( memoryOffset_ ) + , deviceIndexCount( deviceIndexCount_ ) + , pDeviceIndices( pDeviceIndices_ ) + , SFRRectCount( SFRRectCount_ ) + , pSFRRects( pSFRRects_ ) + { + } + + BindImageMemoryInfoKHX( VkBindImageMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemoryInfoKHX) ); + } + + BindImageMemoryInfoKHX& operator=( VkBindImageMemoryInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemoryInfoKHX) ); + return *this; + } + + BindImageMemoryInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindImageMemoryInfoKHX& setImage( Image image_ ) + { + image = image_; + return *this; + } + + BindImageMemoryInfoKHX& setMemory( DeviceMemory memory_ ) + { + memory = memory_; + return *this; + } + + BindImageMemoryInfoKHX& setMemoryOffset( DeviceSize memoryOffset_ ) + { + memoryOffset = memoryOffset_; + return *this; + } + + BindImageMemoryInfoKHX& setDeviceIndexCount( uint32_t deviceIndexCount_ ) + { + deviceIndexCount = deviceIndexCount_; + return *this; + } + + BindImageMemoryInfoKHX& setPDeviceIndices( const uint32_t* pDeviceIndices_ ) + { + pDeviceIndices = pDeviceIndices_; + return *this; + } + + BindImageMemoryInfoKHX& setSFRRectCount( uint32_t SFRRectCount_ ) + { + SFRRectCount = SFRRectCount_; + return *this; + } + + BindImageMemoryInfoKHX& setPSFRRects( const Rect2D* pSFRRects_ ) + { + pSFRRects = pSFRRects_; + return *this; + } + + operator const VkBindImageMemoryInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( BindImageMemoryInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( image == rhs.image ) + && ( memory == rhs.memory ) + && ( memoryOffset == rhs.memoryOffset ) + && ( deviceIndexCount == rhs.deviceIndexCount ) + && ( pDeviceIndices == rhs.pDeviceIndices ) + && ( SFRRectCount == rhs.SFRRectCount ) + && ( pSFRRects == rhs.pSFRRects ); + } + + bool operator!=( BindImageMemoryInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Image image; + DeviceMemory memory; + DeviceSize memoryOffset; + uint32_t deviceIndexCount; + const uint32_t* pDeviceIndices; + uint32_t SFRRectCount; + const Rect2D* pSFRRects; + }; + static_assert( sizeof( BindImageMemoryInfoKHX ) == sizeof( VkBindImageMemoryInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupRenderPassBeginInfoKHX + { + DeviceGroupRenderPassBeginInfoKHX( uint32_t deviceMask_ = 0, uint32_t deviceRenderAreaCount_ = 0, const Rect2D* pDeviceRenderAreas_ = nullptr ) + : sType( StructureType::eDeviceGroupRenderPassBeginInfoKHX ) + , pNext( nullptr ) + , deviceMask( deviceMask_ ) + , deviceRenderAreaCount( deviceRenderAreaCount_ ) + , pDeviceRenderAreas( pDeviceRenderAreas_ ) + { + } + + DeviceGroupRenderPassBeginInfoKHX( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupRenderPassBeginInfoKHX) ); + } + + DeviceGroupRenderPassBeginInfoKHX& operator=( VkDeviceGroupRenderPassBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupRenderPassBeginInfoKHX) ); + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setDeviceRenderAreaCount( uint32_t deviceRenderAreaCount_ ) + { + deviceRenderAreaCount = deviceRenderAreaCount_; + return *this; + } + + DeviceGroupRenderPassBeginInfoKHX& setPDeviceRenderAreas( const Rect2D* pDeviceRenderAreas_ ) + { + pDeviceRenderAreas = pDeviceRenderAreas_; + return *this; + } + + operator const VkDeviceGroupRenderPassBeginInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( deviceMask == rhs.deviceMask ) + && ( deviceRenderAreaCount == rhs.deviceRenderAreaCount ) + && ( pDeviceRenderAreas == rhs.pDeviceRenderAreas ); + } + + bool operator!=( DeviceGroupRenderPassBeginInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const Rect2D* pDeviceRenderAreas; + }; + static_assert( sizeof( DeviceGroupRenderPassBeginInfoKHX ) == sizeof( VkDeviceGroupRenderPassBeginInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupCommandBufferBeginInfoKHX + { + DeviceGroupCommandBufferBeginInfoKHX( uint32_t deviceMask_ = 0 ) + : sType( StructureType::eDeviceGroupCommandBufferBeginInfoKHX ) + , pNext( nullptr ) + , deviceMask( deviceMask_ ) + { + } + + DeviceGroupCommandBufferBeginInfoKHX( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupCommandBufferBeginInfoKHX) ); + } + + DeviceGroupCommandBufferBeginInfoKHX& operator=( VkDeviceGroupCommandBufferBeginInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupCommandBufferBeginInfoKHX) ); + return *this; + } + + DeviceGroupCommandBufferBeginInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupCommandBufferBeginInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkDeviceGroupCommandBufferBeginInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( DeviceGroupCommandBufferBeginInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t deviceMask; + }; + static_assert( sizeof( DeviceGroupCommandBufferBeginInfoKHX ) == sizeof( VkDeviceGroupCommandBufferBeginInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupSubmitInfoKHX + { + DeviceGroupSubmitInfoKHX( uint32_t waitSemaphoreCount_ = 0, const uint32_t* pWaitSemaphoreDeviceIndices_ = nullptr, uint32_t commandBufferCount_ = 0, const uint32_t* pCommandBufferDeviceMasks_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const uint32_t* pSignalSemaphoreDeviceIndices_ = nullptr ) + : sType( StructureType::eDeviceGroupSubmitInfoKHX ) + , pNext( nullptr ) + , waitSemaphoreCount( waitSemaphoreCount_ ) + , pWaitSemaphoreDeviceIndices( pWaitSemaphoreDeviceIndices_ ) + , commandBufferCount( commandBufferCount_ ) + , pCommandBufferDeviceMasks( pCommandBufferDeviceMasks_ ) + , signalSemaphoreCount( signalSemaphoreCount_ ) + , pSignalSemaphoreDeviceIndices( pSignalSemaphoreDeviceIndices_ ) + { + } + + DeviceGroupSubmitInfoKHX( VkDeviceGroupSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSubmitInfoKHX) ); + } + + DeviceGroupSubmitInfoKHX& operator=( VkDeviceGroupSubmitInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSubmitInfoKHX) ); + return *this; + } + + DeviceGroupSubmitInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) + { + waitSemaphoreCount = waitSemaphoreCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPWaitSemaphoreDeviceIndices( const uint32_t* pWaitSemaphoreDeviceIndices_ ) + { + pWaitSemaphoreDeviceIndices = pWaitSemaphoreDeviceIndices_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setCommandBufferCount( uint32_t commandBufferCount_ ) + { + commandBufferCount = commandBufferCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPCommandBufferDeviceMasks( const uint32_t* pCommandBufferDeviceMasks_ ) + { + pCommandBufferDeviceMasks = pCommandBufferDeviceMasks_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) + { + signalSemaphoreCount = signalSemaphoreCount_; + return *this; + } + + DeviceGroupSubmitInfoKHX& setPSignalSemaphoreDeviceIndices( const uint32_t* pSignalSemaphoreDeviceIndices_ ) + { + pSignalSemaphoreDeviceIndices = pSignalSemaphoreDeviceIndices_; + return *this; + } + + operator const VkDeviceGroupSubmitInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupSubmitInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) + && ( pWaitSemaphoreDeviceIndices == rhs.pWaitSemaphoreDeviceIndices ) + && ( commandBufferCount == rhs.commandBufferCount ) + && ( pCommandBufferDeviceMasks == rhs.pCommandBufferDeviceMasks ) + && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) + && ( pSignalSemaphoreDeviceIndices == rhs.pSignalSemaphoreDeviceIndices ); + } + + bool operator!=( DeviceGroupSubmitInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t waitSemaphoreCount; + const uint32_t* pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t* pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t* pSignalSemaphoreDeviceIndices; + }; + static_assert( sizeof( DeviceGroupSubmitInfoKHX ) == sizeof( VkDeviceGroupSubmitInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupBindSparseInfoKHX + { + DeviceGroupBindSparseInfoKHX( uint32_t resourceDeviceIndex_ = 0, uint32_t memoryDeviceIndex_ = 0 ) + : sType( StructureType::eDeviceGroupBindSparseInfoKHX ) + , pNext( nullptr ) + , resourceDeviceIndex( resourceDeviceIndex_ ) + , memoryDeviceIndex( memoryDeviceIndex_ ) + { + } + + DeviceGroupBindSparseInfoKHX( VkDeviceGroupBindSparseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupBindSparseInfoKHX) ); + } + + DeviceGroupBindSparseInfoKHX& operator=( VkDeviceGroupBindSparseInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupBindSparseInfoKHX) ); + return *this; + } + + DeviceGroupBindSparseInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupBindSparseInfoKHX& setResourceDeviceIndex( uint32_t resourceDeviceIndex_ ) + { + resourceDeviceIndex = resourceDeviceIndex_; + return *this; + } + + DeviceGroupBindSparseInfoKHX& setMemoryDeviceIndex( uint32_t memoryDeviceIndex_ ) + { + memoryDeviceIndex = memoryDeviceIndex_; + return *this; + } + + operator const VkDeviceGroupBindSparseInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupBindSparseInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( resourceDeviceIndex == rhs.resourceDeviceIndex ) + && ( memoryDeviceIndex == rhs.memoryDeviceIndex ); + } + + bool operator!=( DeviceGroupBindSparseInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; + }; + static_assert( sizeof( DeviceGroupBindSparseInfoKHX ) == sizeof( VkDeviceGroupBindSparseInfoKHX ), "struct and wrapper have different size!" ); + + struct ImageSwapchainCreateInfoKHX + { + ImageSwapchainCreateInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR() ) + : sType( StructureType::eImageSwapchainCreateInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + { + } + + ImageSwapchainCreateInfoKHX( VkImageSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImageSwapchainCreateInfoKHX) ); + } + + ImageSwapchainCreateInfoKHX& operator=( VkImageSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImageSwapchainCreateInfoKHX) ); + return *this; + } + + ImageSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImageSwapchainCreateInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + operator const VkImageSwapchainCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImageSwapchainCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ); + } + + bool operator!=( ImageSwapchainCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + }; + static_assert( sizeof( ImageSwapchainCreateInfoKHX ) == sizeof( VkImageSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct BindImageMemorySwapchainInfoKHX + { + BindImageMemorySwapchainInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint32_t imageIndex_ = 0 ) + : sType( StructureType::eBindImageMemorySwapchainInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + , imageIndex( imageIndex_ ) + { + } + + BindImageMemorySwapchainInfoKHX( VkBindImageMemorySwapchainInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemorySwapchainInfoKHX) ); + } + + BindImageMemorySwapchainInfoKHX& operator=( VkBindImageMemorySwapchainInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(BindImageMemorySwapchainInfoKHX) ); + return *this; + } + + BindImageMemorySwapchainInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + BindImageMemorySwapchainInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + BindImageMemorySwapchainInfoKHX& setImageIndex( uint32_t imageIndex_ ) + { + imageIndex = imageIndex_; + return *this; + } + + operator const VkBindImageMemorySwapchainInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( BindImageMemorySwapchainInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ) + && ( imageIndex == rhs.imageIndex ); + } + + bool operator!=( BindImageMemorySwapchainInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + uint32_t imageIndex; + }; + static_assert( sizeof( BindImageMemorySwapchainInfoKHX ) == sizeof( VkBindImageMemorySwapchainInfoKHX ), "struct and wrapper have different size!" ); + + struct AcquireNextImageInfoKHX + { + AcquireNextImageInfoKHX( SwapchainKHR swapchain_ = SwapchainKHR(), uint64_t timeout_ = 0, Semaphore semaphore_ = Semaphore(), Fence fence_ = Fence(), uint32_t deviceMask_ = 0 ) + : sType( StructureType::eAcquireNextImageInfoKHX ) + , pNext( nullptr ) + , swapchain( swapchain_ ) + , timeout( timeout_ ) + , semaphore( semaphore_ ) + , fence( fence_ ) + , deviceMask( deviceMask_ ) + { + } + + AcquireNextImageInfoKHX( VkAcquireNextImageInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(AcquireNextImageInfoKHX) ); + } + + AcquireNextImageInfoKHX& operator=( VkAcquireNextImageInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(AcquireNextImageInfoKHX) ); + return *this; + } + + AcquireNextImageInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + AcquireNextImageInfoKHX& setSwapchain( SwapchainKHR swapchain_ ) + { + swapchain = swapchain_; + return *this; + } + + AcquireNextImageInfoKHX& setTimeout( uint64_t timeout_ ) + { + timeout = timeout_; + return *this; + } + + AcquireNextImageInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + AcquireNextImageInfoKHX& setFence( Fence fence_ ) + { + fence = fence_; + return *this; + } + + AcquireNextImageInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkAcquireNextImageInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( AcquireNextImageInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchain == rhs.swapchain ) + && ( timeout == rhs.timeout ) + && ( semaphore == rhs.semaphore ) + && ( fence == rhs.fence ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( AcquireNextImageInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainKHR swapchain; + uint64_t timeout; + Semaphore semaphore; + Fence fence; + uint32_t deviceMask; + }; + static_assert( sizeof( AcquireNextImageInfoKHX ) == sizeof( VkAcquireNextImageInfoKHX ), "struct and wrapper have different size!" ); + + struct HdrMetadataEXT + { + HdrMetadataEXT( XYColorEXT displayPrimaryRed_ = XYColorEXT(), XYColorEXT displayPrimaryGreen_ = XYColorEXT(), XYColorEXT displayPrimaryBlue_ = XYColorEXT(), XYColorEXT whitePoint_ = XYColorEXT(), float maxLuminance_ = 0, float minLuminance_ = 0, float maxContentLightLevel_ = 0, float maxFrameAverageLightLevel_ = 0 ) + : sType( StructureType::eHdrMetadataEXT ) + , pNext( nullptr ) + , displayPrimaryRed( displayPrimaryRed_ ) + , displayPrimaryGreen( displayPrimaryGreen_ ) + , displayPrimaryBlue( displayPrimaryBlue_ ) + , whitePoint( whitePoint_ ) + , maxLuminance( maxLuminance_ ) + , minLuminance( minLuminance_ ) + , maxContentLightLevel( maxContentLightLevel_ ) + , maxFrameAverageLightLevel( maxFrameAverageLightLevel_ ) + { + } + + HdrMetadataEXT( VkHdrMetadataEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(HdrMetadataEXT) ); + } + + HdrMetadataEXT& operator=( VkHdrMetadataEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(HdrMetadataEXT) ); + return *this; + } + + HdrMetadataEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + HdrMetadataEXT& setDisplayPrimaryRed( XYColorEXT displayPrimaryRed_ ) + { + displayPrimaryRed = displayPrimaryRed_; + return *this; + } + + HdrMetadataEXT& setDisplayPrimaryGreen( XYColorEXT displayPrimaryGreen_ ) + { + displayPrimaryGreen = displayPrimaryGreen_; + return *this; + } + + HdrMetadataEXT& setDisplayPrimaryBlue( XYColorEXT displayPrimaryBlue_ ) + { + displayPrimaryBlue = displayPrimaryBlue_; + return *this; + } + + HdrMetadataEXT& setWhitePoint( XYColorEXT whitePoint_ ) + { + whitePoint = whitePoint_; + return *this; + } + + HdrMetadataEXT& setMaxLuminance( float maxLuminance_ ) + { + maxLuminance = maxLuminance_; + return *this; + } + + HdrMetadataEXT& setMinLuminance( float minLuminance_ ) + { + minLuminance = minLuminance_; + return *this; + } + + HdrMetadataEXT& setMaxContentLightLevel( float maxContentLightLevel_ ) + { + maxContentLightLevel = maxContentLightLevel_; + return *this; + } + + HdrMetadataEXT& setMaxFrameAverageLightLevel( float maxFrameAverageLightLevel_ ) + { + maxFrameAverageLightLevel = maxFrameAverageLightLevel_; + return *this; + } + + operator const VkHdrMetadataEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( HdrMetadataEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( displayPrimaryRed == rhs.displayPrimaryRed ) + && ( displayPrimaryGreen == rhs.displayPrimaryGreen ) + && ( displayPrimaryBlue == rhs.displayPrimaryBlue ) + && ( whitePoint == rhs.whitePoint ) + && ( maxLuminance == rhs.maxLuminance ) + && ( minLuminance == rhs.minLuminance ) + && ( maxContentLightLevel == rhs.maxContentLightLevel ) + && ( maxFrameAverageLightLevel == rhs.maxFrameAverageLightLevel ); + } + + bool operator!=( HdrMetadataEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + XYColorEXT displayPrimaryRed; + XYColorEXT displayPrimaryGreen; + XYColorEXT displayPrimaryBlue; + XYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; + }; + static_assert( sizeof( HdrMetadataEXT ) == sizeof( VkHdrMetadataEXT ), "struct and wrapper have different size!" ); + + struct PresentTimesInfoGOOGLE + { + PresentTimesInfoGOOGLE( uint32_t swapchainCount_ = 0, const PresentTimeGOOGLE* pTimes_ = nullptr ) + : sType( StructureType::ePresentTimesInfoGOOGLE ) + , pNext( nullptr ) + , swapchainCount( swapchainCount_ ) + , pTimes( pTimes_ ) + { + } + + PresentTimesInfoGOOGLE( VkPresentTimesInfoGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentTimesInfoGOOGLE) ); + } + + PresentTimesInfoGOOGLE& operator=( VkPresentTimesInfoGOOGLE const & rhs ) + { + memcpy( this, &rhs, sizeof(PresentTimesInfoGOOGLE) ); + return *this; + } + + PresentTimesInfoGOOGLE& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PresentTimesInfoGOOGLE& setSwapchainCount( uint32_t swapchainCount_ ) + { + swapchainCount = swapchainCount_; + return *this; + } + + PresentTimesInfoGOOGLE& setPTimes( const PresentTimeGOOGLE* pTimes_ ) + { + pTimes = pTimes_; + return *this; + } + + operator const VkPresentTimesInfoGOOGLE&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PresentTimesInfoGOOGLE const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchainCount == rhs.swapchainCount ) + && ( pTimes == rhs.pTimes ); + } + + bool operator!=( PresentTimesInfoGOOGLE const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t swapchainCount; + const PresentTimeGOOGLE* pTimes; + }; + static_assert( sizeof( PresentTimesInfoGOOGLE ) == sizeof( VkPresentTimesInfoGOOGLE ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_IOS_MVK + struct IOSSurfaceCreateInfoMVK + { + IOSSurfaceCreateInfoMVK( IOSSurfaceCreateFlagsMVK flags_ = IOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : sType( StructureType::eIOSSurfaceCreateInfoMVK ) + , pNext( nullptr ) + , flags( flags_ ) + , pView( pView_ ) + { + } + + IOSSurfaceCreateInfoMVK( VkIOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(IOSSurfaceCreateInfoMVK) ); + } + + IOSSurfaceCreateInfoMVK& operator=( VkIOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(IOSSurfaceCreateInfoMVK) ); + return *this; + } + + IOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + IOSSurfaceCreateInfoMVK& setFlags( IOSSurfaceCreateFlagsMVK flags_ ) + { + flags = flags_; + return *this; + } + + IOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + { + pView = pView_; + return *this; + } + + operator const VkIOSSurfaceCreateInfoMVK&() const + { + return *reinterpret_cast(this); + } + + bool operator==( IOSSurfaceCreateInfoMVK const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); + } + + bool operator!=( IOSSurfaceCreateInfoMVK const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + IOSSurfaceCreateFlagsMVK flags; + const void* pView; + }; + static_assert( sizeof( IOSSurfaceCreateInfoMVK ) == sizeof( VkIOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + struct MacOSSurfaceCreateInfoMVK + { + MacOSSurfaceCreateInfoMVK( MacOSSurfaceCreateFlagsMVK flags_ = MacOSSurfaceCreateFlagsMVK(), const void* pView_ = nullptr ) + : sType( StructureType::eMacOSSurfaceCreateInfoMVK ) + , pNext( nullptr ) + , flags( flags_ ) + , pView( pView_ ) + { + } + + MacOSSurfaceCreateInfoMVK( VkMacOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(MacOSSurfaceCreateInfoMVK) ); + } + + MacOSSurfaceCreateInfoMVK& operator=( VkMacOSSurfaceCreateInfoMVK const & rhs ) + { + memcpy( this, &rhs, sizeof(MacOSSurfaceCreateInfoMVK) ); + return *this; + } + + MacOSSurfaceCreateInfoMVK& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + MacOSSurfaceCreateInfoMVK& setFlags( MacOSSurfaceCreateFlagsMVK flags_ ) + { + flags = flags_; + return *this; + } + + MacOSSurfaceCreateInfoMVK& setPView( const void* pView_ ) + { + pView = pView_; + return *this; + } + + operator const VkMacOSSurfaceCreateInfoMVK&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MacOSSurfaceCreateInfoMVK const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( pView == rhs.pView ); + } + + bool operator!=( MacOSSurfaceCreateInfoMVK const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + MacOSSurfaceCreateFlagsMVK flags; + const void* pView; + }; + static_assert( sizeof( MacOSSurfaceCreateInfoMVK ) == sizeof( VkMacOSSurfaceCreateInfoMVK ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + + struct PipelineViewportWScalingStateCreateInfoNV + { + PipelineViewportWScalingStateCreateInfoNV( Bool32 viewportWScalingEnable_ = 0, uint32_t viewportCount_ = 0, const ViewportWScalingNV* pViewportWScalings_ = nullptr ) + : sType( StructureType::ePipelineViewportWScalingStateCreateInfoNV ) + , pNext( nullptr ) + , viewportWScalingEnable( viewportWScalingEnable_ ) + , viewportCount( viewportCount_ ) + , pViewportWScalings( pViewportWScalings_ ) + { + } + + PipelineViewportWScalingStateCreateInfoNV( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportWScalingStateCreateInfoNV) ); + } + + PipelineViewportWScalingStateCreateInfoNV& operator=( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportWScalingStateCreateInfoNV) ); + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setViewportWScalingEnable( Bool32 viewportWScalingEnable_ ) + { + viewportWScalingEnable = viewportWScalingEnable_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) + { + viewportCount = viewportCount_; + return *this; + } + + PipelineViewportWScalingStateCreateInfoNV& setPViewportWScalings( const ViewportWScalingNV* pViewportWScalings_ ) + { + pViewportWScalings = pViewportWScalings_; + return *this; + } + + operator const VkPipelineViewportWScalingStateCreateInfoNV&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( viewportWScalingEnable == rhs.viewportWScalingEnable ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewportWScalings == rhs.pViewportWScalings ); + } + + bool operator!=( PipelineViewportWScalingStateCreateInfoNV const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Bool32 viewportWScalingEnable; + uint32_t viewportCount; + const ViewportWScalingNV* pViewportWScalings; + }; + static_assert( sizeof( PipelineViewportWScalingStateCreateInfoNV ) == sizeof( VkPipelineViewportWScalingStateCreateInfoNV ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceDiscardRectanglePropertiesEXT + { + PhysicalDeviceDiscardRectanglePropertiesEXT( uint32_t maxDiscardRectangles_ = 0 ) + : sType( StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT ) + , pNext( nullptr ) + , maxDiscardRectangles( maxDiscardRectangles_ ) + { + } + + PhysicalDeviceDiscardRectanglePropertiesEXT( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceDiscardRectanglePropertiesEXT) ); + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& operator=( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceDiscardRectanglePropertiesEXT) ); + return *this; + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceDiscardRectanglePropertiesEXT& setMaxDiscardRectangles( uint32_t maxDiscardRectangles_ ) + { + maxDiscardRectangles = maxDiscardRectangles_; + return *this; + } + + operator const VkPhysicalDeviceDiscardRectanglePropertiesEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( maxDiscardRectangles == rhs.maxDiscardRectangles ); + } + + bool operator!=( PhysicalDeviceDiscardRectanglePropertiesEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t maxDiscardRectangles; + }; + static_assert( sizeof( PhysicalDeviceDiscardRectanglePropertiesEXT ) == sizeof( VkPhysicalDeviceDiscardRectanglePropertiesEXT ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX + { + operator const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( perViewPositionAllComponents == rhs.perViewPositionAllComponents ); + } + + bool operator!=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + Bool32 perViewPositionAllComponents; + }; + static_assert( sizeof( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ) == sizeof( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ), "struct and wrapper have different size!" ); + enum class SubpassContents { eInline = VK_SUBPASS_CONTENTS_INLINE, @@ -9564,12 +12117,6 @@ namespace vk return *this; } - PresentInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PresentInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9658,7 +12205,9 @@ namespace vk eDepthBounds = VK_DYNAMIC_STATE_DEPTH_BOUNDS, eStencilCompareMask = VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, eStencilWriteMask = VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, - eStencilReference = VK_DYNAMIC_STATE_STENCIL_REFERENCE + eStencilReference = VK_DYNAMIC_STATE_STENCIL_REFERENCE, + eViewportWScalingNV = VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, + eDiscardRectangleEXT = VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT }; struct PipelineDynamicStateCreateInfo @@ -9683,12 +12232,6 @@ namespace vk return *this; } - PipelineDynamicStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineDynamicStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -9743,6 +12286,133 @@ namespace vk }; static_assert( sizeof( PipelineDynamicStateCreateInfo ) == sizeof( VkPipelineDynamicStateCreateInfo ), "struct and wrapper have different size!" ); + enum class DescriptorUpdateTemplateTypeKHR + { + eDescriptorSet = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, + ePushDescriptors = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR + }; + + struct DescriptorUpdateTemplateCreateInfoKHR + { + DescriptorUpdateTemplateCreateInfoKHR( DescriptorUpdateTemplateCreateFlagsKHR flags_ = DescriptorUpdateTemplateCreateFlagsKHR(), uint32_t descriptorUpdateEntryCount_ = 0, const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ = nullptr, DescriptorUpdateTemplateTypeKHR templateType_ = DescriptorUpdateTemplateTypeKHR::eDescriptorSet, DescriptorSetLayout descriptorSetLayout_ = DescriptorSetLayout(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, PipelineLayout pipelineLayout_ = PipelineLayout(), uint32_t set_ = 0 ) + : sType( StructureType::eDescriptorUpdateTemplateCreateInfoKHR ) + , pNext( nullptr ) + , flags( flags_ ) + , descriptorUpdateEntryCount( descriptorUpdateEntryCount_ ) + , pDescriptorUpdateEntries( pDescriptorUpdateEntries_ ) + , templateType( templateType_ ) + , descriptorSetLayout( descriptorSetLayout_ ) + , pipelineBindPoint( pipelineBindPoint_ ) + , pipelineLayout( pipelineLayout_ ) + , set( set_ ) + { + } + + DescriptorUpdateTemplateCreateInfoKHR( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateCreateInfoKHR) ); + } + + DescriptorUpdateTemplateCreateInfoKHR& operator=( VkDescriptorUpdateTemplateCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorUpdateTemplateCreateInfoKHR) ); + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPNext( void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setFlags( DescriptorUpdateTemplateCreateFlagsKHR flags_ ) + { + flags = flags_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setDescriptorUpdateEntryCount( uint32_t descriptorUpdateEntryCount_ ) + { + descriptorUpdateEntryCount = descriptorUpdateEntryCount_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPDescriptorUpdateEntries( const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries_ ) + { + pDescriptorUpdateEntries = pDescriptorUpdateEntries_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setTemplateType( DescriptorUpdateTemplateTypeKHR templateType_ ) + { + templateType = templateType_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout_ ) + { + descriptorSetLayout = descriptorSetLayout_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + { + pipelineBindPoint = pipelineBindPoint_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setPipelineLayout( PipelineLayout pipelineLayout_ ) + { + pipelineLayout = pipelineLayout_; + return *this; + } + + DescriptorUpdateTemplateCreateInfoKHR& setSet( uint32_t set_ ) + { + set = set_; + return *this; + } + + operator const VkDescriptorUpdateTemplateCreateInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( descriptorUpdateEntryCount == rhs.descriptorUpdateEntryCount ) + && ( pDescriptorUpdateEntries == rhs.pDescriptorUpdateEntries ) + && ( templateType == rhs.templateType ) + && ( descriptorSetLayout == rhs.descriptorSetLayout ) + && ( pipelineBindPoint == rhs.pipelineBindPoint ) + && ( pipelineLayout == rhs.pipelineLayout ) + && ( set == rhs.set ); + } + + bool operator!=( DescriptorUpdateTemplateCreateInfoKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + DescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const DescriptorUpdateTemplateEntryKHR* pDescriptorUpdateEntries; + DescriptorUpdateTemplateTypeKHR templateType; + DescriptorSetLayout descriptorSetLayout; + PipelineBindPoint pipelineBindPoint; + PipelineLayout pipelineLayout; + uint32_t set; + }; + static_assert( sizeof( DescriptorUpdateTemplateCreateInfoKHR ) == sizeof( VkDescriptorUpdateTemplateCreateInfoKHR ), "struct and wrapper have different size!" ); + enum class QueueFlagBits { eGraphics = VK_QUEUE_GRAPHICS_BIT, @@ -9880,7 +12550,8 @@ namespace vk enum class MemoryHeapFlagBits { - eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT + eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, + eMultiInstanceKHX = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHX }; using MemoryHeapFlags = Flags; @@ -9899,7 +12570,7 @@ namespace vk { enum { - allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) + allFlags = VkFlags(MemoryHeapFlagBits::eDeviceLocal) | VkFlags(MemoryHeapFlagBits::eMultiInstanceKHX) }; }; @@ -10045,12 +12716,6 @@ namespace vk return *this; } - MemoryBarrier& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - MemoryBarrier& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -10123,12 +12788,6 @@ namespace vk return *this; } - BufferMemoryBarrier& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - BufferMemoryBarrier& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -10300,12 +12959,6 @@ namespace vk return *this; } - BufferCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - BufferCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -10495,88 +13148,6 @@ namespace vk }; static_assert( sizeof( DescriptorSetLayoutBinding ) == sizeof( VkDescriptorSetLayoutBinding ), "struct and wrapper have different size!" ); - struct DescriptorSetLayoutCreateInfo - { - DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateFlags flags_ = DescriptorSetLayoutCreateFlags(), uint32_t bindingCount_ = 0, const DescriptorSetLayoutBinding* pBindings_ = nullptr ) - : sType( StructureType::eDescriptorSetLayoutCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , bindingCount( bindingCount_ ) - , pBindings( pBindings_ ) - { - } - - DescriptorSetLayoutCreateInfo( VkDescriptorSetLayoutCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); - } - - DescriptorSetLayoutCreateInfo& operator=( VkDescriptorSetLayoutCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); - return *this; - } - - DescriptorSetLayoutCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setFlags( DescriptorSetLayoutCreateFlags flags_ ) - { - flags = flags_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setBindingCount( uint32_t bindingCount_ ) - { - bindingCount = bindingCount_; - return *this; - } - - DescriptorSetLayoutCreateInfo& setPBindings( const DescriptorSetLayoutBinding* pBindings_ ) - { - pBindings = pBindings_; - return *this; - } - - operator const VkDescriptorSetLayoutCreateInfo&() const - { - return *reinterpret_cast(this); - } - - bool operator==( DescriptorSetLayoutCreateInfo const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( bindingCount == rhs.bindingCount ) - && ( pBindings == rhs.pBindings ); - } - - bool operator!=( DescriptorSetLayoutCreateInfo const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - DescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const DescriptorSetLayoutBinding* pBindings; - }; - static_assert( sizeof( DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), "struct and wrapper have different size!" ); - struct PipelineShaderStageCreateInfo { PipelineShaderStageCreateInfo( PipelineShaderStageCreateFlags flags_ = PipelineShaderStageCreateFlags(), ShaderStageFlagBits stage_ = ShaderStageFlagBits::eVertex, ShaderModule module_ = ShaderModule(), const char* pName_ = nullptr, const SpecializationInfo* pSpecializationInfo_ = nullptr ) @@ -10601,12 +13172,6 @@ namespace vk return *this; } - PipelineShaderStageCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineShaderStageCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -10762,12 +13327,6 @@ namespace vk return *this; } - PipelineLayoutCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineLayoutCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -10877,6 +13436,7 @@ namespace vk eSparseAliased = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, eMutableFormat = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, eCubeCompatible = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, + eBindSfrKHX = VK_IMAGE_CREATE_BIND_SFR_BIT_KHX, e2DArrayCompatibleKHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR }; @@ -10896,7 +13456,7 @@ namespace vk { enum { - allFlags = VkFlags(ImageCreateFlagBits::eSparseBinding) | VkFlags(ImageCreateFlagBits::eSparseResidency) | VkFlags(ImageCreateFlagBits::eSparseAliased) | VkFlags(ImageCreateFlagBits::eMutableFormat) | VkFlags(ImageCreateFlagBits::eCubeCompatible) | VkFlags(ImageCreateFlagBits::e2DArrayCompatibleKHR) + allFlags = VkFlags(ImageCreateFlagBits::eSparseBinding) | VkFlags(ImageCreateFlagBits::eSparseResidency) | VkFlags(ImageCreateFlagBits::eSparseAliased) | VkFlags(ImageCreateFlagBits::eMutableFormat) | VkFlags(ImageCreateFlagBits::eCubeCompatible) | VkFlags(ImageCreateFlagBits::eBindSfrKHX) | VkFlags(ImageCreateFlagBits::e2DArrayCompatibleKHR) }; }; @@ -10924,12 +13484,6 @@ namespace vk return *this; } - PhysicalDeviceImageFormatInfo2KHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PhysicalDeviceImageFormatInfo2KHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11004,7 +13558,9 @@ namespace vk { eDisableOptimization = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, eAllowDerivatives = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, - eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT + eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT, + eViewIndexFromDeviceIndexKHX = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHX, + eDispatchBaseKHX = VK_PIPELINE_CREATE_DISPATCH_BASE_KHX }; using PipelineCreateFlags = Flags; @@ -11023,7 +13579,7 @@ namespace vk { enum { - allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) + allFlags = VkFlags(PipelineCreateFlagBits::eDisableOptimization) | VkFlags(PipelineCreateFlagBits::eAllowDerivatives) | VkFlags(PipelineCreateFlagBits::eDerivative) | VkFlags(PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) | VkFlags(PipelineCreateFlagBits::eDispatchBaseKHX) }; }; @@ -11051,12 +13607,6 @@ namespace vk return *this; } - ComputePipelineCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ComputePipelineCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11286,12 +13836,6 @@ namespace vk return *this; } - PipelineColorBlendStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineColorBlendStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11415,12 +13959,6 @@ namespace vk return *this; } - FenceCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - FenceCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11692,12 +14230,6 @@ namespace vk return *this; } - CommandBufferInheritanceInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CommandBufferInheritanceInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11797,12 +14329,6 @@ namespace vk return *this; } - CommandBufferBeginInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CommandBufferBeginInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -11872,12 +14398,6 @@ namespace vk return *this; } - QueryPoolCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - QueryPoolCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -12205,12 +14725,6 @@ namespace vk return *this; } - ImageMemoryBarrier& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ImageMemoryBarrier& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -12330,12 +14844,6 @@ namespace vk return *this; } - ImageViewCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ImageViewCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -13292,12 +15800,6 @@ namespace vk return *this; } - BindSparseInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - BindSparseInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -13497,12 +15999,6 @@ namespace vk return *this; } - CommandPoolCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CommandPoolCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -13691,12 +16187,6 @@ namespace vk return *this; } - ImageCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ImageCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -13857,12 +16347,6 @@ namespace vk return *this; } - PipelineMultisampleStateCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineMultisampleStateCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -13985,12 +16469,6 @@ namespace vk return *this; } - GraphicsPipelineCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - GraphicsPipelineCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -14505,12 +16983,6 @@ namespace vk return *this; } - PhysicalDeviceSparseImageFormatInfo2KHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PhysicalDeviceSparseImageFormatInfo2KHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -14796,12 +17268,6 @@ namespace vk return *this; } - DescriptorPoolCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DescriptorPoolCreateInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -14866,7 +17332,9 @@ namespace vk enum class DependencyFlagBits { - eByRegion = VK_DEPENDENCY_BY_REGION_BIT + eByRegion = VK_DEPENDENCY_BY_REGION_BIT, + eViewLocalKHX = VK_DEPENDENCY_VIEW_LOCAL_BIT_KHX, + eDeviceGroupKHX = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHX }; using DependencyFlags = Flags; @@ -14885,7 +17353,7 @@ namespace vk { enum { - allFlags = VkFlags(DependencyFlagBits::eByRegion) + allFlags = VkFlags(DependencyFlagBits::eByRegion) | VkFlags(DependencyFlagBits::eViewLocalKHX) | VkFlags(DependencyFlagBits::eDeviceGroupKHX) }; }; @@ -14986,124 +17454,6 @@ namespace vk }; static_assert( sizeof( SubpassDependency ) == sizeof( VkSubpassDependency ), "struct and wrapper have different size!" ); - struct RenderPassCreateInfo - { - RenderPassCreateInfo( RenderPassCreateFlags flags_ = RenderPassCreateFlags(), uint32_t attachmentCount_ = 0, const AttachmentDescription* pAttachments_ = nullptr, uint32_t subpassCount_ = 0, const SubpassDescription* pSubpasses_ = nullptr, uint32_t dependencyCount_ = 0, const SubpassDependency* pDependencies_ = nullptr ) - : sType( StructureType::eRenderPassCreateInfo ) - , pNext( nullptr ) - , flags( flags_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , subpassCount( subpassCount_ ) - , pSubpasses( pSubpasses_ ) - , dependencyCount( dependencyCount_ ) - , pDependencies( pDependencies_ ) - { - } - - RenderPassCreateInfo( VkRenderPassCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); - } - - RenderPassCreateInfo& operator=( VkRenderPassCreateInfo const & rhs ) - { - memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); - return *this; - } - - RenderPassCreateInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - - RenderPassCreateInfo& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - RenderPassCreateInfo& setFlags( RenderPassCreateFlags flags_ ) - { - flags = flags_; - return *this; - } - - RenderPassCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) - { - attachmentCount = attachmentCount_; - return *this; - } - - RenderPassCreateInfo& setPAttachments( const AttachmentDescription* pAttachments_ ) - { - pAttachments = pAttachments_; - return *this; - } - - RenderPassCreateInfo& setSubpassCount( uint32_t subpassCount_ ) - { - subpassCount = subpassCount_; - return *this; - } - - RenderPassCreateInfo& setPSubpasses( const SubpassDescription* pSubpasses_ ) - { - pSubpasses = pSubpasses_; - return *this; - } - - RenderPassCreateInfo& setDependencyCount( uint32_t dependencyCount_ ) - { - dependencyCount = dependencyCount_; - return *this; - } - - RenderPassCreateInfo& setPDependencies( const SubpassDependency* pDependencies_ ) - { - pDependencies = pDependencies_; - return *this; - } - - operator const VkRenderPassCreateInfo&() const - { - return *reinterpret_cast(this); - } - - bool operator==( RenderPassCreateInfo const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( attachmentCount == rhs.attachmentCount ) - && ( pAttachments == rhs.pAttachments ) - && ( subpassCount == rhs.subpassCount ) - && ( pSubpasses == rhs.pSubpasses ) - && ( dependencyCount == rhs.dependencyCount ) - && ( pDependencies == rhs.pDependencies ); - } - - bool operator!=( RenderPassCreateInfo const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - RenderPassCreateFlags flags; - uint32_t attachmentCount; - const AttachmentDescription* pAttachments; - uint32_t subpassCount; - const SubpassDescription* pSubpasses; - uint32_t dependencyCount; - const SubpassDependency* pDependencies; - }; - static_assert( sizeof( RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); - enum class PresentModeKHR { eImmediate = VK_PRESENT_MODE_IMMEDIATE_KHR, @@ -15115,18 +17465,19 @@ namespace vk enum class ColorSpaceKHR { eSrgbNonlinear = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - eDisplayP3LinearEXT = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT, eDisplayP3NonlinearEXT = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT, - eScrgbLinearEXT = VK_COLOR_SPACE_SCRGB_LINEAR_EXT, - eScrgbNonlinearEXT = VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT, + eExtendedSrgbLinearEXT = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, eDciP3LinearEXT = VK_COLOR_SPACE_DCI_P3_LINEAR_EXT, eDciP3NonlinearEXT = VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT, eBt709LinearEXT = VK_COLOR_SPACE_BT709_LINEAR_EXT, eBt709NonlinearEXT = VK_COLOR_SPACE_BT709_NONLINEAR_EXT, eBt2020LinearEXT = VK_COLOR_SPACE_BT2020_LINEAR_EXT, - eBt2020NonlinearEXT = VK_COLOR_SPACE_BT2020_NONLINEAR_EXT, + eHdr10St2084EXT = VK_COLOR_SPACE_HDR10_ST2084_EXT, + eDolbyvisionEXT = VK_COLOR_SPACE_DOLBYVISION_EXT, + eHdr10HlgEXT = VK_COLOR_SPACE_HDR10_HLG_EXT, eAdobergbLinearEXT = VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT, - eAdobergbNonlinearEXT = VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT + eAdobergbNonlinearEXT = VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT, + ePassThroughEXT = VK_COLOR_SPACE_PASS_THROUGH_EXT }; struct SurfaceFormatKHR @@ -15338,12 +17689,6 @@ namespace vk return *this; } - DisplaySurfaceCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DisplaySurfaceCreateInfoKHR& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -15477,205 +17822,6 @@ namespace vk }; static_assert( sizeof( SurfaceCapabilitiesKHR ) == sizeof( VkSurfaceCapabilitiesKHR ), "struct and wrapper have different size!" ); - struct SwapchainCreateInfoKHR - { - SwapchainCreateInfoKHR( SwapchainCreateFlagsKHR flags_ = SwapchainCreateFlagsKHR(), SurfaceKHR surface_ = SurfaceKHR(), uint32_t minImageCount_ = 0, Format imageFormat_ = Format::eUndefined, ColorSpaceKHR imageColorSpace_ = ColorSpaceKHR::eSrgbNonlinear, Extent2D imageExtent_ = Extent2D(), uint32_t imageArrayLayers_ = 0, ImageUsageFlags imageUsage_ = ImageUsageFlags(), SharingMode imageSharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, SurfaceTransformFlagBitsKHR preTransform_ = SurfaceTransformFlagBitsKHR::eIdentity, CompositeAlphaFlagBitsKHR compositeAlpha_ = CompositeAlphaFlagBitsKHR::eOpaque, PresentModeKHR presentMode_ = PresentModeKHR::eImmediate, Bool32 clipped_ = 0, SwapchainKHR oldSwapchain_ = SwapchainKHR() ) - : sType( StructureType::eSwapchainCreateInfoKHR ) - , pNext( nullptr ) - , flags( flags_ ) - , surface( surface_ ) - , minImageCount( minImageCount_ ) - , imageFormat( imageFormat_ ) - , imageColorSpace( imageColorSpace_ ) - , imageExtent( imageExtent_ ) - , imageArrayLayers( imageArrayLayers_ ) - , imageUsage( imageUsage_ ) - , imageSharingMode( imageSharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - , preTransform( preTransform_ ) - , compositeAlpha( compositeAlpha_ ) - , presentMode( presentMode_ ) - , clipped( clipped_ ) - , oldSwapchain( oldSwapchain_ ) - { - } - - SwapchainCreateInfoKHR( VkSwapchainCreateInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); - } - - SwapchainCreateInfoKHR& operator=( VkSwapchainCreateInfoKHR const & rhs ) - { - memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); - return *this; - } - - SwapchainCreateInfoKHR& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - - SwapchainCreateInfoKHR& setPNext( const void* pNext_ ) - { - pNext = pNext_; - return *this; - } - - SwapchainCreateInfoKHR& setFlags( SwapchainCreateFlagsKHR flags_ ) - { - flags = flags_; - return *this; - } - - SwapchainCreateInfoKHR& setSurface( SurfaceKHR surface_ ) - { - surface = surface_; - return *this; - } - - SwapchainCreateInfoKHR& setMinImageCount( uint32_t minImageCount_ ) - { - minImageCount = minImageCount_; - return *this; - } - - SwapchainCreateInfoKHR& setImageFormat( Format imageFormat_ ) - { - imageFormat = imageFormat_; - return *this; - } - - SwapchainCreateInfoKHR& setImageColorSpace( ColorSpaceKHR imageColorSpace_ ) - { - imageColorSpace = imageColorSpace_; - return *this; - } - - SwapchainCreateInfoKHR& setImageExtent( Extent2D imageExtent_ ) - { - imageExtent = imageExtent_; - return *this; - } - - SwapchainCreateInfoKHR& setImageArrayLayers( uint32_t imageArrayLayers_ ) - { - imageArrayLayers = imageArrayLayers_; - return *this; - } - - SwapchainCreateInfoKHR& setImageUsage( ImageUsageFlags imageUsage_ ) - { - imageUsage = imageUsage_; - return *this; - } - - SwapchainCreateInfoKHR& setImageSharingMode( SharingMode imageSharingMode_ ) - { - imageSharingMode = imageSharingMode_; - return *this; - } - - SwapchainCreateInfoKHR& setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - SwapchainCreateInfoKHR& setPQueueFamilyIndices( const uint32_t* pQueueFamilyIndices_ ) - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - - SwapchainCreateInfoKHR& setPreTransform( SurfaceTransformFlagBitsKHR preTransform_ ) - { - preTransform = preTransform_; - return *this; - } - - SwapchainCreateInfoKHR& setCompositeAlpha( CompositeAlphaFlagBitsKHR compositeAlpha_ ) - { - compositeAlpha = compositeAlpha_; - return *this; - } - - SwapchainCreateInfoKHR& setPresentMode( PresentModeKHR presentMode_ ) - { - presentMode = presentMode_; - return *this; - } - - SwapchainCreateInfoKHR& setClipped( Bool32 clipped_ ) - { - clipped = clipped_; - return *this; - } - - SwapchainCreateInfoKHR& setOldSwapchain( SwapchainKHR oldSwapchain_ ) - { - oldSwapchain = oldSwapchain_; - return *this; - } - - operator const VkSwapchainCreateInfoKHR&() const - { - return *reinterpret_cast(this); - } - - bool operator==( SwapchainCreateInfoKHR const& rhs ) const - { - return ( sType == rhs.sType ) - && ( pNext == rhs.pNext ) - && ( flags == rhs.flags ) - && ( surface == rhs.surface ) - && ( minImageCount == rhs.minImageCount ) - && ( imageFormat == rhs.imageFormat ) - && ( imageColorSpace == rhs.imageColorSpace ) - && ( imageExtent == rhs.imageExtent ) - && ( imageArrayLayers == rhs.imageArrayLayers ) - && ( imageUsage == rhs.imageUsage ) - && ( imageSharingMode == rhs.imageSharingMode ) - && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) - && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) - && ( preTransform == rhs.preTransform ) - && ( compositeAlpha == rhs.compositeAlpha ) - && ( presentMode == rhs.presentMode ) - && ( clipped == rhs.clipped ) - && ( oldSwapchain == rhs.oldSwapchain ); - } - - bool operator!=( SwapchainCreateInfoKHR const& rhs ) const - { - return !operator==( rhs ); - } - - private: - StructureType sType; - - public: - const void* pNext; - SwapchainCreateFlagsKHR flags; - SurfaceKHR surface; - uint32_t minImageCount; - Format imageFormat; - ColorSpaceKHR imageColorSpace; - Extent2D imageExtent; - uint32_t imageArrayLayers; - ImageUsageFlags imageUsage; - SharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t* pQueueFamilyIndices; - SurfaceTransformFlagBitsKHR preTransform; - CompositeAlphaFlagBitsKHR compositeAlpha; - PresentModeKHR presentMode; - Bool32 clipped; - SwapchainKHR oldSwapchain; - }; - static_assert( sizeof( SwapchainCreateInfoKHR ) == sizeof( VkSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); - enum class DebugReportFlagBitsEXT { eInformation = VK_DEBUG_REPORT_INFORMATION_BIT_EXT, @@ -15727,12 +17873,6 @@ namespace vk return *this; } - DebugReportCallbackCreateInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DebugReportCallbackCreateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -15821,7 +17961,8 @@ namespace vk eDisplayKhr = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, eDisplayModeKhr = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, eObjectTableNvx = VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT, - eIndirectCommandsLayoutNvx = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT + eIndirectCommandsLayoutNvx = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, + eDescriptorUpdateTemplateKhrKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT }; struct DebugMarkerObjectNameInfoEXT @@ -15846,12 +17987,6 @@ namespace vk return *this; } - DebugMarkerObjectNameInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DebugMarkerObjectNameInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -15930,12 +18065,6 @@ namespace vk return *this; } - DebugMarkerObjectTagInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DebugMarkerObjectTagInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16038,12 +18167,6 @@ namespace vk return *this; } - PipelineRasterizationStateRasterizationOrderAMD& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - PipelineRasterizationStateRasterizationOrderAMD& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16130,12 +18253,6 @@ namespace vk return *this; } - ExternalMemoryImageCreateInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ExternalMemoryImageCreateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16194,12 +18311,6 @@ namespace vk return *this; } - ExportMemoryAllocateInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ExportMemoryAllocateInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16260,12 +18371,6 @@ namespace vk return *this; } - ImportMemoryWin32HandleInfoNV& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ImportMemoryWin32HandleInfoNV& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16393,12 +18498,6 @@ namespace vk return *this; } - ValidationFlagsEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ValidationFlagsEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16665,12 +18764,6 @@ namespace vk return *this; } - IndirectCommandsLayoutCreateInfoNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - IndirectCommandsLayoutCreateInfoNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -16770,12 +18863,6 @@ namespace vk return *this; } - ObjectTableCreateInfoNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - ObjectTableCreateInfoNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -17262,6 +19349,1047 @@ namespace vk }; static_assert( sizeof( ObjectTablePushConstantEntryNVX ) == sizeof( VkObjectTablePushConstantEntryNVX ), "struct and wrapper have different size!" ); + enum class DescriptorSetLayoutCreateFlagBits + { + ePushDescriptorKHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR + }; + + using DescriptorSetLayoutCreateFlags = Flags; + + VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator|( DescriptorSetLayoutCreateFlagBits bit0, DescriptorSetLayoutCreateFlagBits bit1 ) + { + return DescriptorSetLayoutCreateFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DescriptorSetLayoutCreateFlags operator~( DescriptorSetLayoutCreateFlagBits bits ) + { + return ~( DescriptorSetLayoutCreateFlags( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) + }; + }; + + struct DescriptorSetLayoutCreateInfo + { + DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateFlags flags_ = DescriptorSetLayoutCreateFlags(), uint32_t bindingCount_ = 0, const DescriptorSetLayoutBinding* pBindings_ = nullptr ) + : sType( StructureType::eDescriptorSetLayoutCreateInfo ) + , pNext( nullptr ) + , flags( flags_ ) + , bindingCount( bindingCount_ ) + , pBindings( pBindings_ ) + { + } + + DescriptorSetLayoutCreateInfo( VkDescriptorSetLayoutCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); + } + + DescriptorSetLayoutCreateInfo& operator=( VkDescriptorSetLayoutCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(DescriptorSetLayoutCreateInfo) ); + return *this; + } + + DescriptorSetLayoutCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setFlags( DescriptorSetLayoutCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setBindingCount( uint32_t bindingCount_ ) + { + bindingCount = bindingCount_; + return *this; + } + + DescriptorSetLayoutCreateInfo& setPBindings( const DescriptorSetLayoutBinding* pBindings_ ) + { + pBindings = pBindings_; + return *this; + } + + operator const VkDescriptorSetLayoutCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DescriptorSetLayoutCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( bindingCount == rhs.bindingCount ) + && ( pBindings == rhs.pBindings ); + } + + bool operator!=( DescriptorSetLayoutCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + DescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const DescriptorSetLayoutBinding* pBindings; + }; + static_assert( sizeof( DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), "struct and wrapper have different size!" ); + + enum class ExternalMemoryHandleTypeFlagBitsKHX + { + eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX, + eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX, + eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX, + eD3D11Texture = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHX, + eD3D11TextureKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHX, + eD3D12Heap = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHX, + eD3D12Resource = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHX + }; + + using ExternalMemoryHandleTypeFlagsKHX = Flags; + + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHX operator|( ExternalMemoryHandleTypeFlagBitsKHX bit0, ExternalMemoryHandleTypeFlagBitsKHX bit1 ) + { + return ExternalMemoryHandleTypeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalMemoryHandleTypeFlagsKHX operator~( ExternalMemoryHandleTypeFlagBitsKHX bits ) + { + return ~( ExternalMemoryHandleTypeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap) | VkFlags(ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource) + }; + }; + + struct PhysicalDeviceExternalImageFormatInfoKHX + { + PhysicalDeviceExternalImageFormatInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalImageFormatInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalImageFormatInfoKHX( VkPhysicalDeviceExternalImageFormatInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalImageFormatInfoKHX) ); + } + + PhysicalDeviceExternalImageFormatInfoKHX& operator=( VkPhysicalDeviceExternalImageFormatInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalImageFormatInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalImageFormatInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalImageFormatInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalImageFormatInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceExternalImageFormatInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalImageFormatInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalImageFormatInfoKHX ) == sizeof( VkPhysicalDeviceExternalImageFormatInfoKHX ), "struct and wrapper have different size!" ); + + struct PhysicalDeviceExternalBufferInfoKHX + { + PhysicalDeviceExternalBufferInfoKHX( BufferCreateFlags flags_ = BufferCreateFlags(), BufferUsageFlags usage_ = BufferUsageFlags(), ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalBufferInfoKHX ) + , pNext( nullptr ) + , flags( flags_ ) + , usage( usage_ ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalBufferInfoKHX( VkPhysicalDeviceExternalBufferInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalBufferInfoKHX) ); + } + + PhysicalDeviceExternalBufferInfoKHX& operator=( VkPhysicalDeviceExternalBufferInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalBufferInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setFlags( BufferCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setUsage( BufferUsageFlags usage_ ) + { + usage = usage_; + return *this; + } + + PhysicalDeviceExternalBufferInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalBufferInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceExternalBufferInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( usage == rhs.usage ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalBufferInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + BufferCreateFlags flags; + BufferUsageFlags usage; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalBufferInfoKHX ) == sizeof( VkPhysicalDeviceExternalBufferInfoKHX ), "struct and wrapper have different size!" ); + + struct ExternalMemoryImageCreateInfoKHX + { + ExternalMemoryImageCreateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExternalMemoryImageCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExternalMemoryImageCreateInfoKHX( VkExternalMemoryImageCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryImageCreateInfoKHX) ); + } + + ExternalMemoryImageCreateInfoKHX& operator=( VkExternalMemoryImageCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryImageCreateInfoKHX) ); + return *this; + } + + ExternalMemoryImageCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExternalMemoryImageCreateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExternalMemoryImageCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalMemoryImageCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExternalMemoryImageCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExternalMemoryImageCreateInfoKHX ) == sizeof( VkExternalMemoryImageCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct ExternalMemoryBufferCreateInfoKHX + { + ExternalMemoryBufferCreateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExternalMemoryBufferCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExternalMemoryBufferCreateInfoKHX( VkExternalMemoryBufferCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryBufferCreateInfoKHX) ); + } + + ExternalMemoryBufferCreateInfoKHX& operator=( VkExternalMemoryBufferCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExternalMemoryBufferCreateInfoKHX) ); + return *this; + } + + ExternalMemoryBufferCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExternalMemoryBufferCreateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExternalMemoryBufferCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalMemoryBufferCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExternalMemoryBufferCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExternalMemoryBufferCreateInfoKHX ) == sizeof( VkExternalMemoryBufferCreateInfoKHX ), "struct and wrapper have different size!" ); + + struct ExportMemoryAllocateInfoKHX + { + ExportMemoryAllocateInfoKHX( ExternalMemoryHandleTypeFlagsKHX handleTypes_ = ExternalMemoryHandleTypeFlagsKHX() ) + : sType( StructureType::eExportMemoryAllocateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExportMemoryAllocateInfoKHX( VkExportMemoryAllocateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryAllocateInfoKHX) ); + } + + ExportMemoryAllocateInfoKHX& operator=( VkExportMemoryAllocateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportMemoryAllocateInfoKHX) ); + return *this; + } + + ExportMemoryAllocateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportMemoryAllocateInfoKHX& setHandleTypes( ExternalMemoryHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExportMemoryAllocateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExportMemoryAllocateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExportMemoryAllocateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExportMemoryAllocateInfoKHX ) == sizeof( VkExportMemoryAllocateInfoKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ImportMemoryWin32HandleInfoKHX + { + ImportMemoryWin32HandleInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd, HANDLE handle_ = 0 ) + : sType( StructureType::eImportMemoryWin32HandleInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + , handle( handle_ ) + { + } + + ImportMemoryWin32HandleInfoKHX( VkImportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryWin32HandleInfoKHX) ); + } + + ImportMemoryWin32HandleInfoKHX& operator=( VkImportMemoryWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryWin32HandleInfoKHX) ); + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportMemoryWin32HandleInfoKHX& setHandle( HANDLE handle_ ) + { + handle = handle_; + return *this; + } + + operator const VkImportMemoryWin32HandleInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImportMemoryWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ) + && ( handle == rhs.handle ); + } + + bool operator!=( ImportMemoryWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + HANDLE handle; + }; + static_assert( sizeof( ImportMemoryWin32HandleInfoKHX ) == sizeof( VkImportMemoryWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct ImportMemoryFdInfoKHX + { + ImportMemoryFdInfoKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType_ = ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd, int fd_ = 0 ) + : sType( StructureType::eImportMemoryFdInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + , fd( fd_ ) + { + } + + ImportMemoryFdInfoKHX( VkImportMemoryFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryFdInfoKHX) ); + } + + ImportMemoryFdInfoKHX& operator=( VkImportMemoryFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportMemoryFdInfoKHX) ); + return *this; + } + + ImportMemoryFdInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportMemoryFdInfoKHX& setHandleType( ExternalMemoryHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportMemoryFdInfoKHX& setFd( int fd_ ) + { + fd = fd_; + return *this; + } + + operator const VkImportMemoryFdInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImportMemoryFdInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ) + && ( fd == rhs.fd ); + } + + bool operator!=( ImportMemoryFdInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalMemoryHandleTypeFlagBitsKHX handleType; + int fd; + }; + static_assert( sizeof( ImportMemoryFdInfoKHX ) == sizeof( VkImportMemoryFdInfoKHX ), "struct and wrapper have different size!" ); + + enum class ExternalMemoryFeatureFlagBitsKHX + { + eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHX, + eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHX, + eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHX + }; + + using ExternalMemoryFeatureFlagsKHX = Flags; + + VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHX operator|( ExternalMemoryFeatureFlagBitsKHX bit0, ExternalMemoryFeatureFlagBitsKHX bit1 ) + { + return ExternalMemoryFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalMemoryFeatureFlagsKHX operator~( ExternalMemoryFeatureFlagBitsKHX bits ) + { + return ~( ExternalMemoryFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly) | VkFlags(ExternalMemoryFeatureFlagBitsKHX::eExportable) | VkFlags(ExternalMemoryFeatureFlagBitsKHX::eImportable) + }; + }; + + struct ExternalMemoryPropertiesKHX + { + operator const VkExternalMemoryPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalMemoryPropertiesKHX const& rhs ) const + { + return ( externalMemoryFeatures == rhs.externalMemoryFeatures ) + && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) + && ( compatibleHandleTypes == rhs.compatibleHandleTypes ); + } + + bool operator!=( ExternalMemoryPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + ExternalMemoryFeatureFlagsKHX externalMemoryFeatures; + ExternalMemoryHandleTypeFlagsKHX exportFromImportedHandleTypes; + ExternalMemoryHandleTypeFlagsKHX compatibleHandleTypes; + }; + static_assert( sizeof( ExternalMemoryPropertiesKHX ) == sizeof( VkExternalMemoryPropertiesKHX ), "struct and wrapper have different size!" ); + + struct ExternalImageFormatPropertiesKHX + { + operator const VkExternalImageFormatPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalImageFormatPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( externalMemoryProperties == rhs.externalMemoryProperties ); + } + + bool operator!=( ExternalImageFormatPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalMemoryPropertiesKHX externalMemoryProperties; + }; + static_assert( sizeof( ExternalImageFormatPropertiesKHX ) == sizeof( VkExternalImageFormatPropertiesKHX ), "struct and wrapper have different size!" ); + + struct ExternalBufferPropertiesKHX + { + operator const VkExternalBufferPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalBufferPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( externalMemoryProperties == rhs.externalMemoryProperties ); + } + + bool operator!=( ExternalBufferPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalMemoryPropertiesKHX externalMemoryProperties; + }; + static_assert( sizeof( ExternalBufferPropertiesKHX ) == sizeof( VkExternalBufferPropertiesKHX ), "struct and wrapper have different size!" ); + + enum class ExternalSemaphoreHandleTypeFlagBitsKHX + { + eOpaqueFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX, + eOpaqueWin32 = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHX, + eOpaqueWin32Kmt = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHX, + eD3D12Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHX, + eFenceFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FENCE_FD_BIT_KHX + }; + + using ExternalSemaphoreHandleTypeFlagsKHX = Flags; + + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHX operator|( ExternalSemaphoreHandleTypeFlagBitsKHX bit0, ExternalSemaphoreHandleTypeFlagBitsKHX bit1 ) + { + return ExternalSemaphoreHandleTypeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalSemaphoreHandleTypeFlagsKHX operator~( ExternalSemaphoreHandleTypeFlagBitsKHX bits ) + { + return ~( ExternalSemaphoreHandleTypeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence) | VkFlags(ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd) + }; + }; + + struct PhysicalDeviceExternalSemaphoreInfoKHX + { + PhysicalDeviceExternalSemaphoreInfoKHX( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd ) + : sType( StructureType::ePhysicalDeviceExternalSemaphoreInfoKHX ) + , pNext( nullptr ) + , handleType( handleType_ ) + { + } + + PhysicalDeviceExternalSemaphoreInfoKHX( VkPhysicalDeviceExternalSemaphoreInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalSemaphoreInfoKHX) ); + } + + PhysicalDeviceExternalSemaphoreInfoKHX& operator=( VkPhysicalDeviceExternalSemaphoreInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(PhysicalDeviceExternalSemaphoreInfoKHX) ); + return *this; + } + + PhysicalDeviceExternalSemaphoreInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PhysicalDeviceExternalSemaphoreInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + operator const VkPhysicalDeviceExternalSemaphoreInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceExternalSemaphoreInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleType == rhs.handleType ); + } + + bool operator!=( PhysicalDeviceExternalSemaphoreInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalSemaphoreHandleTypeFlagBitsKHX handleType; + }; + static_assert( sizeof( PhysicalDeviceExternalSemaphoreInfoKHX ) == sizeof( VkPhysicalDeviceExternalSemaphoreInfoKHX ), "struct and wrapper have different size!" ); + + struct ExportSemaphoreCreateInfoKHX + { + ExportSemaphoreCreateInfoKHX( ExternalSemaphoreHandleTypeFlagsKHX handleTypes_ = ExternalSemaphoreHandleTypeFlagsKHX() ) + : sType( StructureType::eExportSemaphoreCreateInfoKHX ) + , pNext( nullptr ) + , handleTypes( handleTypes_ ) + { + } + + ExportSemaphoreCreateInfoKHX( VkExportSemaphoreCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreCreateInfoKHX) ); + } + + ExportSemaphoreCreateInfoKHX& operator=( VkExportSemaphoreCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ExportSemaphoreCreateInfoKHX) ); + return *this; + } + + ExportSemaphoreCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ExportSemaphoreCreateInfoKHX& setHandleTypes( ExternalSemaphoreHandleTypeFlagsKHX handleTypes_ ) + { + handleTypes = handleTypes_; + return *this; + } + + operator const VkExportSemaphoreCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExportSemaphoreCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( handleTypes == rhs.handleTypes ); + } + + bool operator!=( ExportSemaphoreCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + ExternalSemaphoreHandleTypeFlagsKHX handleTypes; + }; + static_assert( sizeof( ExportSemaphoreCreateInfoKHX ) == sizeof( VkExportSemaphoreCreateInfoKHX ), "struct and wrapper have different size!" ); + +#ifdef VK_USE_PLATFORM_WIN32_KHX + struct ImportSemaphoreWin32HandleInfoKHX + { + ImportSemaphoreWin32HandleInfoKHX( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagsKHX handleType_ = ExternalSemaphoreHandleTypeFlagsKHX(), HANDLE handle_ = 0 ) + : sType( StructureType::eImportSemaphoreWin32HandleInfoKHX ) + , pNext( nullptr ) + , semaphore( semaphore_ ) + , handleType( handleType_ ) + , handle( handle_ ) + { + } + + ImportSemaphoreWin32HandleInfoKHX( VkImportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreWin32HandleInfoKHX) ); + } + + ImportSemaphoreWin32HandleInfoKHX& operator=( VkImportSemaphoreWin32HandleInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreWin32HandleInfoKHX) ); + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportSemaphoreWin32HandleInfoKHX& setHandle( HANDLE handle_ ) + { + handle = handle_; + return *this; + } + + operator const VkImportSemaphoreWin32HandleInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( semaphore == rhs.semaphore ) + && ( handleType == rhs.handleType ) + && ( handle == rhs.handle ); + } + + bool operator!=( ImportSemaphoreWin32HandleInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Semaphore semaphore; + ExternalSemaphoreHandleTypeFlagsKHX handleType; + HANDLE handle; + }; + static_assert( sizeof( ImportSemaphoreWin32HandleInfoKHX ) == sizeof( VkImportSemaphoreWin32HandleInfoKHX ), "struct and wrapper have different size!" ); +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + struct ImportSemaphoreFdInfoKHX + { + ImportSemaphoreFdInfoKHX( Semaphore semaphore_ = Semaphore(), ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ = ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd, int fd_ = 0 ) + : sType( StructureType::eImportSemaphoreFdInfoKHX ) + , pNext( nullptr ) + , semaphore( semaphore_ ) + , handleType( handleType_ ) + , fd( fd_ ) + { + } + + ImportSemaphoreFdInfoKHX( VkImportSemaphoreFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreFdInfoKHX) ); + } + + ImportSemaphoreFdInfoKHX& operator=( VkImportSemaphoreFdInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(ImportSemaphoreFdInfoKHX) ); + return *this; + } + + ImportSemaphoreFdInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setSemaphore( Semaphore semaphore_ ) + { + semaphore = semaphore_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setHandleType( ExternalSemaphoreHandleTypeFlagBitsKHX handleType_ ) + { + handleType = handleType_; + return *this; + } + + ImportSemaphoreFdInfoKHX& setFd( int fd_ ) + { + fd = fd_; + return *this; + } + + operator const VkImportSemaphoreFdInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ImportSemaphoreFdInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( semaphore == rhs.semaphore ) + && ( handleType == rhs.handleType ) + && ( fd == rhs.fd ); + } + + bool operator!=( ImportSemaphoreFdInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + Semaphore semaphore; + ExternalSemaphoreHandleTypeFlagBitsKHX handleType; + int fd; + }; + static_assert( sizeof( ImportSemaphoreFdInfoKHX ) == sizeof( VkImportSemaphoreFdInfoKHX ), "struct and wrapper have different size!" ); + + enum class ExternalSemaphoreFeatureFlagBitsKHX + { + eExportable = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX, + eImportable = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX + }; + + using ExternalSemaphoreFeatureFlagsKHX = Flags; + + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHX operator|( ExternalSemaphoreFeatureFlagBitsKHX bit0, ExternalSemaphoreFeatureFlagBitsKHX bit1 ) + { + return ExternalSemaphoreFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ExternalSemaphoreFeatureFlagsKHX operator~( ExternalSemaphoreFeatureFlagBitsKHX bits ) + { + return ~( ExternalSemaphoreFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(ExternalSemaphoreFeatureFlagBitsKHX::eExportable) | VkFlags(ExternalSemaphoreFeatureFlagBitsKHX::eImportable) + }; + }; + + struct ExternalSemaphorePropertiesKHX + { + operator const VkExternalSemaphorePropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ExternalSemaphorePropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) + && ( compatibleHandleTypes == rhs.compatibleHandleTypes ) + && ( externalSemaphoreFeatures == rhs.externalSemaphoreFeatures ); + } + + bool operator!=( ExternalSemaphorePropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + ExternalSemaphoreHandleTypeFlagsKHX exportFromImportedHandleTypes; + ExternalSemaphoreHandleTypeFlagsKHX compatibleHandleTypes; + ExternalSemaphoreFeatureFlagsKHX externalSemaphoreFeatures; + }; + static_assert( sizeof( ExternalSemaphorePropertiesKHX ) == sizeof( VkExternalSemaphorePropertiesKHX ), "struct and wrapper have different size!" ); + enum class SurfaceCounterFlagBitsEXT { eVblankExt = VK_SURFACE_COUNTER_VBLANK_EXT @@ -17355,12 +20483,6 @@ namespace vk return *this; } - SwapchainCounterCreateInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - SwapchainCounterCreateInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -17426,12 +20548,6 @@ namespace vk return *this; } - DisplayPowerInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DisplayPowerInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -17495,12 +20611,6 @@ namespace vk return *this; } - DeviceEventInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DeviceEventInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -17564,12 +20674,6 @@ namespace vk return *this; } - DisplayEventInfoEXT& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - DisplayEventInfoEXT& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -17608,14 +20712,1060 @@ namespace vk }; static_assert( sizeof( DisplayEventInfoEXT ) == sizeof( VkDisplayEventInfoEXT ), "struct and wrapper have different size!" ); + enum class PeerMemoryFeatureFlagBitsKHX + { + eCopySrc = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHX, + eCopyDst = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHX, + eGenericSrc = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHX, + eGenericDst = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHX + }; + + using PeerMemoryFeatureFlagsKHX = Flags; + + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator|( PeerMemoryFeatureFlagBitsKHX bit0, PeerMemoryFeatureFlagBitsKHX bit1 ) + { + return PeerMemoryFeatureFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX operator~( PeerMemoryFeatureFlagBitsKHX bits ) + { + return ~( PeerMemoryFeatureFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopySrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eCopyDst) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericSrc) | VkFlags(PeerMemoryFeatureFlagBitsKHX::eGenericDst) + }; + }; + + enum class MemoryAllocateFlagBitsKHX + { + eDeviceMask = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHX + }; + + using MemoryAllocateFlagsKHX = Flags; + + VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator|( MemoryAllocateFlagBitsKHX bit0, MemoryAllocateFlagBitsKHX bit1 ) + { + return MemoryAllocateFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE MemoryAllocateFlagsKHX operator~( MemoryAllocateFlagBitsKHX bits ) + { + return ~( MemoryAllocateFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(MemoryAllocateFlagBitsKHX::eDeviceMask) + }; + }; + + struct MemoryAllocateFlagsInfoKHX + { + MemoryAllocateFlagsInfoKHX( MemoryAllocateFlagsKHX flags_ = MemoryAllocateFlagsKHX(), uint32_t deviceMask_ = 0 ) + : sType( StructureType::eMemoryAllocateFlagsInfoKHX ) + , pNext( nullptr ) + , flags( flags_ ) + , deviceMask( deviceMask_ ) + { + } + + MemoryAllocateFlagsInfoKHX( VkMemoryAllocateFlagsInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(MemoryAllocateFlagsInfoKHX) ); + } + + MemoryAllocateFlagsInfoKHX& operator=( VkMemoryAllocateFlagsInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(MemoryAllocateFlagsInfoKHX) ); + return *this; + } + + MemoryAllocateFlagsInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + MemoryAllocateFlagsInfoKHX& setFlags( MemoryAllocateFlagsKHX flags_ ) + { + flags = flags_; + return *this; + } + + MemoryAllocateFlagsInfoKHX& setDeviceMask( uint32_t deviceMask_ ) + { + deviceMask = deviceMask_; + return *this; + } + + operator const VkMemoryAllocateFlagsInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( MemoryAllocateFlagsInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( deviceMask == rhs.deviceMask ); + } + + bool operator!=( MemoryAllocateFlagsInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + MemoryAllocateFlagsKHX flags; + uint32_t deviceMask; + }; + static_assert( sizeof( MemoryAllocateFlagsInfoKHX ) == sizeof( VkMemoryAllocateFlagsInfoKHX ), "struct and wrapper have different size!" ); + + enum class DeviceGroupPresentModeFlagBitsKHX + { + eLocal = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHX, + eRemote = VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHX, + eSum = VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHX, + eLocalMultiDevice = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHX + }; + + using DeviceGroupPresentModeFlagsKHX = Flags; + + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator|( DeviceGroupPresentModeFlagBitsKHX bit0, DeviceGroupPresentModeFlagBitsKHX bit1 ) + { + return DeviceGroupPresentModeFlagsKHX( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE DeviceGroupPresentModeFlagsKHX operator~( DeviceGroupPresentModeFlagBitsKHX bits ) + { + return ~( DeviceGroupPresentModeFlagsKHX( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocal) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eRemote) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eSum) | VkFlags(DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) + }; + }; + + struct DeviceGroupPresentCapabilitiesKHX + { + operator const VkDeviceGroupPresentCapabilitiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( memcmp( presentMask, rhs.presentMask, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( uint32_t ) ) == 0 ) + && ( modes == rhs.modes ); + } + + bool operator!=( DeviceGroupPresentCapabilitiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t presentMask[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + DeviceGroupPresentModeFlagsKHX modes; + }; + static_assert( sizeof( DeviceGroupPresentCapabilitiesKHX ) == sizeof( VkDeviceGroupPresentCapabilitiesKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupPresentInfoKHX + { + DeviceGroupPresentInfoKHX( uint32_t swapchainCount_ = 0, const uint32_t* pDeviceMasks_ = nullptr, DeviceGroupPresentModeFlagBitsKHX mode_ = DeviceGroupPresentModeFlagBitsKHX::eLocal ) + : sType( StructureType::eDeviceGroupPresentInfoKHX ) + , pNext( nullptr ) + , swapchainCount( swapchainCount_ ) + , pDeviceMasks( pDeviceMasks_ ) + , mode( mode_ ) + { + } + + DeviceGroupPresentInfoKHX( VkDeviceGroupPresentInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupPresentInfoKHX) ); + } + + DeviceGroupPresentInfoKHX& operator=( VkDeviceGroupPresentInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupPresentInfoKHX) ); + return *this; + } + + DeviceGroupPresentInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupPresentInfoKHX& setSwapchainCount( uint32_t swapchainCount_ ) + { + swapchainCount = swapchainCount_; + return *this; + } + + DeviceGroupPresentInfoKHX& setPDeviceMasks( const uint32_t* pDeviceMasks_ ) + { + pDeviceMasks = pDeviceMasks_; + return *this; + } + + DeviceGroupPresentInfoKHX& setMode( DeviceGroupPresentModeFlagBitsKHX mode_ ) + { + mode = mode_; + return *this; + } + + operator const VkDeviceGroupPresentInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupPresentInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( swapchainCount == rhs.swapchainCount ) + && ( pDeviceMasks == rhs.pDeviceMasks ) + && ( mode == rhs.mode ); + } + + bool operator!=( DeviceGroupPresentInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t swapchainCount; + const uint32_t* pDeviceMasks; + DeviceGroupPresentModeFlagBitsKHX mode; + }; + static_assert( sizeof( DeviceGroupPresentInfoKHX ) == sizeof( VkDeviceGroupPresentInfoKHX ), "struct and wrapper have different size!" ); + + struct DeviceGroupSwapchainCreateInfoKHX + { + DeviceGroupSwapchainCreateInfoKHX( DeviceGroupPresentModeFlagsKHX modes_ = DeviceGroupPresentModeFlagsKHX() ) + : sType( StructureType::eDeviceGroupSwapchainCreateInfoKHX ) + , pNext( nullptr ) + , modes( modes_ ) + { + } + + DeviceGroupSwapchainCreateInfoKHX( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSwapchainCreateInfoKHX) ); + } + + DeviceGroupSwapchainCreateInfoKHX& operator=( VkDeviceGroupSwapchainCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupSwapchainCreateInfoKHX) ); + return *this; + } + + DeviceGroupSwapchainCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupSwapchainCreateInfoKHX& setModes( DeviceGroupPresentModeFlagsKHX modes_ ) + { + modes = modes_; + return *this; + } + + operator const VkDeviceGroupSwapchainCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( modes == rhs.modes ); + } + + bool operator!=( DeviceGroupSwapchainCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + DeviceGroupPresentModeFlagsKHX modes; + }; + static_assert( sizeof( DeviceGroupSwapchainCreateInfoKHX ) == sizeof( VkDeviceGroupSwapchainCreateInfoKHX ), "struct and wrapper have different size!" ); + + enum class SwapchainCreateFlagBitsKHR + { + eBindSfrKHX = VK_SWAPCHAIN_CREATE_BIND_SFR_BIT_KHX + }; + + using SwapchainCreateFlagsKHR = Flags; + + VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator|( SwapchainCreateFlagBitsKHR bit0, SwapchainCreateFlagBitsKHR bit1 ) + { + return SwapchainCreateFlagsKHR( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE SwapchainCreateFlagsKHR operator~( SwapchainCreateFlagBitsKHR bits ) + { + return ~( SwapchainCreateFlagsKHR( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(SwapchainCreateFlagBitsKHR::eBindSfrKHX) + }; + }; + + struct SwapchainCreateInfoKHR + { + SwapchainCreateInfoKHR( SwapchainCreateFlagsKHR flags_ = SwapchainCreateFlagsKHR(), SurfaceKHR surface_ = SurfaceKHR(), uint32_t minImageCount_ = 0, Format imageFormat_ = Format::eUndefined, ColorSpaceKHR imageColorSpace_ = ColorSpaceKHR::eSrgbNonlinear, Extent2D imageExtent_ = Extent2D(), uint32_t imageArrayLayers_ = 0, ImageUsageFlags imageUsage_ = ImageUsageFlags(), SharingMode imageSharingMode_ = SharingMode::eExclusive, uint32_t queueFamilyIndexCount_ = 0, const uint32_t* pQueueFamilyIndices_ = nullptr, SurfaceTransformFlagBitsKHR preTransform_ = SurfaceTransformFlagBitsKHR::eIdentity, CompositeAlphaFlagBitsKHR compositeAlpha_ = CompositeAlphaFlagBitsKHR::eOpaque, PresentModeKHR presentMode_ = PresentModeKHR::eImmediate, Bool32 clipped_ = 0, SwapchainKHR oldSwapchain_ = SwapchainKHR() ) + : sType( StructureType::eSwapchainCreateInfoKHR ) + , pNext( nullptr ) + , flags( flags_ ) + , surface( surface_ ) + , minImageCount( minImageCount_ ) + , imageFormat( imageFormat_ ) + , imageColorSpace( imageColorSpace_ ) + , imageExtent( imageExtent_ ) + , imageArrayLayers( imageArrayLayers_ ) + , imageUsage( imageUsage_ ) + , imageSharingMode( imageSharingMode_ ) + , queueFamilyIndexCount( queueFamilyIndexCount_ ) + , pQueueFamilyIndices( pQueueFamilyIndices_ ) + , preTransform( preTransform_ ) + , compositeAlpha( compositeAlpha_ ) + , presentMode( presentMode_ ) + , clipped( clipped_ ) + , oldSwapchain( oldSwapchain_ ) + { + } + + SwapchainCreateInfoKHR( VkSwapchainCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); + } + + SwapchainCreateInfoKHR& operator=( VkSwapchainCreateInfoKHR const & rhs ) + { + memcpy( this, &rhs, sizeof(SwapchainCreateInfoKHR) ); + return *this; + } + + SwapchainCreateInfoKHR& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + SwapchainCreateInfoKHR& setFlags( SwapchainCreateFlagsKHR flags_ ) + { + flags = flags_; + return *this; + } + + SwapchainCreateInfoKHR& setSurface( SurfaceKHR surface_ ) + { + surface = surface_; + return *this; + } + + SwapchainCreateInfoKHR& setMinImageCount( uint32_t minImageCount_ ) + { + minImageCount = minImageCount_; + return *this; + } + + SwapchainCreateInfoKHR& setImageFormat( Format imageFormat_ ) + { + imageFormat = imageFormat_; + return *this; + } + + SwapchainCreateInfoKHR& setImageColorSpace( ColorSpaceKHR imageColorSpace_ ) + { + imageColorSpace = imageColorSpace_; + return *this; + } + + SwapchainCreateInfoKHR& setImageExtent( Extent2D imageExtent_ ) + { + imageExtent = imageExtent_; + return *this; + } + + SwapchainCreateInfoKHR& setImageArrayLayers( uint32_t imageArrayLayers_ ) + { + imageArrayLayers = imageArrayLayers_; + return *this; + } + + SwapchainCreateInfoKHR& setImageUsage( ImageUsageFlags imageUsage_ ) + { + imageUsage = imageUsage_; + return *this; + } + + SwapchainCreateInfoKHR& setImageSharingMode( SharingMode imageSharingMode_ ) + { + imageSharingMode = imageSharingMode_; + return *this; + } + + SwapchainCreateInfoKHR& setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) + { + queueFamilyIndexCount = queueFamilyIndexCount_; + return *this; + } + + SwapchainCreateInfoKHR& setPQueueFamilyIndices( const uint32_t* pQueueFamilyIndices_ ) + { + pQueueFamilyIndices = pQueueFamilyIndices_; + return *this; + } + + SwapchainCreateInfoKHR& setPreTransform( SurfaceTransformFlagBitsKHR preTransform_ ) + { + preTransform = preTransform_; + return *this; + } + + SwapchainCreateInfoKHR& setCompositeAlpha( CompositeAlphaFlagBitsKHR compositeAlpha_ ) + { + compositeAlpha = compositeAlpha_; + return *this; + } + + SwapchainCreateInfoKHR& setPresentMode( PresentModeKHR presentMode_ ) + { + presentMode = presentMode_; + return *this; + } + + SwapchainCreateInfoKHR& setClipped( Bool32 clipped_ ) + { + clipped = clipped_; + return *this; + } + + SwapchainCreateInfoKHR& setOldSwapchain( SwapchainKHR oldSwapchain_ ) + { + oldSwapchain = oldSwapchain_; + return *this; + } + + operator const VkSwapchainCreateInfoKHR&() const + { + return *reinterpret_cast(this); + } + + bool operator==( SwapchainCreateInfoKHR const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( surface == rhs.surface ) + && ( minImageCount == rhs.minImageCount ) + && ( imageFormat == rhs.imageFormat ) + && ( imageColorSpace == rhs.imageColorSpace ) + && ( imageExtent == rhs.imageExtent ) + && ( imageArrayLayers == rhs.imageArrayLayers ) + && ( imageUsage == rhs.imageUsage ) + && ( imageSharingMode == rhs.imageSharingMode ) + && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) + && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) + && ( preTransform == rhs.preTransform ) + && ( compositeAlpha == rhs.compositeAlpha ) + && ( presentMode == rhs.presentMode ) + && ( clipped == rhs.clipped ) + && ( oldSwapchain == rhs.oldSwapchain ); + } + + bool operator!=( SwapchainCreateInfoKHR const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + SwapchainCreateFlagsKHR flags; + SurfaceKHR surface; + uint32_t minImageCount; + Format imageFormat; + ColorSpaceKHR imageColorSpace; + Extent2D imageExtent; + uint32_t imageArrayLayers; + ImageUsageFlags imageUsage; + SharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t* pQueueFamilyIndices; + SurfaceTransformFlagBitsKHR preTransform; + CompositeAlphaFlagBitsKHR compositeAlpha; + PresentModeKHR presentMode; + Bool32 clipped; + SwapchainKHR oldSwapchain; + }; + static_assert( sizeof( SwapchainCreateInfoKHR ) == sizeof( VkSwapchainCreateInfoKHR ), "struct and wrapper have different size!" ); + + enum class ViewportCoordinateSwizzleNV + { + ePositiveX = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, + eNegativeX = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV, + ePositiveY = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV, + eNegativeY = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV, + ePositiveZ = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV, + eNegativeZ = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV, + ePositiveW = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV, + eNegativeW = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV + }; + + struct ViewportSwizzleNV + { + ViewportSwizzleNV( ViewportCoordinateSwizzleNV x_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV y_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV z_ = ViewportCoordinateSwizzleNV::ePositiveX, ViewportCoordinateSwizzleNV w_ = ViewportCoordinateSwizzleNV::ePositiveX ) + : x( x_ ) + , y( y_ ) + , z( z_ ) + , w( w_ ) + { + } + + ViewportSwizzleNV( VkViewportSwizzleNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportSwizzleNV) ); + } + + ViewportSwizzleNV& operator=( VkViewportSwizzleNV const & rhs ) + { + memcpy( this, &rhs, sizeof(ViewportSwizzleNV) ); + return *this; + } + + ViewportSwizzleNV& setX( ViewportCoordinateSwizzleNV x_ ) + { + x = x_; + return *this; + } + + ViewportSwizzleNV& setY( ViewportCoordinateSwizzleNV y_ ) + { + y = y_; + return *this; + } + + ViewportSwizzleNV& setZ( ViewportCoordinateSwizzleNV z_ ) + { + z = z_; + return *this; + } + + ViewportSwizzleNV& setW( ViewportCoordinateSwizzleNV w_ ) + { + w = w_; + return *this; + } + + operator const VkViewportSwizzleNV&() const + { + return *reinterpret_cast(this); + } + + bool operator==( ViewportSwizzleNV const& rhs ) const + { + return ( x == rhs.x ) + && ( y == rhs.y ) + && ( z == rhs.z ) + && ( w == rhs.w ); + } + + bool operator!=( ViewportSwizzleNV const& rhs ) const + { + return !operator==( rhs ); + } + + ViewportCoordinateSwizzleNV x; + ViewportCoordinateSwizzleNV y; + ViewportCoordinateSwizzleNV z; + ViewportCoordinateSwizzleNV w; + }; + static_assert( sizeof( ViewportSwizzleNV ) == sizeof( VkViewportSwizzleNV ), "struct and wrapper have different size!" ); + + struct PipelineViewportSwizzleStateCreateInfoNV + { + PipelineViewportSwizzleStateCreateInfoNV( PipelineViewportSwizzleStateCreateFlagsNV flags_ = PipelineViewportSwizzleStateCreateFlagsNV(), uint32_t viewportCount_ = 0, const ViewportSwizzleNV* pViewportSwizzles_ = nullptr ) + : sType( StructureType::ePipelineViewportSwizzleStateCreateInfoNV ) + , pNext( nullptr ) + , flags( flags_ ) + , viewportCount( viewportCount_ ) + , pViewportSwizzles( pViewportSwizzles_ ) + { + } + + PipelineViewportSwizzleStateCreateInfoNV( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportSwizzleStateCreateInfoNV) ); + } + + PipelineViewportSwizzleStateCreateInfoNV& operator=( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineViewportSwizzleStateCreateInfoNV) ); + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setFlags( PipelineViewportSwizzleStateCreateFlagsNV flags_ ) + { + flags = flags_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setViewportCount( uint32_t viewportCount_ ) + { + viewportCount = viewportCount_; + return *this; + } + + PipelineViewportSwizzleStateCreateInfoNV& setPViewportSwizzles( const ViewportSwizzleNV* pViewportSwizzles_ ) + { + pViewportSwizzles = pViewportSwizzles_; + return *this; + } + + operator const VkPipelineViewportSwizzleStateCreateInfoNV&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineViewportSwizzleStateCreateInfoNV const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( viewportCount == rhs.viewportCount ) + && ( pViewportSwizzles == rhs.pViewportSwizzles ); + } + + bool operator!=( PipelineViewportSwizzleStateCreateInfoNV const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + PipelineViewportSwizzleStateCreateFlagsNV flags; + uint32_t viewportCount; + const ViewportSwizzleNV* pViewportSwizzles; + }; + static_assert( sizeof( PipelineViewportSwizzleStateCreateInfoNV ) == sizeof( VkPipelineViewportSwizzleStateCreateInfoNV ), "struct and wrapper have different size!" ); + + enum class DiscardRectangleModeEXT + { + eInclusive = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, + eExclusive = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT + }; + + struct PipelineDiscardRectangleStateCreateInfoEXT + { + PipelineDiscardRectangleStateCreateInfoEXT( PipelineDiscardRectangleStateCreateFlagsEXT flags_ = PipelineDiscardRectangleStateCreateFlagsEXT(), DiscardRectangleModeEXT discardRectangleMode_ = DiscardRectangleModeEXT::eInclusive, uint32_t discardRectangleCount_ = 0, const Rect2D* pDiscardRectangles_ = nullptr ) + : sType( StructureType::ePipelineDiscardRectangleStateCreateInfoEXT ) + , pNext( nullptr ) + , flags( flags_ ) + , discardRectangleMode( discardRectangleMode_ ) + , discardRectangleCount( discardRectangleCount_ ) + , pDiscardRectangles( pDiscardRectangles_ ) + { + } + + PipelineDiscardRectangleStateCreateInfoEXT( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineDiscardRectangleStateCreateInfoEXT) ); + } + + PipelineDiscardRectangleStateCreateInfoEXT& operator=( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) + { + memcpy( this, &rhs, sizeof(PipelineDiscardRectangleStateCreateInfoEXT) ); + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setFlags( PipelineDiscardRectangleStateCreateFlagsEXT flags_ ) + { + flags = flags_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setDiscardRectangleMode( DiscardRectangleModeEXT discardRectangleMode_ ) + { + discardRectangleMode = discardRectangleMode_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setDiscardRectangleCount( uint32_t discardRectangleCount_ ) + { + discardRectangleCount = discardRectangleCount_; + return *this; + } + + PipelineDiscardRectangleStateCreateInfoEXT& setPDiscardRectangles( const Rect2D* pDiscardRectangles_ ) + { + pDiscardRectangles = pDiscardRectangles_; + return *this; + } + + operator const VkPipelineDiscardRectangleStateCreateInfoEXT&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PipelineDiscardRectangleStateCreateInfoEXT const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( discardRectangleMode == rhs.discardRectangleMode ) + && ( discardRectangleCount == rhs.discardRectangleCount ) + && ( pDiscardRectangles == rhs.pDiscardRectangles ); + } + + bool operator!=( PipelineDiscardRectangleStateCreateInfoEXT const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + PipelineDiscardRectangleStateCreateFlagsEXT flags; + DiscardRectangleModeEXT discardRectangleMode; + uint32_t discardRectangleCount; + const Rect2D* pDiscardRectangles; + }; + static_assert( sizeof( PipelineDiscardRectangleStateCreateInfoEXT ) == sizeof( VkPipelineDiscardRectangleStateCreateInfoEXT ), "struct and wrapper have different size!" ); + + enum class SubpassDescriptionFlagBits + { + ePerViewAttributesNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX, + ePerViewPositionXOnlyNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX + }; + + using SubpassDescriptionFlags = Flags; + + VULKAN_HPP_INLINE SubpassDescriptionFlags operator|( SubpassDescriptionFlagBits bit0, SubpassDescriptionFlagBits bit1 ) + { + return SubpassDescriptionFlags( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE SubpassDescriptionFlags operator~( SubpassDescriptionFlagBits bits ) + { + return ~( SubpassDescriptionFlags( bits ) ); + } + + template <> struct FlagTraits + { + enum + { + allFlags = VkFlags(SubpassDescriptionFlagBits::ePerViewAttributesNVX) | VkFlags(SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX) + }; + }; + + struct SubpassDescription + { + SubpassDescription( SubpassDescriptionFlags flags_ = SubpassDescriptionFlags(), PipelineBindPoint pipelineBindPoint_ = PipelineBindPoint::eGraphics, uint32_t inputAttachmentCount_ = 0, const AttachmentReference* pInputAttachments_ = nullptr, uint32_t colorAttachmentCount_ = 0, const AttachmentReference* pColorAttachments_ = nullptr, const AttachmentReference* pResolveAttachments_ = nullptr, const AttachmentReference* pDepthStencilAttachment_ = nullptr, uint32_t preserveAttachmentCount_ = 0, const uint32_t* pPreserveAttachments_ = nullptr ) + : flags( flags_ ) + , pipelineBindPoint( pipelineBindPoint_ ) + , inputAttachmentCount( inputAttachmentCount_ ) + , pInputAttachments( pInputAttachments_ ) + , colorAttachmentCount( colorAttachmentCount_ ) + , pColorAttachments( pColorAttachments_ ) + , pResolveAttachments( pResolveAttachments_ ) + , pDepthStencilAttachment( pDepthStencilAttachment_ ) + , preserveAttachmentCount( preserveAttachmentCount_ ) + , pPreserveAttachments( pPreserveAttachments_ ) + { + } + + SubpassDescription( VkSubpassDescription const & rhs ) + { + memcpy( this, &rhs, sizeof(SubpassDescription) ); + } + + SubpassDescription& operator=( VkSubpassDescription const & rhs ) + { + memcpy( this, &rhs, sizeof(SubpassDescription) ); + return *this; + } + + SubpassDescription& setFlags( SubpassDescriptionFlags flags_ ) + { + flags = flags_; + return *this; + } + + SubpassDescription& setPipelineBindPoint( PipelineBindPoint pipelineBindPoint_ ) + { + pipelineBindPoint = pipelineBindPoint_; + return *this; + } + + SubpassDescription& setInputAttachmentCount( uint32_t inputAttachmentCount_ ) + { + inputAttachmentCount = inputAttachmentCount_; + return *this; + } + + SubpassDescription& setPInputAttachments( const AttachmentReference* pInputAttachments_ ) + { + pInputAttachments = pInputAttachments_; + return *this; + } + + SubpassDescription& setColorAttachmentCount( uint32_t colorAttachmentCount_ ) + { + colorAttachmentCount = colorAttachmentCount_; + return *this; + } + + SubpassDescription& setPColorAttachments( const AttachmentReference* pColorAttachments_ ) + { + pColorAttachments = pColorAttachments_; + return *this; + } + + SubpassDescription& setPResolveAttachments( const AttachmentReference* pResolveAttachments_ ) + { + pResolveAttachments = pResolveAttachments_; + return *this; + } + + SubpassDescription& setPDepthStencilAttachment( const AttachmentReference* pDepthStencilAttachment_ ) + { + pDepthStencilAttachment = pDepthStencilAttachment_; + return *this; + } + + SubpassDescription& setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) + { + preserveAttachmentCount = preserveAttachmentCount_; + return *this; + } + + SubpassDescription& setPPreserveAttachments( const uint32_t* pPreserveAttachments_ ) + { + pPreserveAttachments = pPreserveAttachments_; + return *this; + } + + operator const VkSubpassDescription&() const + { + return *reinterpret_cast(this); + } + + bool operator==( SubpassDescription const& rhs ) const + { + return ( flags == rhs.flags ) + && ( pipelineBindPoint == rhs.pipelineBindPoint ) + && ( inputAttachmentCount == rhs.inputAttachmentCount ) + && ( pInputAttachments == rhs.pInputAttachments ) + && ( colorAttachmentCount == rhs.colorAttachmentCount ) + && ( pColorAttachments == rhs.pColorAttachments ) + && ( pResolveAttachments == rhs.pResolveAttachments ) + && ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) + && ( preserveAttachmentCount == rhs.preserveAttachmentCount ) + && ( pPreserveAttachments == rhs.pPreserveAttachments ); + } + + bool operator!=( SubpassDescription const& rhs ) const + { + return !operator==( rhs ); + } + + SubpassDescriptionFlags flags; + PipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const AttachmentReference* pInputAttachments; + uint32_t colorAttachmentCount; + const AttachmentReference* pColorAttachments; + const AttachmentReference* pResolveAttachments; + const AttachmentReference* pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t* pPreserveAttachments; + }; + static_assert( sizeof( SubpassDescription ) == sizeof( VkSubpassDescription ), "struct and wrapper have different size!" ); + + struct RenderPassCreateInfo + { + RenderPassCreateInfo( RenderPassCreateFlags flags_ = RenderPassCreateFlags(), uint32_t attachmentCount_ = 0, const AttachmentDescription* pAttachments_ = nullptr, uint32_t subpassCount_ = 0, const SubpassDescription* pSubpasses_ = nullptr, uint32_t dependencyCount_ = 0, const SubpassDependency* pDependencies_ = nullptr ) + : sType( StructureType::eRenderPassCreateInfo ) + , pNext( nullptr ) + , flags( flags_ ) + , attachmentCount( attachmentCount_ ) + , pAttachments( pAttachments_ ) + , subpassCount( subpassCount_ ) + , pSubpasses( pSubpasses_ ) + , dependencyCount( dependencyCount_ ) + , pDependencies( pDependencies_ ) + { + } + + RenderPassCreateInfo( VkRenderPassCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); + } + + RenderPassCreateInfo& operator=( VkRenderPassCreateInfo const & rhs ) + { + memcpy( this, &rhs, sizeof(RenderPassCreateInfo) ); + return *this; + } + + RenderPassCreateInfo& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + RenderPassCreateInfo& setFlags( RenderPassCreateFlags flags_ ) + { + flags = flags_; + return *this; + } + + RenderPassCreateInfo& setAttachmentCount( uint32_t attachmentCount_ ) + { + attachmentCount = attachmentCount_; + return *this; + } + + RenderPassCreateInfo& setPAttachments( const AttachmentDescription* pAttachments_ ) + { + pAttachments = pAttachments_; + return *this; + } + + RenderPassCreateInfo& setSubpassCount( uint32_t subpassCount_ ) + { + subpassCount = subpassCount_; + return *this; + } + + RenderPassCreateInfo& setPSubpasses( const SubpassDescription* pSubpasses_ ) + { + pSubpasses = pSubpasses_; + return *this; + } + + RenderPassCreateInfo& setDependencyCount( uint32_t dependencyCount_ ) + { + dependencyCount = dependencyCount_; + return *this; + } + + RenderPassCreateInfo& setPDependencies( const SubpassDependency* pDependencies_ ) + { + pDependencies = pDependencies_; + return *this; + } + + operator const VkRenderPassCreateInfo&() const + { + return *reinterpret_cast(this); + } + + bool operator==( RenderPassCreateInfo const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( flags == rhs.flags ) + && ( attachmentCount == rhs.attachmentCount ) + && ( pAttachments == rhs.pAttachments ) + && ( subpassCount == rhs.subpassCount ) + && ( pSubpasses == rhs.pSubpasses ) + && ( dependencyCount == rhs.dependencyCount ) + && ( pDependencies == rhs.pDependencies ); + } + + bool operator!=( RenderPassCreateInfo const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + RenderPassCreateFlags flags; + uint32_t attachmentCount; + const AttachmentDescription* pAttachments; + uint32_t subpassCount; + const SubpassDescription* pSubpasses; + uint32_t dependencyCount; + const SubpassDependency* pDependencies; + }; + static_assert( sizeof( RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); + + Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ); +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + typename ResultValueType>::type enumerateInstanceLayerProperties(); +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_INLINE Result enumerateInstanceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) { return static_cast( vkEnumerateInstanceLayerProperties( pPropertyCount, reinterpret_cast( pProperties ) ) ); } - #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateInstanceLayerProperties() + template + VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceLayerProperties() { std::vector properties; uint32_t propertyCount; @@ -17635,14 +21785,20 @@ namespace vk } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ); +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName = nullptr ); +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_INLINE Result enumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) { return static_cast( vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); } - #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName = nullptr ) + template + VULKAN_HPP_INLINE typename ResultValueType>::type enumerateInstanceExtensionProperties( Optional layerName ) { std::vector properties; uint32_t propertyCount; @@ -17662,6 +21818,7 @@ namespace vk } #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + // forward declarations struct CmdProcessCommandsInfoNVX; @@ -17672,11 +21829,15 @@ namespace vk : m_commandBuffer(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - CommandBuffer(VkCommandBuffer commandBuffer) + CommandBuffer( std::nullptr_t ) + : m_commandBuffer(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT CommandBuffer(VkCommandBuffer commandBuffer) : m_commandBuffer(commandBuffer) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) CommandBuffer& operator=(VkCommandBuffer commandBuffer) { m_commandBuffer = commandBuffer; @@ -17684,6 +21845,12 @@ namespace vk } #endif + CommandBuffer& operator=( std::nullptr_t ) + { + m_commandBuffer = VK_NULL_HANDLE; + return *this; + } + bool operator==(CommandBuffer const &rhs) const { return m_commandBuffer == rhs.m_commandBuffer; @@ -17699,735 +21866,218 @@ namespace vk return m_commandBuffer < rhs.m_commandBuffer; } - Result begin( const CommandBufferBeginInfo* pBeginInfo ) const - { - return static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( pBeginInfo ) ) ); - } - + Result begin( const CommandBufferBeginInfo* pBeginInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type begin( const CommandBufferBeginInfo & beginInfo ) const - { - Result result = static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( &beginInfo ) ) ); - return createResultValue( result, "vk::CommandBuffer::begin" ); - } + ResultValueType::type begin( const CommandBufferBeginInfo & beginInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result end( ) const - { - return static_cast( vkEndCommandBuffer( m_commandBuffer ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type end() const - { - Result result = static_cast( vkEndCommandBuffer( m_commandBuffer ) ); - return createResultValue( result, "vk::CommandBuffer::end" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result reset( CommandBufferResetFlags flags ) const - { - return static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type reset( CommandBufferResetFlags flags ) const - { - Result result = static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); - return createResultValue( result, "vk::CommandBuffer::reset" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const - { - vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const - { - vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports ) const - { - vkCmdSetViewport( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewports ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setViewport( uint32_t firstViewport, ArrayProxy viewports ) const - { - vkCmdSetViewport( m_commandBuffer, firstViewport, viewports.size() , reinterpret_cast( viewports.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const - { - vkCmdSetScissor( m_commandBuffer, firstScissor, scissorCount, reinterpret_cast( pScissors ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setScissor( uint32_t firstScissor, ArrayProxy scissors ) const - { - vkCmdSetScissor( m_commandBuffer, firstScissor, scissors.size() , reinterpret_cast( scissors.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setLineWidth( float lineWidth ) const - { - vkCmdSetLineWidth( m_commandBuffer, lineWidth ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setLineWidth( float lineWidth ) const - { - vkCmdSetLineWidth( m_commandBuffer, lineWidth ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const - { - vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const - { - vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setBlendConstants( const float blendConstants[4] ) const - { - vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setBlendConstants( const float blendConstants[4] ) const - { - vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setDepthBounds( float minDepthBounds, float maxDepthBounds ) const - { - vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setDepthBounds( float minDepthBounds, float maxDepthBounds ) const - { - vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const - { - vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const - { - vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const - { - vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const - { - vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const - { - vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const - { - vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets ) const - { - vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSetCount, reinterpret_cast( pDescriptorSets ), dynamicOffsetCount, pDynamicOffsets ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets ) const - { - vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSets.size() , reinterpret_cast( descriptorSets.data() ), dynamicOffsets.size() , dynamicOffsets.data() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const - { - vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const - { - vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets ) const - { - vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, bindingCount, reinterpret_cast( pBuffers ), pOffsets ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets ) const - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( buffers.size() == offsets.size() ); + Result end() const; #else - if ( buffers.size() != offsets.size() ) - { - throw std::logic_error( "vk::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); - } -#endif // VULKAN_HPP_NO_EXCEPTIONS - vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, buffers.size() , reinterpret_cast( buffers.data() ), offsets.data() ); - } + ResultValueType::type end() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const - { - vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const - { - vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); - } + Result reset( CommandBufferResetFlags flags ) const; +#else + ResultValueType::type reset( CommandBufferResetFlags flags ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const - { - vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const; + void setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const - { - vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } + void setViewport( uint32_t firstViewport, ArrayProxy viewports ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const - { - vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const - { - vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); - } + void setScissor( uint32_t firstScissor, ArrayProxy scissors ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const - { - vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void setLineWidth( float lineWidth ) const; + void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const; + + void setBlendConstants( const float blendConstants[4] ) const; + + void setDepthBounds( float minDepthBounds, float maxDepthBounds ) const; + + void setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const; + + void setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const; + + void setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const; + + void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const - { - vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); - } + void bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void dispatch( uint32_t x, uint32_t y, uint32_t z ) const - { - vkCmdDispatch( m_commandBuffer, x, y, z ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const; + void bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void dispatch( uint32_t x, uint32_t y, uint32_t z ) const - { - vkCmdDispatch( m_commandBuffer, x, y, z ); - } + void bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void dispatchIndirect( Buffer buffer, DeviceSize offset ) const - { - vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const; + void drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const; + + void drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const; + + void drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const; + + void dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; + + void dispatchIndirect( Buffer buffer, DeviceSize offset ) const; + + void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void dispatchIndirect( Buffer buffer, DeviceSize offset ) const - { - vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); - } + void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions ) const - { - vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); - } - + void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions ) const - { - vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); - } + void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const - { - vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); - } - + void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const - { - vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); - } + void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const - { - vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ), static_cast( filter ) ); - } - + void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter ) const - { - vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ), static_cast( filter ) ); - } + void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const - { - vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); - } - + void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const - { - vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); - } + void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const - { - vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions ) const - { - vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData ) const - { - vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, dataSize, pData ); - } - + void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data ) const - { - vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, data.size() * sizeof( T ) , reinterpret_cast( data.data() ) ); - } + void updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const - { - vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const; + void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const - { - vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); - } + void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const - { - vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pColor ), rangeCount, reinterpret_cast( pRanges ) ); - } - + void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges ) const - { - vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &color ), ranges.size() , reinterpret_cast( ranges.data() ) ); - } + void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const - { - vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pDepthStencil ), rangeCount, reinterpret_cast( pRanges ) ); - } - + void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges ) const - { - vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &depthStencil ), ranges.size() , reinterpret_cast( ranges.data() ) ); - } + void clearAttachments( ArrayProxy attachments, ArrayProxy rects ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const - { - vkCmdClearAttachments( m_commandBuffer, attachmentCount, reinterpret_cast( pAttachments ), rectCount, reinterpret_cast( pRects ) ); - } - + void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void clearAttachments( ArrayProxy attachments, ArrayProxy rects ) const - { - vkCmdClearAttachments( m_commandBuffer, attachments.size() , reinterpret_cast( attachments.data() ), rects.size() , reinterpret_cast( rects.data() ) ); - } + void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const - { - vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); - } + void setEvent( Event event, PipelineStageFlags stageMask ) const; + void resetEvent( Event event, PipelineStageFlags stageMask ) const; + + void waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const - { - vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); - } + void waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setEvent( Event event, PipelineStageFlags stageMask ) const - { - vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void setEvent( Event event, PipelineStageFlags stageMask ) const - { - vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } + void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resetEvent( Event event, PipelineStageFlags stageMask ) const - { - vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resetEvent( Event event, PipelineStageFlags stageMask ) const - { - vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void endQuery( QueryPool queryPool, uint32_t query ) const; - void waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const - { - vkCmdWaitEvents( m_commandBuffer, eventCount, reinterpret_cast( pEvents ), static_cast( srcStageMask ), static_cast( dstStageMask ), memoryBarrierCount, reinterpret_cast( pMemoryBarriers ), bufferMemoryBarrierCount, reinterpret_cast( pBufferMemoryBarriers ), imageMemoryBarrierCount, reinterpret_cast( pImageMemoryBarriers ) ); - } + void resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const - { - vkCmdWaitEvents( m_commandBuffer, events.size() , reinterpret_cast( events.data() ), static_cast( srcStageMask ), static_cast( dstStageMask ), memoryBarriers.size() , reinterpret_cast( memoryBarriers.data() ), bufferMemoryBarriers.size() , reinterpret_cast( bufferMemoryBarriers.data() ), imageMemoryBarriers.size() , reinterpret_cast( imageMemoryBarriers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const; - void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const - { - vkCmdPipelineBarrier( m_commandBuffer, static_cast( srcStageMask ), static_cast( dstStageMask ), static_cast( dependencyFlags ), memoryBarrierCount, reinterpret_cast( pMemoryBarriers ), bufferMemoryBarrierCount, reinterpret_cast( pBufferMemoryBarriers ), imageMemoryBarrierCount, reinterpret_cast( pImageMemoryBarriers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const - { - vkCmdPipelineBarrier( m_commandBuffer, static_cast( srcStageMask ), static_cast( dstStageMask ), static_cast( dependencyFlags ), memoryBarriers.size() , reinterpret_cast( memoryBarriers.data() ), bufferMemoryBarriers.size() , reinterpret_cast( bufferMemoryBarriers.data() ), imageMemoryBarriers.size() , reinterpret_cast( imageMemoryBarriers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const - { - vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const - { - vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void endQuery( QueryPool queryPool, uint32_t query ) const - { - vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void endQuery( QueryPool queryPool, uint32_t query ) const - { - vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const - { - vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const - { - vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const - { - vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const - { - vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const - { - vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const - { - vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const - { - vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, size, pValues ); - } + void copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const; + void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values ) const - { - vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, values.size() * sizeof( T ) , reinterpret_cast( values.data() ) ); - } + void pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const - { - vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( pRenderPassBegin ), static_cast( contents ) ); - } - + void beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents ) const - { - vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( &renderPassBegin ), static_cast( contents ) ); - } + void beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void nextSubpass( SubpassContents contents ) const - { - vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void nextSubpass( SubpassContents contents ) const; + void endRenderPass() const; + + void executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void nextSubpass( SubpassContents contents ) const - { - vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); - } + void executeCommands( ArrayProxy commandBuffers ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void endRenderPass( ) const - { - vkCmdEndRenderPass( m_commandBuffer ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void debugMarkerBeginEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void endRenderPass() const - { - vkCmdEndRenderPass( m_commandBuffer ); - } + DebugMarkerMarkerInfoEXT debugMarkerBeginEXT() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const - { - vkCmdExecuteCommands( m_commandBuffer, commandBufferCount, reinterpret_cast( pCommandBuffers ) ); - } + void debugMarkerEndEXT() const; + void debugMarkerInsertEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void executeCommands( ArrayProxy commandBuffers ) const - { - vkCmdExecuteCommands( m_commandBuffer, commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); - } + DebugMarkerMarkerInfoEXT debugMarkerInsertEXT() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void debugMarkerBeginEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const - { - vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); - } + void drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const; + void drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const; + + void processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - DebugMarkerMarkerInfoEXT debugMarkerBeginEXT() const - { - DebugMarkerMarkerInfoEXT markerInfo; - vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - return markerInfo; - } + void processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugMarkerEndEXT( ) const - { - vkCmdDebugMarkerEndEXT( m_commandBuffer ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugMarkerEndEXT() const - { - vkCmdDebugMarkerEndEXT( m_commandBuffer ); - } + void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void debugMarkerInsertEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const - { - vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); - } - + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - DebugMarkerMarkerInfoEXT debugMarkerInsertEXT() const - { - DebugMarkerMarkerInfoEXT markerInfo; - vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - return markerInfo; - } + void pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const - { - vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void setDeviceMaskKHX( uint32_t deviceMask ) const; + void dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const; + + void pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const; + + void setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const - { - vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); - } + void setViewportWScalingNV( uint32_t firstViewport, ArrayProxy viewportWScalings ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const - { - vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const - { - vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); - } + void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy discardRectangles ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const - { - vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( pProcessCommandsInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo ) const - { - vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( &processCommandsInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const - { - vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( pReserveSpaceInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const - { - vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( &reserveSpaceInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkCommandBuffer() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandBuffer() const { return m_commandBuffer; } @@ -18447,6 +22097,499 @@ namespace vk }; static_assert( sizeof( CommandBuffer ) == sizeof( VkCommandBuffer ), "handle and wrapper have different size!" ); + VULKAN_HPP_INLINE Result CommandBuffer::begin( const CommandBufferBeginInfo* pBeginInfo ) const + { + return static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( pBeginInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::begin( const CommandBufferBeginInfo & beginInfo ) const + { + Result result = static_cast( vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( &beginInfo ) ) ); + return createResultValue( result, "vk::CommandBuffer::begin" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result CommandBuffer::end() const + { + return static_cast( vkEndCommandBuffer( m_commandBuffer ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::end() const + { + Result result = static_cast( vkEndCommandBuffer( m_commandBuffer ) ); + return createResultValue( result, "vk::CommandBuffer::end" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result CommandBuffer::reset( CommandBufferResetFlags flags ) const + { + return static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type CommandBuffer::reset( CommandBufferResetFlags flags ) const + { + Result result = static_cast( vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); + return createResultValue( result, "vk::CommandBuffer::reset" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( PipelineBindPoint pipelineBindPoint, Pipeline pipeline ) const + { + vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, uint32_t viewportCount, const Viewport* pViewports ) const + { + vkCmdSetViewport( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewports ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, ArrayProxy viewports ) const + { + vkCmdSetViewport( m_commandBuffer, firstViewport, viewports.size() , reinterpret_cast( viewports.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, uint32_t scissorCount, const Rect2D* pScissors ) const + { + vkCmdSetScissor( m_commandBuffer, firstScissor, scissorCount, reinterpret_cast( pScissors ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, ArrayProxy scissors ) const + { + vkCmdSetScissor( m_commandBuffer, firstScissor, scissors.size() , reinterpret_cast( scissors.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth ) const + { + vkCmdSetLineWidth( m_commandBuffer, lineWidth ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const + { + vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4] ) const + { + vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds ) const + { + vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setStencilCompareMask( StencilFaceFlags faceMask, uint32_t compareMask ) const + { + vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setStencilWriteMask( StencilFaceFlags faceMask, uint32_t writeMask ) const + { + vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setStencilReference( StencilFaceFlags faceMask, uint32_t reference ) const + { + vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); + } + + VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets ) const + { + vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSetCount, reinterpret_cast( pDescriptorSets ), dynamicOffsetCount, pDynamicOffsets ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t firstSet, ArrayProxy descriptorSets, ArrayProxy dynamicOffsets ) const + { + vkCmdBindDescriptorSets( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), firstSet, descriptorSets.size() , reinterpret_cast( descriptorSets.data() ), dynamicOffsets.size() , dynamicOffsets.data() ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( Buffer buffer, DeviceSize offset, IndexType indexType ) const + { + vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), offset, static_cast( indexType ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, uint32_t bindingCount, const Buffer* pBuffers, const DeviceSize* pOffsets ) const + { + vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, bindingCount, reinterpret_cast( pBuffers ), pOffsets ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, ArrayProxy buffers, ArrayProxy offsets ) const + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + assert( buffers.size() == offsets.size() ); +#else + if ( buffers.size() != offsets.size() ) + { + throw std::logic_error( "vk::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); + } +#endif // VULKAN_HPP_NO_EXCEPTIONS + vkCmdBindVertexBuffers( m_commandBuffer, firstBinding, buffers.size() , reinterpret_cast( buffers.data() ), offsets.data() ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const + { + vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); + } + + VULKAN_HPP_INLINE void CommandBuffer::drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const + { + vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); + } + + VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const + { + vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + } + + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( Buffer buffer, DeviceSize offset, uint32_t drawCount, uint32_t stride ) const + { + vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), offset, drawCount, stride ); + } + + VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); + } + + VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( Buffer buffer, DeviceSize offset ) const + { + vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), offset ); + } + + VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, uint32_t regionCount, const BufferCopy* pRegions ) const + { + vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( Buffer srcBuffer, Buffer dstBuffer, ArrayProxy regions ) const + { + vkCmdCopyBuffer( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageCopy* pRegions ) const + { + vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::copyImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + { + vkCmdCopyImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageBlit* pRegions, Filter filter ) const + { + vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ), static_cast( filter ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::blitImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions, Filter filter ) const + { + vkCmdBlitImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ), static_cast( filter ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopy* pRegions ) const + { + vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( Buffer srcBuffer, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + { + vkCmdCopyBufferToImage( m_commandBuffer, static_cast( srcBuffer ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, uint32_t regionCount, const BufferImageCopy* pRegions ) const + { + vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regionCount, reinterpret_cast( pRegions ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( Image srcImage, ImageLayout srcImageLayout, Buffer dstBuffer, ArrayProxy regions ) const + { + vkCmdCopyImageToBuffer( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstBuffer ), regions.size() , reinterpret_cast( regions.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize dataSize, const void* pData ) const + { + vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, dataSize, pData ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( Buffer dstBuffer, DeviceSize dstOffset, ArrayProxy data ) const + { + vkCmdUpdateBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, data.size() * sizeof( T ) , reinterpret_cast( data.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( Buffer dstBuffer, DeviceSize dstOffset, DeviceSize size, uint32_t data ) const + { + vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), dstOffset, size, data ); + } + + VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue* pColor, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const + { + vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pColor ), rangeCount, reinterpret_cast( pRanges ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( Image image, ImageLayout imageLayout, const ClearColorValue & color, ArrayProxy ranges ) const + { + vkCmdClearColorImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &color ), ranges.size() , reinterpret_cast( ranges.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const ImageSubresourceRange* pRanges ) const + { + vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( pDepthStencil ), rangeCount, reinterpret_cast( pRanges ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( Image image, ImageLayout imageLayout, const ClearDepthStencilValue & depthStencil, ArrayProxy ranges ) const + { + vkCmdClearDepthStencilImage( m_commandBuffer, static_cast( image ), static_cast( imageLayout ), reinterpret_cast( &depthStencil ), ranges.size() , reinterpret_cast( ranges.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( uint32_t attachmentCount, const ClearAttachment* pAttachments, uint32_t rectCount, const ClearRect* pRects ) const + { + vkCmdClearAttachments( m_commandBuffer, attachmentCount, reinterpret_cast( pAttachments ), rectCount, reinterpret_cast( pRects ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( ArrayProxy attachments, ArrayProxy rects ) const + { + vkCmdClearAttachments( m_commandBuffer, attachments.size() , reinterpret_cast( attachments.data() ), rects.size() , reinterpret_cast( rects.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, uint32_t regionCount, const ImageResolve* pRegions ) const + { + vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regionCount, reinterpret_cast( pRegions ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::resolveImage( Image srcImage, ImageLayout srcImageLayout, Image dstImage, ImageLayout dstImageLayout, ArrayProxy regions ) const + { + vkCmdResolveImage( m_commandBuffer, static_cast( srcImage ), static_cast( srcImageLayout ), static_cast( dstImage ), static_cast( dstImageLayout ), regions.size() , reinterpret_cast( regions.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setEvent( Event event, PipelineStageFlags stageMask ) const + { + vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::resetEvent( Event event, PipelineStageFlags stageMask ) const + { + vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::waitEvents( uint32_t eventCount, const Event* pEvents, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const + { + vkCmdWaitEvents( m_commandBuffer, eventCount, reinterpret_cast( pEvents ), static_cast( srcStageMask ), static_cast( dstStageMask ), memoryBarrierCount, reinterpret_cast( pMemoryBarriers ), bufferMemoryBarrierCount, reinterpret_cast( pBufferMemoryBarriers ), imageMemoryBarrierCount, reinterpret_cast( pImageMemoryBarriers ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::waitEvents( ArrayProxy events, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const + { + vkCmdWaitEvents( m_commandBuffer, events.size() , reinterpret_cast( events.data() ), static_cast( srcStageMask ), static_cast( dstStageMask ), memoryBarriers.size() , reinterpret_cast( memoryBarriers.data() ), bufferMemoryBarriers.size() , reinterpret_cast( bufferMemoryBarriers.data() ), imageMemoryBarriers.size() , reinterpret_cast( imageMemoryBarriers.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const MemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const BufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const ImageMemoryBarrier* pImageMemoryBarriers ) const + { + vkCmdPipelineBarrier( m_commandBuffer, static_cast( srcStageMask ), static_cast( dstStageMask ), static_cast( dependencyFlags ), memoryBarrierCount, reinterpret_cast( pMemoryBarriers ), bufferMemoryBarrierCount, reinterpret_cast( pBufferMemoryBarriers ), imageMemoryBarrierCount, reinterpret_cast( pImageMemoryBarriers ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, DependencyFlags dependencyFlags, ArrayProxy memoryBarriers, ArrayProxy bufferMemoryBarriers, ArrayProxy imageMemoryBarriers ) const + { + vkCmdPipelineBarrier( m_commandBuffer, static_cast( srcStageMask ), static_cast( dstStageMask ), static_cast( dependencyFlags ), memoryBarriers.size() , reinterpret_cast( memoryBarriers.data() ), bufferMemoryBarriers.size() , reinterpret_cast( bufferMemoryBarriers.data() ), imageMemoryBarriers.size() , reinterpret_cast( imageMemoryBarriers.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::beginQuery( QueryPool queryPool, uint32_t query, QueryControlFlags flags ) const + { + vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::endQuery( QueryPool queryPool, uint32_t query ) const + { + vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); + } + + VULKAN_HPP_INLINE void CommandBuffer::resetQueryPool( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const + { + vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); + } + + VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( PipelineStageFlagBits pipelineStage, QueryPool queryPool, uint32_t query ) const + { + vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); + } + + VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Buffer dstBuffer, DeviceSize dstOffset, DeviceSize stride, QueryResultFlags flags ) const + { + vkCmdCopyQueryPoolResults( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount, static_cast( dstBuffer ), dstOffset, stride, static_cast( flags ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues ) const + { + vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, size, pValues ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE void CommandBuffer::pushConstants( PipelineLayout layout, ShaderStageFlags stageFlags, uint32_t offset, ArrayProxy values ) const + { + vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, values.size() * sizeof( T ) , reinterpret_cast( values.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo* pRenderPassBegin, SubpassContents contents ) const + { + vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( pRenderPassBegin ), static_cast( contents ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const RenderPassBeginInfo & renderPassBegin, SubpassContents contents ) const + { + vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( &renderPassBegin ), static_cast( contents ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( SubpassContents contents ) const + { + vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); + } + + VULKAN_HPP_INLINE void CommandBuffer::endRenderPass() const + { + vkCmdEndRenderPass( m_commandBuffer ); + } + + VULKAN_HPP_INLINE void CommandBuffer::executeCommands( uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const + { + vkCmdExecuteCommands( m_commandBuffer, commandBufferCount, reinterpret_cast( pCommandBuffers ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::executeCommands( ArrayProxy commandBuffers ) const + { + vkCmdExecuteCommands( m_commandBuffer, commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const + { + vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE DebugMarkerMarkerInfoEXT CommandBuffer::debugMarkerBeginEXT() const + { + DebugMarkerMarkerInfoEXT markerInfo; + vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); + return markerInfo; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT() const + { + vkCmdDebugMarkerEndEXT( m_commandBuffer ); + } + + VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( DebugMarkerMarkerInfoEXT* pMarkerInfo ) const + { + vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE DebugMarkerMarkerInfoEXT CommandBuffer::debugMarkerInsertEXT() const + { + DebugMarkerMarkerInfoEXT markerInfo; + vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); + return markerInfo; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const + { + vkCmdDrawIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + } + + VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( Buffer buffer, DeviceSize offset, Buffer countBuffer, DeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride ) const + { + vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, static_cast( buffer ), offset, static_cast( countBuffer ), countBufferOffset, maxDrawCount, stride ); + } + + VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX* pProcessCommandsInfo ) const + { + vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( pProcessCommandsInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::processCommandsNVX( const CmdProcessCommandsInfoNVX & processCommandsInfo ) const + { + vkCmdProcessCommandsNVX( m_commandBuffer, reinterpret_cast( &processCommandsInfo ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo ) const + { + vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( pReserveSpaceInfo ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::reserveSpaceForCommandsNVX( const CmdReserveSpaceForCommandsInfoNVX & reserveSpaceInfo ) const + { + vkCmdReserveSpaceForCommandsNVX( m_commandBuffer, reinterpret_cast( &reserveSpaceInfo ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites ) const + { + vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( PipelineBindPoint pipelineBindPoint, PipelineLayout layout, uint32_t set, ArrayProxy descriptorWrites ) const + { + vkCmdPushDescriptorSetKHR( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( layout ), set, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHX( uint32_t deviceMask ) const + { + vkCmdSetDeviceMaskKHX( m_commandBuffer, deviceMask ); + } + + VULKAN_HPP_INLINE void CommandBuffer::dispatchBaseKHX( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const + { + vkCmdDispatchBaseKHX( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); + } + + VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, PipelineLayout layout, uint32_t set, const void* pData ) const + { + vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, static_cast( descriptorUpdateTemplate ), static_cast( layout ), set, pData ); + } + + VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, uint32_t viewportCount, const ViewportWScalingNV* pViewportWScalings ) const + { + vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewportWScalings ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, ArrayProxy viewportWScalings ) const + { + vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportWScalings.size() , reinterpret_cast( viewportWScalings.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const Rect2D* pDiscardRectangles ) const + { + vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangleCount, reinterpret_cast( pDiscardRectangles ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, ArrayProxy discardRectangles ) const + { + vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangles.size() , reinterpret_cast( discardRectangles.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + struct SubmitInfo { SubmitInfo( uint32_t waitSemaphoreCount_ = 0, const Semaphore* pWaitSemaphores_ = nullptr, const PipelineStageFlags* pWaitDstStageMask_ = nullptr, uint32_t commandBufferCount_ = 0, const CommandBuffer* pCommandBuffers_ = nullptr, uint32_t signalSemaphoreCount_ = 0, const Semaphore* pSignalSemaphores_ = nullptr ) @@ -18473,12 +22616,6 @@ namespace vk return *this; } - SubmitInfo& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - SubmitInfo& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -18572,11 +22709,15 @@ namespace vk : m_queue(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Queue(VkQueue queue) + Queue( std::nullptr_t ) + : m_queue(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Queue(VkQueue queue) : m_queue(queue) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Queue& operator=(VkQueue queue) { m_queue = queue; @@ -18584,6 +22725,12 @@ namespace vk } #endif + Queue& operator=( std::nullptr_t ) + { + m_queue = VK_NULL_HANDLE; + return *this; + } + bool operator==(Queue const &rhs) const { return m_queue == rhs.m_queue; @@ -18599,64 +22746,28 @@ namespace vk return m_queue < rhs.m_queue; } - Result submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence ) const - { - return static_cast( vkQueueSubmit( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); - } - + Result submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type submit( ArrayProxy submits, Fence fence ) const - { - Result result = static_cast( vkQueueSubmit( m_queue, submits.size() , reinterpret_cast( submits.data() ), static_cast( fence ) ) ); - return createResultValue( result, "vk::Queue::submit" ); - } + ResultValueType::type submit( ArrayProxy submits, Fence fence ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitIdle( ) const - { - return static_cast( vkQueueWaitIdle( m_queue ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type waitIdle() const - { - Result result = static_cast( vkQueueWaitIdle( m_queue ) ); - return createResultValue( result, "vk::Queue::waitIdle" ); - } + Result waitIdle() const; +#else + ResultValueType::type waitIdle() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence ) const - { - return static_cast( vkQueueBindSparse( m_queue, bindInfoCount, reinterpret_cast( pBindInfo ), static_cast( fence ) ) ); - } - + Result bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindSparse( ArrayProxy bindInfo, Fence fence ) const - { - Result result = static_cast( vkQueueBindSparse( m_queue, bindInfo.size() , reinterpret_cast( bindInfo.data() ), static_cast( fence ) ) ); - return createResultValue( result, "vk::Queue::bindSparse" ); - } + ResultValueType::type bindSparse( ArrayProxy bindInfo, Fence fence ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result presentKHR( const PresentInfoKHR* pPresentInfo ) const - { - return static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( pPresentInfo ) ) ); - } - + Result presentKHR( const PresentInfoKHR* pPresentInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result presentKHR( const PresentInfoKHR & presentInfo ) const - { - Result result = static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( &presentInfo ) ) ); - return createResultValue( result, "vk::Queue::presentKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); - } + Result presentKHR( const PresentInfoKHR & presentInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkQueue() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkQueue() const { return m_queue; } @@ -18676,6 +22787,108 @@ namespace vk }; static_assert( sizeof( Queue ) == sizeof( VkQueue ), "handle and wrapper have different size!" ); + VULKAN_HPP_INLINE Result Queue::submit( uint32_t submitCount, const SubmitInfo* pSubmits, Fence fence ) const + { + return static_cast( vkQueueSubmit( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Queue::submit( ArrayProxy submits, Fence fence ) const + { + Result result = static_cast( vkQueueSubmit( m_queue, submits.size() , reinterpret_cast( submits.data() ), static_cast( fence ) ) ); + return createResultValue( result, "vk::Queue::submit" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Queue::waitIdle() const + { + return static_cast( vkQueueWaitIdle( m_queue ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Queue::waitIdle() const + { + Result result = static_cast( vkQueueWaitIdle( m_queue ) ); + return createResultValue( result, "vk::Queue::waitIdle" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Queue::bindSparse( uint32_t bindInfoCount, const BindSparseInfo* pBindInfo, Fence fence ) const + { + return static_cast( vkQueueBindSparse( m_queue, bindInfoCount, reinterpret_cast( pBindInfo ), static_cast( fence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Queue::bindSparse( ArrayProxy bindInfo, Fence fence ) const + { + Result result = static_cast( vkQueueBindSparse( m_queue, bindInfo.size() , reinterpret_cast( bindInfo.data() ), static_cast( fence ) ) ); + return createResultValue( result, "vk::Queue::bindSparse" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR* pPresentInfo ) const + { + return static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( pPresentInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR & presentInfo ) const + { + Result result = static_cast( vkQueuePresentKHR( m_queue, reinterpret_cast( &presentInfo ) ) ); + return createResultValue( result, "vk::Queue::presentKHR", { Result::eSuccess, Result::eSuboptimalKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class BufferDeleter; + using UniqueBuffer = UniqueHandle; + class BufferViewDeleter; + using UniqueBufferView = UniqueHandle; + class CommandBufferDeleter; + using UniqueCommandBuffer = UniqueHandle; + class CommandPoolDeleter; + using UniqueCommandPool = UniqueHandle; + class DescriptorPoolDeleter; + using UniqueDescriptorPool = UniqueHandle; + class DescriptorSetDeleter; + using UniqueDescriptorSet = UniqueHandle; + class DescriptorSetLayoutDeleter; + using UniqueDescriptorSetLayout = UniqueHandle; + class DescriptorUpdateTemplateKHRDeleter; + using UniqueDescriptorUpdateTemplateKHR = UniqueHandle; + class DeviceMemoryDeleter; + using UniqueDeviceMemory = UniqueHandle; + class EventDeleter; + using UniqueEvent = UniqueHandle; + class FenceDeleter; + using UniqueFence = UniqueHandle; + class FramebufferDeleter; + using UniqueFramebuffer = UniqueHandle; + class ImageDeleter; + using UniqueImage = UniqueHandle; + class ImageViewDeleter; + using UniqueImageView = UniqueHandle; + class IndirectCommandsLayoutNVXDeleter; + using UniqueIndirectCommandsLayoutNVX = UniqueHandle; + class ObjectTableNVXDeleter; + using UniqueObjectTableNVX = UniqueHandle; + class PipelineDeleter; + using UniquePipeline = UniqueHandle; + class PipelineCacheDeleter; + using UniquePipelineCache = UniqueHandle; + class PipelineLayoutDeleter; + using UniquePipelineLayout = UniqueHandle; + class QueryPoolDeleter; + using UniqueQueryPool = UniqueHandle; + class RenderPassDeleter; + using UniqueRenderPass = UniqueHandle; + class SamplerDeleter; + using UniqueSampler = UniqueHandle; + class SemaphoreDeleter; + using UniqueSemaphore = UniqueHandle; + class ShaderModuleDeleter; + using UniqueShaderModule = UniqueHandle; + class SwapchainKHRDeleter; + using UniqueSwapchainKHR = UniqueHandle; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + class Device { public: @@ -18683,11 +22896,15 @@ namespace vk : m_device(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Device(VkDevice device) + Device( std::nullptr_t ) + : m_device(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Device(VkDevice device) : m_device(device) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) Device& operator=(VkDevice device) { m_device = device; @@ -18695,6 +22912,12 @@ namespace vk } #endif + Device& operator=( std::nullptr_t ) + { + m_device = VK_NULL_HANDLE; + return *this; + } + bool operator==(Device const &rhs) const { return m_device == rhs.m_device; @@ -18710,1296 +22933,665 @@ namespace vk return m_device < rhs.m_device; } - PFN_vkVoidFunction getProcAddr( const char* pName ) const - { - return vkGetDeviceProcAddr( m_device, pName ); - } - + PFN_vkVoidFunction getProcAddr( const char* pName ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PFN_vkVoidFunction getProcAddr( const std::string & name ) const - { - return vkGetDeviceProcAddr( m_device, name.c_str() ); - } + PFN_vkVoidFunction getProcAddr( const std::string & name ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroy( const AllocationCallbacks* pAllocator ) const - { - vkDestroyDevice( m_device, reinterpret_cast( pAllocator ) ); - } - + void destroy( const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroy( Optional allocator = nullptr ) const - { - vkDestroyDevice( m_device, reinterpret_cast( static_cast( allocator)) ); - } + void destroy( Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue ) const - { - vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( pQueue ) ); - } - + void getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Queue getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const - { - Queue queue; - vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( &queue ) ); - return queue; - } + Queue getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitIdle( ) const - { - return static_cast( vkDeviceWaitIdle( m_device ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type waitIdle() const - { - Result result = static_cast( vkDeviceWaitIdle( m_device ) ); - return createResultValue( result, "vk::Device::waitIdle" ); - } + Result waitIdle() const; +#else + ResultValueType::type waitIdle() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory ) const - { - return static_cast( vkAllocateMemory( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMemory ) ) ); - } - + Result allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr ) const - { - DeviceMemory memory; - Result result = static_cast( vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &memory ) ) ); - return createResultValue( result, memory, "vk::Device::allocateMemory" ); - } + ResultValueType::type allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDeviceMemory allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator ) const - { - vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); - } - + void freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void freeMemory( DeviceMemory memory, Optional allocator = nullptr ) const - { - vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( static_cast( allocator)) ); - } + void freeMemory( DeviceMemory memory, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags = MemoryMapFlags() ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void unmapMemory( DeviceMemory memory ) const; + + Result flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type flushMappedMemoryRanges( ArrayProxy memoryRanges ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type invalidateMappedMemoryRanges( ArrayProxy memoryRanges ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + DeviceSize getMemoryCommitment( DeviceMemory memory ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + MemoryRequirements getBufferMemoryRequirements( Buffer buffer ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData ) const - { - return static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), ppData ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + Result bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const; +#else + ResultValueType::type bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + void getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags = MemoryMapFlags() ) const - { - void* pData; - Result result = static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), &pData ) ); - return createResultValue( result, pData, "vk::Device::mapMemory" ); - } + MemoryRequirements getImageMemoryRequirements( Image image ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void unmapMemory( DeviceMemory memory ) const - { - vkUnmapMemory( m_device, static_cast( memory ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void unmapMemory( DeviceMemory memory ) const - { - vkUnmapMemory( m_device, static_cast( memory ) ); - } + Result bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const; +#else + ResultValueType::type bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const - { - return static_cast( vkFlushMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); - } - + void getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type flushMappedMemoryRanges( ArrayProxy memoryRanges ) const - { - Result result = static_cast( vkFlushMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); - return createResultValue( result, "vk::Device::flushMappedMemoryRanges" ); - } + template > + std::vector getImageSparseMemoryRequirements( Image image ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const - { - return static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); - } - + Result createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type invalidateMappedMemoryRanges( ArrayProxy memoryRanges ) const - { - Result result = static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); - return createResultValue( result, "vk::Device::invalidateMappedMemoryRanges" ); - } + ResultValueType::type createFence( const FenceCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueFence createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const - { - vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), pCommittedMemoryInBytes ); - } - + void destroyFence( Fence fence, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - DeviceSize getMemoryCommitment( DeviceMemory memory ) const - { - DeviceSize committedMemoryInBytes; - vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), &committedMemoryInBytes ); - return committedMemoryInBytes; - } + void destroyFence( Fence fence, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements ) const - { - vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( pMemoryRequirements ) ); - } - + Result resetFences( uint32_t fenceCount, const Fence* pFences ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements getBufferMemoryRequirements( Buffer buffer ) const - { - MemoryRequirements memoryRequirements; - vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( &memoryRequirements ) ); - return memoryRequirements; - } + ResultValueType::type resetFences( ArrayProxy fences ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getFenceStatus( Fence fence ) const; + + Result waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + Result waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSemaphore createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroySemaphore( Semaphore semaphore, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createEvent( const EventCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueEvent createEventUnique( const EventCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void destroyEvent( Event event, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroyEvent( Event event, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getEventStatus( Event event ) const; + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + Result setEvent( Event event ) const; +#else + ResultValueType::type setEvent( Event event ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const - { - return static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const - { - Result result = static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); - return createResultValue( result, "vk::Device::bindBufferMemory" ); - } + Result resetEvent( Event event ) const; +#else + ResultValueType::type resetEvent( Event event ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements ) const - { - vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( pMemoryRequirements ) ); - } - + Result createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - MemoryRequirements getImageMemoryRequirements( Image image ) const - { - MemoryRequirements memoryRequirements; - vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( &memoryRequirements ) ); - return memoryRequirements; - } + ResultValueType::type createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueQueryPool createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const - { - return static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - + void destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const - { - Result result = static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); - return createResultValue( result, "vk::Device::bindImageMemory" ); - } + void destroyQueryPool( QueryPool queryPool, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements ) const - { - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getImageSparseMemoryRequirements( Image image ) const - { - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const - { - return static_cast( vkCreateFence( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createFence( const FenceCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Fence fence; - Result result = static_cast( vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "vk::Device::createFence" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroyFence( Fence fence, const AllocationCallbacks* pAllocator ) const - { - vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyFence( Fence fence, Optional allocator = nullptr ) const - { - vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result resetFences( uint32_t fenceCount, const Fence* pFences ) const - { - return static_cast( vkResetFences( m_device, fenceCount, reinterpret_cast( pFences ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type resetFences( ArrayProxy fences ) const - { - Result result = static_cast( vkResetFences( m_device, fences.size() , reinterpret_cast( fences.data() ) ) ); - return createResultValue( result, "vk::Device::resetFences" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result getFenceStatus( Fence fence ) const - { - return static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result getFenceStatus( Fence fence ) const - { - Result result = static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); - return createResultValue( result, "vk::Device::getFenceStatus", { Result::eSuccess, Result::eNotReady } ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout ) const - { - return static_cast( vkWaitForFences( m_device, fenceCount, reinterpret_cast( pFences ), waitAll, timeout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout ) const - { - Result result = static_cast( vkWaitForFences( m_device, fences.size() , reinterpret_cast( fences.data() ), waitAll, timeout ) ); - return createResultValue( result, "vk::Device::waitForFences", { Result::eSuccess, Result::eTimeout } ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const - { - return static_cast( vkCreateSemaphore( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSemaphore ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Semaphore semaphore; - Result result = static_cast( vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &semaphore ) ) ); - return createResultValue( result, semaphore, "vk::Device::createSemaphore" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator ) const - { - vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySemaphore( Semaphore semaphore, Optional allocator = nullptr ) const - { - vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent ) const - { - return static_cast( vkCreateEvent( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pEvent ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createEvent( const EventCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Event event; - Result result = static_cast( vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &event ) ) ); - return createResultValue( result, event, "vk::Device::createEvent" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroyEvent( Event event, const AllocationCallbacks* pAllocator ) const - { - vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyEvent( Event event, Optional allocator = nullptr ) const - { - vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result getEventStatus( Event event ) const - { - return static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result getEventStatus( Event event ) const - { - Result result = static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); - return createResultValue( result, "vk::Device::getEventStatus", { Result::eEventSet, Result::eEventReset } ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result setEvent( Event event ) const - { - return static_cast( vkSetEvent( m_device, static_cast( event ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type setEvent( Event event ) const - { - Result result = static_cast( vkSetEvent( m_device, static_cast( event ) ) ); - return createResultValue( result, "vk::Device::setEvent" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetEvent( Event event ) const - { - return static_cast( vkResetEvent( m_device, static_cast( event ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type resetEvent( Event event ) const - { - Result result = static_cast( vkResetEvent( m_device, static_cast( event ) ) ); - return createResultValue( result, "vk::Device::resetEvent" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool ) const - { - return static_cast( vkCreateQueryPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pQueryPool ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator = nullptr ) const - { - QueryPool queryPool; - Result result = static_cast( vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &queryPool ) ) ); - return createResultValue( result, queryPool, "vk::Device::createQueryPool" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator ) const - { - vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyQueryPool( QueryPool queryPool, Optional allocator = nullptr ) const - { - vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags ) const - { - return static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, dataSize, pData, stride, static_cast( flags ) ) ); - } - + Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags ) const - { - Result result = static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, data.size() * sizeof( T ) , reinterpret_cast( data.data() ), stride, static_cast( flags ) ) ); - return createResultValue( result, "vk::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } ); - } + Result getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer ) const - { - return static_cast( vkCreateBuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pBuffer ) ) ); - } - + Result createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createBuffer( const BufferCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Buffer buffer; - Result result = static_cast( vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &buffer ) ) ); - return createResultValue( result, buffer, "vk::Device::createBuffer" ); - } + ResultValueType::type createBuffer( const BufferCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueBuffer createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator ) const - { - vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); - } - + void destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyBuffer( Buffer buffer, Optional allocator = nullptr ) const - { - vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyBuffer( Buffer buffer, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView ) const - { - return static_cast( vkCreateBufferView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); - } - + Result createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr ) const - { - BufferView view; - Result result = static_cast( vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &view ) ) ); - return createResultValue( result, view, "vk::Device::createBufferView" ); - } + ResultValueType::type createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueBufferView createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator ) const - { - vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); - } - + void destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyBufferView( BufferView bufferView, Optional allocator = nullptr ) const - { - vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyBufferView( BufferView bufferView, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage ) const - { - return static_cast( vkCreateImage( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pImage ) ) ); - } - + Result createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createImage( const ImageCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Image image; - Result result = static_cast( vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &image ) ) ); - return createResultValue( result, image, "vk::Device::createImage" ); - } + ResultValueType::type createImage( const ImageCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueImage createImageUnique( const ImageCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyImage( Image image, const AllocationCallbacks* pAllocator ) const - { - vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); - } - + void destroyImage( Image image, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyImage( Image image, Optional allocator = nullptr ) const - { - vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyImage( Image image, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout ) const - { - vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( pSubresource ), reinterpret_cast( pLayout ) ); - } - + void getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - SubresourceLayout getImageSubresourceLayout( Image image, const ImageSubresource & subresource ) const - { - SubresourceLayout layout; - vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( &subresource ), reinterpret_cast( &layout ) ); - return layout; - } + SubresourceLayout getImageSubresourceLayout( Image image, const ImageSubresource & subresource ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView ) const - { - return static_cast( vkCreateImageView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); - } - + Result createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createImageView( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr ) const - { - ImageView view; - Result result = static_cast( vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &view ) ) ); - return createResultValue( result, view, "vk::Device::createImageView" ); - } + ResultValueType::type createImageView( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueImageView createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator ) const - { - vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); - } - + void destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyImageView( ImageView imageView, Optional allocator = nullptr ) const - { - vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyImageView( ImageView imageView, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule ) const - { - return static_cast( vkCreateShaderModule( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pShaderModule ) ) ); - } - + Result createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr ) const - { - ShaderModule shaderModule; - Result result = static_cast( vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &shaderModule ) ) ); - return createResultValue( result, shaderModule, "vk::Device::createShaderModule" ); - } + ResultValueType::type createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueShaderModule createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator ) const - { - vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); - } - + void destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyShaderModule( ShaderModule shaderModule, Optional allocator = nullptr ) const - { - vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyShaderModule( ShaderModule shaderModule, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache ) const - { - return static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineCache ) ) ); - } - + Result createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr ) const - { - PipelineCache pipelineCache; - Result result = static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipelineCache ) ) ); - return createResultValue( result, pipelineCache, "vk::Device::createPipelineCache" ); - } + ResultValueType::type createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniquePipelineCache createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator ) const - { - vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); - } - + void destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipelineCache( PipelineCache pipelineCache, Optional allocator = nullptr ) const - { - vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyPipelineCache( PipelineCache pipelineCache, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData ) const - { - return static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), pDataSize, pData ) ); - } - + Result getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getPipelineCacheData( PipelineCache pipelineCache ) const - { - std::vector data; - size_t dataSize; - Result result; - do - { - result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ) ); - if ( ( result == Result::eSuccess ) && dataSize ) - { - data.resize( dataSize ); - result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( dataSize <= data.size() ); - data.resize( dataSize ); - return createResultValue( result, data, "vk::Device::getPipelineCacheData" ); - } + template > + typename ResultValueType>::type getPipelineCacheData( PipelineCache pipelineCache ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches ) const - { - return static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); - } - + Result mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches ) const - { - Result result = static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); - return createResultValue( result, "vk::Device::mergePipelineCaches" ); - } + ResultValueType::type mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const - { - return static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); - } - + Result createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const - { - std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( pipelines.data() ) ) ); - return createResultValue( result, pipelines, "vk::Device::createGraphicsPipelines" ); - } - - ResultValueType::type createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Pipeline pipeline; - Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipeline ) ) ); - return createResultValue( result, pipeline, "vk::Device::createGraphicsPipeline" ); - } + template > + typename ResultValueType>::type createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; + ResultValueType::type createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template > + std::vector createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; + UniquePipeline createGraphicsPipelineUnique( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const - { - return static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); - } - + Result createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const - { - std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( pipelines.data() ) ) ); - return createResultValue( result, pipelines, "vk::Device::createComputePipelines" ); - } - - ResultValueType::type createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Pipeline pipeline; - Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipeline ) ) ); - return createResultValue( result, pipeline, "vk::Device::createComputePipeline" ); - } + template > + typename ResultValueType>::type createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; + ResultValueType::type createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template > + std::vector createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator = nullptr ) const; + UniquePipeline createComputePipelineUnique( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const - { - vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); - } - + void destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipeline( Pipeline pipeline, Optional allocator = nullptr ) const - { - vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyPipeline( Pipeline pipeline, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout ) const - { - return static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineLayout ) ) ); - } - + Result createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const - { - PipelineLayout pipelineLayout; - Result result = static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipelineLayout ) ) ); - return createResultValue( result, pipelineLayout, "vk::Device::createPipelineLayout" ); - } + ResultValueType::type createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniquePipelineLayout createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator ) const - { - vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); - } - + void destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator = nullptr ) const - { - vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler ) const - { - return static_cast( vkCreateSampler( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSampler ) ) ); - } - + Result createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSampler( const SamplerCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Sampler sampler; - Result result = static_cast( vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &sampler ) ) ); - return createResultValue( result, sampler, "vk::Device::createSampler" ); - } + ResultValueType::type createSampler( const SamplerCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSampler createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator ) const - { - vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); - } - + void destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySampler( Sampler sampler, Optional allocator = nullptr ) const - { - vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( static_cast( allocator)) ); - } + void destroySampler( Sampler sampler, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout ) const - { - return static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSetLayout ) ) ); - } - + Result createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const - { - DescriptorSetLayout setLayout; - Result result = static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &setLayout ) ) ); - return createResultValue( result, setLayout, "vk::Device::createDescriptorSetLayout" ); - } + ResultValueType::type createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDescriptorSetLayout createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator ) const - { - vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); - } - + void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator = nullptr ) const - { - vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool ) const - { - return static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorPool ) ) ); - } - + Result createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr ) const - { - DescriptorPool descriptorPool; - Result result = static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &descriptorPool ) ) ); - return createResultValue( result, descriptorPool, "vk::Device::createDescriptorPool" ); - } + ResultValueType::type createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDescriptorPool createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator ) const - { - vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); - } - + void destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator = nullptr ) const - { - vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const - { - return static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags = DescriptorPoolResetFlags() ) const - { - Result result = static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); - return createResultValue( result, "vk::Device::resetDescriptorPool" ); - } + Result resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const; +#else + ResultValueType::type resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags = DescriptorPoolResetFlags() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets ) const - { - return static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pDescriptorSets ) ) ); - } - + Result allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo ) const - { - std::vector descriptorSets( allocateInfo.descriptorSetCount ); - Result result = static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ) ); - return createResultValue( result, descriptorSets, "vk::Device::allocateDescriptorSets" ); - } + template > + typename ResultValueType>::type allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template > + std::vector allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets ) const - { - return static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); - } - + Result freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets ) const - { - Result result = static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSets.size() , reinterpret_cast( descriptorSets.data() ) ) ); - return createResultValue( result, "vk::Device::freeDescriptorSets" ); - } + ResultValueType::type freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const - { - vkUpdateDescriptorSets( m_device, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ), descriptorCopyCount, reinterpret_cast( pDescriptorCopies ) ); - } - + void updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies ) const - { - vkUpdateDescriptorSets( m_device, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ), descriptorCopies.size() , reinterpret_cast( descriptorCopies.data() ) ); - } + void updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const - { - return static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFramebuffer ) ) ); - } - + Result createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Framebuffer framebuffer; - Result result = static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &framebuffer ) ) ); - return createResultValue( result, framebuffer, "vk::Device::createFramebuffer" ); - } + ResultValueType::type createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueFramebuffer createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator ) const - { - vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); - } - + void destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyFramebuffer( Framebuffer framebuffer, Optional allocator = nullptr ) const - { - vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyFramebuffer( Framebuffer framebuffer, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass ) const - { - return static_cast( vkCreateRenderPass( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pRenderPass ) ) ); - } - + Result createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr ) const - { - RenderPass renderPass; - Result result = static_cast( vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &renderPass ) ) ); - return createResultValue( result, renderPass, "vk::Device::createRenderPass" ); - } + ResultValueType::type createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueRenderPass createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator ) const - { - vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); - } - + void destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyRenderPass( RenderPass renderPass, Optional allocator = nullptr ) const - { - vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyRenderPass( RenderPass renderPass, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity ) const - { - vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( pGranularity ) ); - } - + void getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - Extent2D getRenderAreaGranularity( RenderPass renderPass ) const - { - Extent2D granularity; - vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( &granularity ) ); - return granularity; - } + Extent2D getRenderAreaGranularity( RenderPass renderPass ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool ) const - { - return static_cast( vkCreateCommandPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCommandPool ) ) ); - } - + Result createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr ) const - { - CommandPool commandPool; - Result result = static_cast( vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &commandPool ) ) ); - return createResultValue( result, commandPool, "vk::Device::createCommandPool" ); - } + ResultValueType::type createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueCommandPool createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator ) const - { - vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); - } - + void destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyCommandPool( CommandPool commandPool, Optional allocator = nullptr ) const - { - vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator)) ); - } + void destroyCommandPool( CommandPool commandPool, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const - { - return static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const - { - Result result = static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); - return createResultValue( result, "vk::Device::resetCommandPool" ); - } + Result resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const; +#else + ResultValueType::type resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers ) const - { - return static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pCommandBuffers ) ) ); - } - + Result allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo ) const - { - std::vector commandBuffers( allocateInfo.commandBufferCount ); - Result result = static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ) ); - return createResultValue( result, commandBuffers, "vk::Device::allocateCommandBuffers" ); - } + template > + typename ResultValueType>::type allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template > + std::vector allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const - { - vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); - } - + void freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers ) const - { - vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); - } + void freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const - { - return static_cast( vkCreateSharedSwapchainsKHR( m_device, swapchainCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchains ) ) ); - } - + Result createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator = nullptr ) const - { - std::vector swapchains( createInfos.size() ); - Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( swapchains.data() ) ) ); - return createResultValue( result, swapchains, "vk::Device::createSharedSwapchainsKHR" ); - } - - ResultValueType::type createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SwapchainKHR swapchain; - Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &swapchain ) ) ); - return createResultValue( result, swapchain, "vk::Device::createSharedSwapchainKHR" ); - } + template > + typename ResultValueType>::type createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator = nullptr ) const; + ResultValueType::type createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template > + std::vector createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator = nullptr ) const; + UniqueSwapchainKHR createSharedSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const - { - return static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchain ) ) ); - } - + Result createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SwapchainKHR swapchain; - Result result = static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &swapchain ) ) ); - return createResultValue( result, swapchain, "vk::Device::createSwapchainKHR" ); - } + ResultValueType::type createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSwapchainKHR createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator ) const - { - vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); - } - + void destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator = nullptr ) const - { - vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( static_cast( allocator)) ); - } + void destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages ) const - { - return static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); - } - + Result getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSwapchainImagesKHR( SwapchainKHR swapchain ) const - { - std::vector swapchainImages; - uint32_t swapchainImageCount; - Result result; - do - { - result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && swapchainImageCount ) - { - swapchainImages.resize( swapchainImageCount ); - result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( swapchainImageCount <= swapchainImages.size() ); - swapchainImages.resize( swapchainImageCount ); - return createResultValue( result, swapchainImages, "vk::Device::getSwapchainImagesKHR" ); - } + template > + typename ResultValueType>::type getSwapchainImagesKHR( SwapchainKHR swapchain ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex ) const - { - return static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), pImageIndex ) ); - } - + Result acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValue acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence ) const - { - uint32_t imageIndex; - Result result = static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), &imageIndex ) ); - return createResultValue( result, imageIndex, "vk::Device::acquireNextImageKHR", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); - } + ResultValue acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result debugMarkerSetObjectNameEXT( DebugMarkerObjectNameInfoEXT* pNameInfo ) const - { - return static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); - } - + Result debugMarkerSetObjectNameEXT( DebugMarkerObjectNameInfoEXT* pNameInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type debugMarkerSetObjectNameEXT() const - { - DebugMarkerObjectNameInfoEXT nameInfo; - Result result = static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ) ); - return createResultValue( result, nameInfo, "vk::Device::debugMarkerSetObjectNameEXT" ); - } + ResultValueType::type debugMarkerSetObjectNameEXT() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result debugMarkerSetObjectTagEXT( DebugMarkerObjectTagInfoEXT* pTagInfo ) const - { - return static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); - } - + Result debugMarkerSetObjectTagEXT( DebugMarkerObjectTagInfoEXT* pTagInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type debugMarkerSetObjectTagEXT() const - { - DebugMarkerObjectTagInfoEXT tagInfo; - Result result = static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ) ); - return createResultValue( result, tagInfo, "vk::Device::debugMarkerSetObjectTagEXT" ); - } + ResultValueType::type debugMarkerSetObjectTagEXT() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WIN32_KHR - Result getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const - { - return static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); - } + Result getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WIN32_KHR*/ + Result createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WIN32_KHR - ResultValueType::type getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType ) const - { - HANDLE handle; - Result result = static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), &handle ) ); - return createResultValue( result, handle, "vk::Device::getMemoryWin32HandleNV" ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + ResultValueType::type createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueIndirectCommandsLayoutNVX createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const - { - return static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pIndirectCommandsLayout ) ) ); - } - + void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator = nullptr ) const - { - IndirectCommandsLayoutNVX indirectCommandsLayout; - Result result = static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &indirectCommandsLayout ) ) ); - return createResultValue( result, indirectCommandsLayout, "vk::Device::createIndirectCommandsLayoutNVX" ); - } + void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator ) const - { - vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); - } - + Result createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator = nullptr ) const - { - vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( static_cast( allocator)) ); - } + ResultValueType::type createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueObjectTableNVX createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable ) const - { - return static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pObjectTable ) ) ); - } - + void destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator = nullptr ) const - { - ObjectTableNVX objectTable; - Result result = static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &objectTable ) ) ); - return createResultValue( result, objectTable, "vk::Device::createObjectTableNVX" ); - } + void destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator ) const - { - vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( pAllocator ) ); - } - + Result registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator = nullptr ) const - { - vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( static_cast( allocator)) ); - } + ResultValueType::type registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const - { - return static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( ppObjectTableEntries ), pObjectIndices ) ); - } - + Result unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices ) const - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( pObjectTableEntries.size() == objectIndices.size() ); -#else - if ( pObjectTableEntries.size() != objectIndices.size() ) - { - throw std::logic_error( "vk::Device::registerObjectsNVX: pObjectTableEntries.size() != objectIndices.size()" ); - } -#endif // VULKAN_HPP_NO_EXCEPTIONS - Result result = static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), pObjectTableEntries.size() , reinterpret_cast( pObjectTableEntries.data() ), objectIndices.data() ) ); - return createResultValue( result, "vk::Device::registerObjectsNVX" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const - { - return static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( pObjectEntryTypes ), pObjectIndices ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices ) const - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( objectEntryTypes.size() == objectIndices.size() ); -#else - if ( objectEntryTypes.size() != objectIndices.size() ) - { - throw std::logic_error( "vk::Device::unregisterObjectsNVX: objectEntryTypes.size() != objectIndices.size()" ); - } -#endif // VULKAN_HPP_NO_EXCEPTIONS - Result result = static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectEntryTypes.size() , reinterpret_cast( objectEntryTypes.data() ), objectIndices.data() ) ); - return createResultValue( result, "vk::Device::unregisterObjectsNVX" ); - } + ResultValueType::type unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const - { - vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags = CommandPoolTrimFlagsKHR() ) const - { - vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); - } + void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const; +#else + void trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags = CommandPoolTrimFlagsKHR() ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const - { - return static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayPowerInfo ) ) ); - } - +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const - { - Result result = static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( &displayPowerInfo ) ) ); - return createResultValue( result, "vk::Device::displayPowerControlEXT" ); - } + ResultValueType::type getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, MemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + Result getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const - { - return static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( pDeviceEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); - } - + Result getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, MemoryFdPropertiesKHX* pMemoryFdProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, const AllocationCallbacks & allocator ) const - { - Fence fence; - Result result = static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( &deviceEventInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "vk::Device::registerEventEXT" ); - } + ResultValueType::type getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const - { - return static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); - } - +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, const AllocationCallbacks & allocator ) const - { - Fence fence; - Result result = static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( &displayEventInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &fence ) ) ); - return createResultValue( result, fence, "vk::Device::registerDisplayEventEXT" ); - } + ResultValueType::type getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + Result importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX & importSemaphoreWin32HandleInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + Result getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const - { - return static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), pCounterValue ) ); - } - + Result importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValue getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const - { - uint64_t counterValue; - Result result = static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), &counterValue ) ); - return createResultValue( result, counterValue, "vk::Device::getSwapchainCounterEXT", { Result::eSuccess, Result::eErrorDeviceLost, Result::eErrorOutOfDateKHR } ); - } + ResultValueType::type importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX & importSemaphoreFdInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkDevice() const + Result displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, const AllocationCallbacks & allocator ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, const AllocationCallbacks & allocator ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValue getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PeerMemoryFeatureFlagsKHX getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result bindBufferMemory2KHX( uint32_t bindInfoCount, const BindBufferMemoryInfoKHX* pBindInfos ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type bindBufferMemory2KHX( ArrayProxy bindInfos ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result bindImageMemory2KHX( uint32_t bindInfoCount, const BindImageMemoryInfoKHX* pBindInfos ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type bindImageMemory2KHX( ArrayProxy bindInfos ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getGroupPresentCapabilitiesKHX() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValue acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDescriptorUpdateTemplateKHR createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const; + + void setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + typename ResultValueType>::type getPastPresentationTimingGOOGLE( SwapchainKHR swapchain ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDevice() const { return m_device; } @@ -20019,6 +23611,2138 @@ namespace vk }; static_assert( sizeof( Device ) == sizeof( VkDevice ), "handle and wrapper have different size!" ); +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class BufferDeleter + { + public: + BufferDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Buffer buffer ) + { + m_device.destroyBuffer( buffer, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class BufferViewDeleter + { + public: + BufferViewDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( BufferView bufferView ) + { + m_device.destroyBufferView( bufferView, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class CommandBufferDeleter + { + public: + CommandBufferDeleter( Device device = Device(), CommandPool commandPool = CommandPool() ) + : m_device( device ) + , m_commandPool( commandPool ) + {} + + void operator()( CommandBuffer commandBuffer ) + { + m_device.freeCommandBuffers( m_commandPool, commandBuffer ); + } + + private: + Device m_device; + CommandPool m_commandPool; + }; + + class CommandPoolDeleter + { + public: + CommandPoolDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( CommandPool commandPool ) + { + m_device.destroyCommandPool( commandPool, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class DescriptorPoolDeleter + { + public: + DescriptorPoolDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( DescriptorPool descriptorPool ) + { + m_device.destroyDescriptorPool( descriptorPool, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class DescriptorSetDeleter + { + public: + DescriptorSetDeleter( Device device = Device(), DescriptorPool descriptorPool = DescriptorPool() ) + : m_device( device ) + , m_descriptorPool( descriptorPool ) + {} + + void operator()( DescriptorSet descriptorSet ) + { + m_device.freeDescriptorSets( m_descriptorPool, descriptorSet ); + } + + private: + Device m_device; + DescriptorPool m_descriptorPool; + }; + + class DescriptorSetLayoutDeleter + { + public: + DescriptorSetLayoutDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( DescriptorSetLayout descriptorSetLayout ) + { + m_device.destroyDescriptorSetLayout( descriptorSetLayout, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class DescriptorUpdateTemplateKHRDeleter + { + public: + DescriptorUpdateTemplateKHRDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( DescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR ) + { + m_device.destroyDescriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class DeviceMemoryDeleter + { + public: + DeviceMemoryDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( DeviceMemory deviceMemory ) + { + m_device.freeMemory( deviceMemory, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class EventDeleter + { + public: + EventDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Event event ) + { + m_device.destroyEvent( event, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class FenceDeleter + { + public: + FenceDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Fence fence ) + { + m_device.destroyFence( fence, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class FramebufferDeleter + { + public: + FramebufferDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Framebuffer framebuffer ) + { + m_device.destroyFramebuffer( framebuffer, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class ImageDeleter + { + public: + ImageDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Image image ) + { + m_device.destroyImage( image, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class ImageViewDeleter + { + public: + ImageViewDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( ImageView imageView ) + { + m_device.destroyImageView( imageView, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class IndirectCommandsLayoutNVXDeleter + { + public: + IndirectCommandsLayoutNVXDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( IndirectCommandsLayoutNVX indirectCommandsLayoutNVX ) + { + m_device.destroyIndirectCommandsLayoutNVX( indirectCommandsLayoutNVX, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class ObjectTableNVXDeleter + { + public: + ObjectTableNVXDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( ObjectTableNVX objectTableNVX ) + { + m_device.destroyObjectTableNVX( objectTableNVX, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class PipelineDeleter + { + public: + PipelineDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Pipeline pipeline ) + { + m_device.destroyPipeline( pipeline, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class PipelineCacheDeleter + { + public: + PipelineCacheDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( PipelineCache pipelineCache ) + { + m_device.destroyPipelineCache( pipelineCache, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class PipelineLayoutDeleter + { + public: + PipelineLayoutDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( PipelineLayout pipelineLayout ) + { + m_device.destroyPipelineLayout( pipelineLayout, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class QueryPoolDeleter + { + public: + QueryPoolDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( QueryPool queryPool ) + { + m_device.destroyQueryPool( queryPool, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class RenderPassDeleter + { + public: + RenderPassDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( RenderPass renderPass ) + { + m_device.destroyRenderPass( renderPass, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class SamplerDeleter + { + public: + SamplerDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Sampler sampler ) + { + m_device.destroySampler( sampler, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class SemaphoreDeleter + { + public: + SemaphoreDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( Semaphore semaphore ) + { + m_device.destroySemaphore( semaphore, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class ShaderModuleDeleter + { + public: + ShaderModuleDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( ShaderModule shaderModule ) + { + m_device.destroyShaderModule( shaderModule, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; + + class SwapchainKHRDeleter + { + public: + SwapchainKHRDeleter( Device device = Device(), Optional allocator = nullptr ) + : m_device( device ) + , m_allocator( allocator ) + {} + + void operator()( SwapchainKHR swapchainKHR ) + { + m_device.destroySwapchainKHR( swapchainKHR, m_allocator ); + } + + private: + Device m_device; + Optional m_allocator; + }; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + + VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const char* pName ) const + { + return vkGetDeviceProcAddr( m_device, pName ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const std::string & name ) const + { + return vkGetDeviceProcAddr( m_device, name.c_str() ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroy( const AllocationCallbacks* pAllocator ) const + { + vkDestroyDevice( m_device, reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroy( Optional allocator ) const + { + vkDestroyDevice( m_device, reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Queue* pQueue ) const + { + vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( pQueue ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Queue Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const + { + Queue queue; + vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( &queue ) ); + return queue; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::waitIdle() const + { + return static_cast( vkDeviceWaitIdle( m_device ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::waitIdle() const + { + Result result = static_cast( vkDeviceWaitIdle( m_device ) ); + return createResultValue( result, "vk::Device::waitIdle" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::allocateMemory( const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory ) const + { + return static_cast( vkAllocateMemory( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMemory ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::allocateMemory( const MemoryAllocateInfo & allocateInfo, Optional allocator ) const + { + DeviceMemory memory; + Result result = static_cast( vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &memory ) ) ); + return createResultValue( result, memory, "vk::Device::allocateMemory" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDeviceMemory Device::allocateMemoryUnique( const MemoryAllocateInfo & allocateInfo, Optional allocator ) const + { + DeviceMemoryDeleter deleter( *this, allocator ); + return UniqueDeviceMemory( allocateMemory( allocateInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, const AllocationCallbacks* pAllocator ) const + { + vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::freeMemory( DeviceMemory memory, Optional allocator ) const + { + vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags, void** ppData ) const + { + return static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), ppData ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::mapMemory( DeviceMemory memory, DeviceSize offset, DeviceSize size, MemoryMapFlags flags ) const + { + void* pData; + Result result = static_cast( vkMapMemory( m_device, static_cast( memory ), offset, size, static_cast( flags ), &pData ) ); + return createResultValue( result, pData, "vk::Device::mapMemory" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::unmapMemory( DeviceMemory memory ) const + { + vkUnmapMemory( m_device, static_cast( memory ) ); + } + + VULKAN_HPP_INLINE Result Device::flushMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const + { + return static_cast( vkFlushMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::flushMappedMemoryRanges( ArrayProxy memoryRanges ) const + { + Result result = static_cast( vkFlushMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); + return createResultValue( result, "vk::Device::flushMappedMemoryRanges" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::invalidateMappedMemoryRanges( uint32_t memoryRangeCount, const MappedMemoryRange* pMemoryRanges ) const + { + return static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::invalidateMappedMemoryRanges( ArrayProxy memoryRanges ) const + { + Result result = static_cast( vkInvalidateMappedMemoryRanges( m_device, memoryRanges.size() , reinterpret_cast( memoryRanges.data() ) ) ); + return createResultValue( result, "vk::Device::invalidateMappedMemoryRanges" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getMemoryCommitment( DeviceMemory memory, DeviceSize* pCommittedMemoryInBytes ) const + { + vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), pCommittedMemoryInBytes ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE DeviceSize Device::getMemoryCommitment( DeviceMemory memory ) const + { + DeviceSize committedMemoryInBytes; + vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), &committedMemoryInBytes ); + return committedMemoryInBytes; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements( Buffer buffer, MemoryRequirements* pMemoryRequirements ) const + { + vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( pMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE MemoryRequirements Device::getBufferMemoryRequirements( Buffer buffer ) const + { + MemoryRequirements memoryRequirements; + vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( &memoryRequirements ) ); + return memoryRequirements; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const + { + return static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory( Buffer buffer, DeviceMemory memory, DeviceSize memoryOffset ) const + { + Result result = static_cast( vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), memoryOffset ) ); + return createResultValue( result, "vk::Device::bindBufferMemory" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getImageMemoryRequirements( Image image, MemoryRequirements* pMemoryRequirements ) const + { + vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( pMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE MemoryRequirements Device::getImageMemoryRequirements( Image image ) const + { + MemoryRequirements memoryRequirements; + vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( &memoryRequirements ) ); + return memoryRequirements; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const + { + return static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory( Image image, DeviceMemory memory, DeviceSize memoryOffset ) const + { + Result result = static_cast( vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), memoryOffset ) ); + return createResultValue( result, "vk::Device::bindImageMemory" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements( Image image, uint32_t* pSparseMemoryRequirementCount, SparseImageMemoryRequirements* pSparseMemoryRequirements ) const + { + vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), pSparseMemoryRequirementCount, reinterpret_cast( pSparseMemoryRequirements ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector Device::getImageSparseMemoryRequirements( Image image ) const + { + std::vector sparseMemoryRequirements; + uint32_t sparseMemoryRequirementCount; + vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); + sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); + vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, reinterpret_cast( sparseMemoryRequirements.data() ) ); + return sparseMemoryRequirements; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createFence( const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + { + return static_cast( vkCreateFence( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createFence( const FenceCreateInfo & createInfo, Optional allocator ) const + { + Fence fence; + Result result = static_cast( vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, "vk::Device::createFence" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueFence Device::createFenceUnique( const FenceCreateInfo & createInfo, Optional allocator ) const + { + FenceDeleter deleter( *this, allocator ); + return UniqueFence( createFence( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, const AllocationCallbacks* pAllocator ) const + { + vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyFence( Fence fence, Optional allocator ) const + { + vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::resetFences( uint32_t fenceCount, const Fence* pFences ) const + { + return static_cast( vkResetFences( m_device, fenceCount, reinterpret_cast( pFences ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::resetFences( ArrayProxy fences ) const + { + Result result = static_cast( vkResetFences( m_device, fences.size() , reinterpret_cast( fences.data() ) ) ); + return createResultValue( result, "vk::Device::resetFences" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence ) const + { + return static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); + } +#else + VULKAN_HPP_INLINE Result Device::getFenceStatus( Fence fence ) const + { + Result result = static_cast( vkGetFenceStatus( m_device, static_cast( fence ) ) ); + return createResultValue( result, "vk::Device::getFenceStatus", { Result::eSuccess, Result::eNotReady } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::waitForFences( uint32_t fenceCount, const Fence* pFences, Bool32 waitAll, uint64_t timeout ) const + { + return static_cast( vkWaitForFences( m_device, fenceCount, reinterpret_cast( pFences ), waitAll, timeout ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::waitForFences( ArrayProxy fences, Bool32 waitAll, uint64_t timeout ) const + { + Result result = static_cast( vkWaitForFences( m_device, fences.size() , reinterpret_cast( fences.data() ), waitAll, timeout ) ); + return createResultValue( result, "vk::Device::waitForFences", { Result::eSuccess, Result::eTimeout } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createSemaphore( const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore ) const + { + return static_cast( vkCreateSemaphore( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSemaphore ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createSemaphore( const SemaphoreCreateInfo & createInfo, Optional allocator ) const + { + Semaphore semaphore; + Result result = static_cast( vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &semaphore ) ) ); + return createResultValue( result, semaphore, "vk::Device::createSemaphore" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSemaphore Device::createSemaphoreUnique( const SemaphoreCreateInfo & createInfo, Optional allocator ) const + { + SemaphoreDeleter deleter( *this, allocator ); + return UniqueSemaphore( createSemaphore( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, const AllocationCallbacks* pAllocator ) const + { + vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroySemaphore( Semaphore semaphore, Optional allocator ) const + { + vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createEvent( const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent ) const + { + return static_cast( vkCreateEvent( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pEvent ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createEvent( const EventCreateInfo & createInfo, Optional allocator ) const + { + Event event; + Result result = static_cast( vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &event ) ) ); + return createResultValue( result, event, "vk::Device::createEvent" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueEvent Device::createEventUnique( const EventCreateInfo & createInfo, Optional allocator ) const + { + EventDeleter deleter( *this, allocator ); + return UniqueEvent( createEvent( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyEvent( Event event, const AllocationCallbacks* pAllocator ) const + { + vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyEvent( Event event, Optional allocator ) const + { + vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::getEventStatus( Event event ) const + { + return static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); + } +#else + VULKAN_HPP_INLINE Result Device::getEventStatus( Event event ) const + { + Result result = static_cast( vkGetEventStatus( m_device, static_cast( event ) ) ); + return createResultValue( result, "vk::Device::getEventStatus", { Result::eEventSet, Result::eEventReset } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::setEvent( Event event ) const + { + return static_cast( vkSetEvent( m_device, static_cast( event ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::setEvent( Event event ) const + { + Result result = static_cast( vkSetEvent( m_device, static_cast( event ) ) ); + return createResultValue( result, "vk::Device::setEvent" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::resetEvent( Event event ) const + { + return static_cast( vkResetEvent( m_device, static_cast( event ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::resetEvent( Event event ) const + { + Result result = static_cast( vkResetEvent( m_device, static_cast( event ) ) ); + return createResultValue( result, "vk::Device::resetEvent" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createQueryPool( const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool ) const + { + return static_cast( vkCreateQueryPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pQueryPool ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createQueryPool( const QueryPoolCreateInfo & createInfo, Optional allocator ) const + { + QueryPool queryPool; + Result result = static_cast( vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &queryPool ) ) ); + return createResultValue( result, queryPool, "vk::Device::createQueryPool" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueQueryPool Device::createQueryPoolUnique( const QueryPoolCreateInfo & createInfo, Optional allocator ) const + { + QueryPoolDeleter deleter( *this, allocator ); + return UniqueQueryPool( createQueryPool( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, const AllocationCallbacks* pAllocator ) const + { + vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyQueryPool( QueryPool queryPool, Optional allocator ) const + { + vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, DeviceSize stride, QueryResultFlags flags ) const + { + return static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, dataSize, pData, stride, static_cast( flags ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE Result Device::getQueryPoolResults( QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, ArrayProxy data, DeviceSize stride, QueryResultFlags flags ) const + { + Result result = static_cast( vkGetQueryPoolResults( m_device, static_cast( queryPool ), firstQuery, queryCount, data.size() * sizeof( T ) , reinterpret_cast( data.data() ), stride, static_cast( flags ) ) ); + return createResultValue( result, "vk::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createBuffer( const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer ) const + { + return static_cast( vkCreateBuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pBuffer ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createBuffer( const BufferCreateInfo & createInfo, Optional allocator ) const + { + Buffer buffer; + Result result = static_cast( vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &buffer ) ) ); + return createResultValue( result, buffer, "vk::Device::createBuffer" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueBuffer Device::createBufferUnique( const BufferCreateInfo & createInfo, Optional allocator ) const + { + BufferDeleter deleter( *this, allocator ); + return UniqueBuffer( createBuffer( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator ) const + { + vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyBuffer( Buffer buffer, Optional allocator ) const + { + vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createBufferView( const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView ) const + { + return static_cast( vkCreateBufferView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createBufferView( const BufferViewCreateInfo & createInfo, Optional allocator ) const + { + BufferView view; + Result result = static_cast( vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + return createResultValue( result, view, "vk::Device::createBufferView" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueBufferView Device::createBufferViewUnique( const BufferViewCreateInfo & createInfo, Optional allocator ) const + { + BufferViewDeleter deleter( *this, allocator ); + return UniqueBufferView( createBufferView( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, const AllocationCallbacks* pAllocator ) const + { + vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyBufferView( BufferView bufferView, Optional allocator ) const + { + vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createImage( const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage ) const + { + return static_cast( vkCreateImage( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pImage ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createImage( const ImageCreateInfo & createInfo, Optional allocator ) const + { + Image image; + Result result = static_cast( vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &image ) ) ); + return createResultValue( result, image, "vk::Device::createImage" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueImage Device::createImageUnique( const ImageCreateInfo & createInfo, Optional allocator ) const + { + ImageDeleter deleter( *this, allocator ); + return UniqueImage( createImage( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyImage( Image image, const AllocationCallbacks* pAllocator ) const + { + vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyImage( Image image, Optional allocator ) const + { + vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getImageSubresourceLayout( Image image, const ImageSubresource* pSubresource, SubresourceLayout* pLayout ) const + { + vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( pSubresource ), reinterpret_cast( pLayout ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE SubresourceLayout Device::getImageSubresourceLayout( Image image, const ImageSubresource & subresource ) const + { + SubresourceLayout layout; + vkGetImageSubresourceLayout( m_device, static_cast( image ), reinterpret_cast( &subresource ), reinterpret_cast( &layout ) ); + return layout; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createImageView( const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView ) const + { + return static_cast( vkCreateImageView( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pView ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createImageView( const ImageViewCreateInfo & createInfo, Optional allocator ) const + { + ImageView view; + Result result = static_cast( vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &view ) ) ); + return createResultValue( result, view, "vk::Device::createImageView" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueImageView Device::createImageViewUnique( const ImageViewCreateInfo & createInfo, Optional allocator ) const + { + ImageViewDeleter deleter( *this, allocator ); + return UniqueImageView( createImageView( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, const AllocationCallbacks* pAllocator ) const + { + vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyImageView( ImageView imageView, Optional allocator ) const + { + vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createShaderModule( const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule ) const + { + return static_cast( vkCreateShaderModule( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pShaderModule ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createShaderModule( const ShaderModuleCreateInfo & createInfo, Optional allocator ) const + { + ShaderModule shaderModule; + Result result = static_cast( vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &shaderModule ) ) ); + return createResultValue( result, shaderModule, "vk::Device::createShaderModule" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueShaderModule Device::createShaderModuleUnique( const ShaderModuleCreateInfo & createInfo, Optional allocator ) const + { + ShaderModuleDeleter deleter( *this, allocator ); + return UniqueShaderModule( createShaderModule( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks* pAllocator ) const + { + vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyShaderModule( ShaderModule shaderModule, Optional allocator ) const + { + vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createPipelineCache( const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache ) const + { + return static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineCache ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineCache( const PipelineCacheCreateInfo & createInfo, Optional allocator ) const + { + PipelineCache pipelineCache; + Result result = static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineCache ) ) ); + return createResultValue( result, pipelineCache, "vk::Device::createPipelineCache" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniquePipelineCache Device::createPipelineCacheUnique( const PipelineCacheCreateInfo & createInfo, Optional allocator ) const + { + PipelineCacheDeleter deleter( *this, allocator ); + return UniquePipelineCache( createPipelineCache( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks* pAllocator ) const + { + vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyPipelineCache( PipelineCache pipelineCache, Optional allocator ) const + { + vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getPipelineCacheData( PipelineCache pipelineCache, size_t* pDataSize, void* pData ) const + { + return static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), pDataSize, pData ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPipelineCacheData( PipelineCache pipelineCache ) const + { + std::vector data; + size_t dataSize; + Result result; + do + { + result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ) ); + if ( ( result == Result::eSuccess ) && dataSize ) + { + data.resize( dataSize ); + result = static_cast( vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( dataSize <= data.size() ); + data.resize( dataSize ); + return createResultValue( result, data, "vk::Device::getPipelineCacheData" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::mergePipelineCaches( PipelineCache dstCache, uint32_t srcCacheCount, const PipelineCache* pSrcCaches ) const + { + return static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::mergePipelineCaches( PipelineCache dstCache, ArrayProxy srcCaches ) const + { + Result result = static_cast( vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCaches.size() , reinterpret_cast( srcCaches.data() ) ) ); + return createResultValue( result, "vk::Device::mergePipelineCaches" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createGraphicsPipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const + { + return static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createGraphicsPipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + { + std::vector pipelines( createInfos.size() ); + Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); + return createResultValue( result, pipelines, "vk::Device::createGraphicsPipelines" ); + } + VULKAN_HPP_INLINE ResultValueType::type Device::createGraphicsPipeline( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator ) const + { + Pipeline pipeline; + Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + return createResultValue( result, pipeline, "vk::Device::createGraphicsPipeline" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE std::vector Device::createGraphicsPipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + { + PipelineDeleter deleter( *this, allocator ); + std::vector pipelines = createGraphicsPipelines( pipelineCache, createInfos, allocator ); + std::vector uniquePipelines; + uniquePipelines.reserve( pipelines.size() ); + for ( auto pipeline : pipelines ) + { + uniquePipelines.push_back( UniquePipeline( pipeline, deleter ) ); + } + return uniquePipelines; + } + VULKAN_HPP_INLINE UniquePipeline Device::createGraphicsPipelineUnique( PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional allocator ) const + { + PipelineDeleter deleter( *this, allocator ); + return UniquePipeline( createGraphicsPipeline( pipelineCache, createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createComputePipelines( PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines ) const + { + return static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfoCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelines ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createComputePipelines( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + { + std::vector pipelines( createInfos.size() ); + Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( pipelines.data() ) ) ); + return createResultValue( result, pipelines, "vk::Device::createComputePipelines" ); + } + VULKAN_HPP_INLINE ResultValueType::type Device::createComputePipeline( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator ) const + { + Pipeline pipeline; + Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipeline ) ) ); + return createResultValue( result, pipeline, "vk::Device::createComputePipeline" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE std::vector Device::createComputePipelinesUnique( PipelineCache pipelineCache, ArrayProxy createInfos, Optional allocator ) const + { + PipelineDeleter deleter( *this, allocator ); + std::vector pipelines = createComputePipelines( pipelineCache, createInfos, allocator ); + std::vector uniquePipelines; + uniquePipelines.reserve( pipelines.size() ); + for ( auto pipeline : pipelines ) + { + uniquePipelines.push_back( UniquePipeline( pipeline, deleter ) ); + } + return uniquePipelines; + } + VULKAN_HPP_INLINE UniquePipeline Device::createComputePipelineUnique( PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional allocator ) const + { + PipelineDeleter deleter( *this, allocator ); + return UniquePipeline( createComputePipeline( pipelineCache, createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, const AllocationCallbacks* pAllocator ) const + { + vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyPipeline( Pipeline pipeline, Optional allocator ) const + { + vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createPipelineLayout( const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout ) const + { + return static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pPipelineLayout ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createPipelineLayout( const PipelineLayoutCreateInfo & createInfo, Optional allocator ) const + { + PipelineLayout pipelineLayout; + Result result = static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &pipelineLayout ) ) ); + return createResultValue( result, pipelineLayout, "vk::Device::createPipelineLayout" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniquePipelineLayout Device::createPipelineLayoutUnique( const PipelineLayoutCreateInfo & createInfo, Optional allocator ) const + { + PipelineLayoutDeleter deleter( *this, allocator ); + return UniquePipelineLayout( createPipelineLayout( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator ) const + { + vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyPipelineLayout( PipelineLayout pipelineLayout, Optional allocator ) const + { + vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createSampler( const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler ) const + { + return static_cast( vkCreateSampler( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSampler ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createSampler( const SamplerCreateInfo & createInfo, Optional allocator ) const + { + Sampler sampler; + Result result = static_cast( vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &sampler ) ) ); + return createResultValue( result, sampler, "vk::Device::createSampler" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSampler Device::createSamplerUnique( const SamplerCreateInfo & createInfo, Optional allocator ) const + { + SamplerDeleter deleter( *this, allocator ); + return UniqueSampler( createSampler( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, const AllocationCallbacks* pAllocator ) const + { + vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroySampler( Sampler sampler, Optional allocator ) const + { + vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorSetLayout* pSetLayout ) const + { + return static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSetLayout ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator ) const + { + DescriptorSetLayout setLayout; + Result result = static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &setLayout ) ) ); + return createResultValue( result, setLayout, "vk::Device::createDescriptorSetLayout" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDescriptorSetLayout Device::createDescriptorSetLayoutUnique( const DescriptorSetLayoutCreateInfo & createInfo, Optional allocator ) const + { + DescriptorSetLayoutDeleter deleter( *this, allocator ); + return UniqueDescriptorSetLayout( createDescriptorSetLayout( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks* pAllocator ) const + { + vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, Optional allocator ) const + { + vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createDescriptorPool( const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool ) const + { + return static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorPool ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorPool( const DescriptorPoolCreateInfo & createInfo, Optional allocator ) const + { + DescriptorPool descriptorPool; + Result result = static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorPool ) ) ); + return createResultValue( result, descriptorPool, "vk::Device::createDescriptorPool" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDescriptorPool Device::createDescriptorPoolUnique( const DescriptorPoolCreateInfo & createInfo, Optional allocator ) const + { + DescriptorPoolDeleter deleter( *this, allocator ); + return UniqueDescriptorPool( createDescriptorPool( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator ) const + { + vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyDescriptorPool( DescriptorPool descriptorPool, Optional allocator ) const + { + vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const + { + return static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::resetDescriptorPool( DescriptorPool descriptorPool, DescriptorPoolResetFlags flags ) const + { + Result result = static_cast( vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); + return createResultValue( result, "vk::Device::resetDescriptorPool" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::allocateDescriptorSets( const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets ) const + { + return static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pDescriptorSets ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateDescriptorSets( const DescriptorSetAllocateInfo & allocateInfo ) const + { + std::vector descriptorSets( allocateInfo.descriptorSetCount ); + Result result = static_cast( vkAllocateDescriptorSets( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ) ); + return createResultValue( result, descriptorSets, "vk::Device::allocateDescriptorSets" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE std::vector Device::allocateDescriptorSetsUnique( const DescriptorSetAllocateInfo & allocateInfo ) const + { + DescriptorSetDeleter deleter( *this, allocateInfo.descriptorPool ); + std::vector descriptorSets = allocateDescriptorSets( allocateInfo ); + std::vector uniqueDescriptorSets; + uniqueDescriptorSets.reserve( descriptorSets.size() ); + for ( auto descriptorSet : descriptorSets ) + { + uniqueDescriptorSets.push_back( UniqueDescriptorSet( descriptorSet, deleter ) ); + } + return uniqueDescriptorSets; + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::freeDescriptorSets( DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets ) const + { + return static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::freeDescriptorSets( DescriptorPool descriptorPool, ArrayProxy descriptorSets ) const + { + Result result = static_cast( vkFreeDescriptorSets( m_device, static_cast( descriptorPool ), descriptorSets.size() , reinterpret_cast( descriptorSets.data() ) ) ); + return createResultValue( result, "vk::Device::freeDescriptorSets" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::updateDescriptorSets( uint32_t descriptorWriteCount, const WriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const CopyDescriptorSet* pDescriptorCopies ) const + { + vkUpdateDescriptorSets( m_device, descriptorWriteCount, reinterpret_cast( pDescriptorWrites ), descriptorCopyCount, reinterpret_cast( pDescriptorCopies ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::updateDescriptorSets( ArrayProxy descriptorWrites, ArrayProxy descriptorCopies ) const + { + vkUpdateDescriptorSets( m_device, descriptorWrites.size() , reinterpret_cast( descriptorWrites.data() ), descriptorCopies.size() , reinterpret_cast( descriptorCopies.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createFramebuffer( const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer ) const + { + return static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFramebuffer ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createFramebuffer( const FramebufferCreateInfo & createInfo, Optional allocator ) const + { + Framebuffer framebuffer; + Result result = static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &framebuffer ) ) ); + return createResultValue( result, framebuffer, "vk::Device::createFramebuffer" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueFramebuffer Device::createFramebufferUnique( const FramebufferCreateInfo & createInfo, Optional allocator ) const + { + FramebufferDeleter deleter( *this, allocator ); + return UniqueFramebuffer( createFramebuffer( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks* pAllocator ) const + { + vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyFramebuffer( Framebuffer framebuffer, Optional allocator ) const + { + vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createRenderPass( const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass ) const + { + return static_cast( vkCreateRenderPass( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pRenderPass ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createRenderPass( const RenderPassCreateInfo & createInfo, Optional allocator ) const + { + RenderPass renderPass; + Result result = static_cast( vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &renderPass ) ) ); + return createResultValue( result, renderPass, "vk::Device::createRenderPass" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueRenderPass Device::createRenderPassUnique( const RenderPassCreateInfo & createInfo, Optional allocator ) const + { + RenderPassDeleter deleter( *this, allocator ); + return UniqueRenderPass( createRenderPass( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, const AllocationCallbacks* pAllocator ) const + { + vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyRenderPass( RenderPass renderPass, Optional allocator ) const + { + vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getRenderAreaGranularity( RenderPass renderPass, Extent2D* pGranularity ) const + { + vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( pGranularity ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Extent2D Device::getRenderAreaGranularity( RenderPass renderPass ) const + { + Extent2D granularity; + vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( &granularity ) ); + return granularity; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createCommandPool( const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool ) const + { + return static_cast( vkCreateCommandPool( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCommandPool ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createCommandPool( const CommandPoolCreateInfo & createInfo, Optional allocator ) const + { + CommandPool commandPool; + Result result = static_cast( vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &commandPool ) ) ); + return createResultValue( result, commandPool, "vk::Device::createCommandPool" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueCommandPool Device::createCommandPoolUnique( const CommandPoolCreateInfo & createInfo, Optional allocator ) const + { + CommandPoolDeleter deleter( *this, allocator ); + return UniqueCommandPool( createCommandPool( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, const AllocationCallbacks* pAllocator ) const + { + vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyCommandPool( CommandPool commandPool, Optional allocator ) const + { + vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const + { + return static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type Device::resetCommandPool( CommandPool commandPool, CommandPoolResetFlags flags ) const + { + Result result = static_cast( vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); + return createResultValue( result, "vk::Device::resetCommandPool" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::allocateCommandBuffers( const CommandBufferAllocateInfo* pAllocateInfo, CommandBuffer* pCommandBuffers ) const + { + return static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pCommandBuffers ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::allocateCommandBuffers( const CommandBufferAllocateInfo & allocateInfo ) const + { + std::vector commandBuffers( allocateInfo.commandBufferCount ); + Result result = static_cast( vkAllocateCommandBuffers( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ) ); + return createResultValue( result, commandBuffers, "vk::Device::allocateCommandBuffers" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE std::vector Device::allocateCommandBuffersUnique( const CommandBufferAllocateInfo & allocateInfo ) const + { + CommandBufferDeleter deleter( *this, allocateInfo.commandPool ); + std::vector commandBuffers = allocateCommandBuffers( allocateInfo ); + std::vector uniqueCommandBuffers; + uniqueCommandBuffers.reserve( commandBuffers.size() ); + for ( auto commandBuffer : commandBuffers ) + { + uniqueCommandBuffers.push_back( UniqueCommandBuffer( commandBuffer, deleter ) ); + } + return uniqueCommandBuffers; + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::freeCommandBuffers( CommandPool commandPool, uint32_t commandBufferCount, const CommandBuffer* pCommandBuffers ) const + { + vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::freeCommandBuffers( CommandPool commandPool, ArrayProxy commandBuffers ) const + { + vkFreeCommandBuffers( m_device, static_cast( commandPool ), commandBuffers.size() , reinterpret_cast( commandBuffers.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createSharedSwapchainsKHR( uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains ) const + { + return static_cast( vkCreateSharedSwapchainsKHR( m_device, swapchainCount, reinterpret_cast( pCreateInfos ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchains ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::createSharedSwapchainsKHR( ArrayProxy createInfos, Optional allocator ) const + { + std::vector swapchains( createInfos.size() ); + Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, createInfos.size() , reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( swapchains.data() ) ) ); + return createResultValue( result, swapchains, "vk::Device::createSharedSwapchainsKHR" ); + } + VULKAN_HPP_INLINE ResultValueType::type Device::createSharedSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + { + SwapchainKHR swapchain; + Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, 1 , reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + return createResultValue( result, swapchain, "vk::Device::createSharedSwapchainKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + template + VULKAN_HPP_INLINE std::vector Device::createSharedSwapchainsKHRUnique( ArrayProxy createInfos, Optional allocator ) const + { + SwapchainKHRDeleter deleter( *this, allocator ); + std::vector swapchainKHRs = createSharedSwapchainsKHR( createInfos, allocator ); + std::vector uniqueSwapchainKHRs; + uniqueSwapchainKHRs.reserve( swapchainKHRs.size() ); + for ( auto swapchainKHR : swapchainKHRs ) + { + uniqueSwapchainKHRs.push_back( UniqueSwapchainKHR( swapchainKHR, deleter ) ); + } + return uniqueSwapchainKHRs; + } + VULKAN_HPP_INLINE UniqueSwapchainKHR Device::createSharedSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + { + SwapchainKHRDeleter deleter( *this, allocator ); + return UniqueSwapchainKHR( createSharedSwapchainKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createSwapchainKHR( const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain ) const + { + return static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSwapchain ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createSwapchainKHR( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + { + SwapchainKHR swapchain; + Result result = static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &swapchain ) ) ); + return createResultValue( result, swapchain, "vk::Device::createSwapchainKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSwapchainKHR Device::createSwapchainKHRUnique( const SwapchainCreateInfoKHR & createInfo, Optional allocator ) const + { + SwapchainKHRDeleter deleter( *this, allocator ); + return UniqueSwapchainKHR( createSwapchainKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks* pAllocator ) const + { + vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroySwapchainKHR( SwapchainKHR swapchain, Optional allocator ) const + { + vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getSwapchainImagesKHR( SwapchainKHR swapchain, uint32_t* pSwapchainImageCount, Image* pSwapchainImages ) const + { + return static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getSwapchainImagesKHR( SwapchainKHR swapchain ) const + { + std::vector swapchainImages; + uint32_t swapchainImageCount; + Result result; + do + { + result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && swapchainImageCount ) + { + swapchainImages.resize( swapchainImageCount ); + result = static_cast( vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( swapchainImageCount <= swapchainImages.size() ); + swapchainImages.resize( swapchainImageCount ); + return createResultValue( result, swapchainImages, "vk::Device::getSwapchainImagesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence, uint32_t* pImageIndex ) const + { + return static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), pImageIndex ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValue Device::acquireNextImageKHR( SwapchainKHR swapchain, uint64_t timeout, Semaphore semaphore, Fence fence ) const + { + uint32_t imageIndex; + Result result = static_cast( vkAcquireNextImageKHR( m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), &imageIndex ) ); + return createResultValue( result, imageIndex, "vk::Device::acquireNextImageKHR", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectNameEXT( DebugMarkerObjectNameInfoEXT* pNameInfo ) const + { + return static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectNameEXT() const + { + DebugMarkerObjectNameInfoEXT nameInfo; + Result result = static_cast( vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ) ); + return createResultValue( result, nameInfo, "vk::Device::debugMarkerSetObjectNameEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectTagEXT( DebugMarkerObjectTagInfoEXT* pTagInfo ) const + { + return static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::debugMarkerSetObjectTagEXT() const + { + DebugMarkerObjectTagInfoEXT tagInfo; + Result result = static_cast( vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ) ); + return createResultValue( result, tagInfo, "vk::Device::debugMarkerSetObjectTagEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle ) const + { + return static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleNV( DeviceMemory memory, ExternalMemoryHandleTypeFlagsNV handleType ) const + { + HANDLE handle; + Result result = static_cast( vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), &handle ) ); + return createResultValue( result, handle, "vk::Device::getMemoryWin32HandleNV" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + + VULKAN_HPP_INLINE Result Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, IndirectCommandsLayoutNVX* pIndirectCommandsLayout ) const + { + return static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pIndirectCommandsLayout ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createIndirectCommandsLayoutNVX( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator ) const + { + IndirectCommandsLayoutNVX indirectCommandsLayout; + Result result = static_cast( vkCreateIndirectCommandsLayoutNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &indirectCommandsLayout ) ) ); + return createResultValue( result, indirectCommandsLayout, "vk::Device::createIndirectCommandsLayoutNVX" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueIndirectCommandsLayoutNVX Device::createIndirectCommandsLayoutNVXUnique( const IndirectCommandsLayoutCreateInfoNVX & createInfo, Optional allocator ) const + { + IndirectCommandsLayoutNVXDeleter deleter( *this, allocator ); + return UniqueIndirectCommandsLayoutNVX( createIndirectCommandsLayoutNVX( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, const AllocationCallbacks* pAllocator ) const + { + vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNVX( IndirectCommandsLayoutNVX indirectCommandsLayout, Optional allocator ) const + { + vkDestroyIndirectCommandsLayoutNVX( m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createObjectTableNVX( const ObjectTableCreateInfoNVX* pCreateInfo, const AllocationCallbacks* pAllocator, ObjectTableNVX* pObjectTable ) const + { + return static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pObjectTable ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createObjectTableNVX( const ObjectTableCreateInfoNVX & createInfo, Optional allocator ) const + { + ObjectTableNVX objectTable; + Result result = static_cast( vkCreateObjectTableNVX( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &objectTable ) ) ); + return createResultValue( result, objectTable, "vk::Device::createObjectTableNVX" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueObjectTableNVX Device::createObjectTableNVXUnique( const ObjectTableCreateInfoNVX & createInfo, Optional allocator ) const + { + ObjectTableNVXDeleter deleter( *this, allocator ); + return UniqueObjectTableNVX( createObjectTableNVX( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, const AllocationCallbacks* pAllocator ) const + { + vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyObjectTableNVX( ObjectTableNVX objectTable, Optional allocator ) const + { + vkDestroyObjectTableNVX( m_device, static_cast( objectTable ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::registerObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices ) const + { + return static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( ppObjectTableEntries ), pObjectIndices ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::registerObjectsNVX( ObjectTableNVX objectTable, ArrayProxy pObjectTableEntries, ArrayProxy objectIndices ) const + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + assert( pObjectTableEntries.size() == objectIndices.size() ); +#else + if ( pObjectTableEntries.size() != objectIndices.size() ) + { + throw std::logic_error( "vk::Device::registerObjectsNVX: pObjectTableEntries.size() != objectIndices.size()" ); + } +#endif // VULKAN_HPP_NO_EXCEPTIONS + Result result = static_cast( vkRegisterObjectsNVX( m_device, static_cast( objectTable ), pObjectTableEntries.size() , reinterpret_cast( pObjectTableEntries.data() ), objectIndices.data() ) ); + return createResultValue( result, "vk::Device::registerObjectsNVX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::unregisterObjectsNVX( ObjectTableNVX objectTable, uint32_t objectCount, const ObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices ) const + { + return static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectCount, reinterpret_cast( pObjectEntryTypes ), pObjectIndices ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::unregisterObjectsNVX( ObjectTableNVX objectTable, ArrayProxy objectEntryTypes, ArrayProxy objectIndices ) const + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + assert( objectEntryTypes.size() == objectIndices.size() ); +#else + if ( objectEntryTypes.size() != objectIndices.size() ) + { + throw std::logic_error( "vk::Device::unregisterObjectsNVX: objectEntryTypes.size() != objectIndices.size()" ); + } +#endif // VULKAN_HPP_NO_EXCEPTIONS + Result result = static_cast( vkUnregisterObjectsNVX( m_device, static_cast( objectTable ), objectEntryTypes.size() , reinterpret_cast( objectEntryTypes.data() ), objectIndices.data() ) ); + return createResultValue( result, "vk::Device::unregisterObjectsNVX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::trimCommandPoolKHR( CommandPool commandPool, CommandPoolTrimFlagsKHR flags ) const + { + vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); + } + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const + { + return static_cast( vkGetMemoryWin32HandleKHX( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandleKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const + { + HANDLE handle; + Result result = static_cast( vkGetMemoryWin32HandleKHX( m_device, static_cast( memory ), static_cast( handleType ), &handle ) ); + return createResultValue( result, handle, "vk::Device::getMemoryWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle, MemoryWin32HandlePropertiesKHX* pMemoryWin32HandleProperties ) const + { + return static_cast( vkGetMemoryWin32HandlePropertiesKHX( m_device, static_cast( handleType ), handle, reinterpret_cast( pMemoryWin32HandleProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryWin32HandlePropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE handle ) const + { + MemoryWin32HandlePropertiesKHX memoryWin32HandleProperties; + Result result = static_cast( vkGetMemoryWin32HandlePropertiesKHX( m_device, static_cast( handleType ), handle, reinterpret_cast( &memoryWin32HandleProperties ) ) ); + return createResultValue( result, memoryWin32HandleProperties, "vk::Device::getMemoryWin32HandlePropertiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + VULKAN_HPP_INLINE Result Device::getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType, int* pFd ) const + { + return static_cast( vkGetMemoryFdKHX( m_device, static_cast( memory ), static_cast( handleType ), pFd ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdKHX( DeviceMemory memory, ExternalMemoryHandleTypeFlagBitsKHX handleType ) const + { + int fd; + Result result = static_cast( vkGetMemoryFdKHX( m_device, static_cast( memory ), static_cast( handleType ), &fd ) ); + return createResultValue( result, fd, "vk::Device::getMemoryFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, MemoryFdPropertiesKHX* pMemoryFdProperties ) const + { + return static_cast( vkGetMemoryFdPropertiesKHX( m_device, static_cast( handleType ), fd, reinterpret_cast( pMemoryFdProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getMemoryFdPropertiesKHX( ExternalMemoryHandleTypeFlagBitsKHX handleType, int fd ) const + { + MemoryFdPropertiesKHX memoryFdProperties; + Result result = static_cast( vkGetMemoryFdPropertiesKHX( m_device, static_cast( handleType ), fd, reinterpret_cast( &memoryFdProperties ) ) ); + return createResultValue( result, memoryFdProperties, "vk::Device::getMemoryFdPropertiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE* pHandle ) const + { + return static_cast( vkGetSemaphoreWin32HandleKHX( m_device, static_cast( semaphore ), static_cast( handleType ), pHandle ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreWin32HandleKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const + { + HANDLE handle; + Result result = static_cast( vkGetSemaphoreWin32HandleKHX( m_device, static_cast( semaphore ), static_cast( handleType ), &handle ) ); + return createResultValue( result, handle, "vk::Device::getSemaphoreWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHX + VULKAN_HPP_INLINE Result Device::importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX* pImportSemaphoreWin32HandleInfo ) const + { + return static_cast( vkImportSemaphoreWin32HandleKHX( m_device, reinterpret_cast( pImportSemaphoreWin32HandleInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreWin32HandleKHX( const ImportSemaphoreWin32HandleInfoKHX & importSemaphoreWin32HandleInfo ) const + { + Result result = static_cast( vkImportSemaphoreWin32HandleKHX( m_device, reinterpret_cast( &importSemaphoreWin32HandleInfo ) ) ); + return createResultValue( result, "vk::Device::importSemaphoreWin32HandleKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHX*/ + + VULKAN_HPP_INLINE Result Device::getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType, int* pFd ) const + { + return static_cast( vkGetSemaphoreFdKHX( m_device, static_cast( semaphore ), static_cast( handleType ), pFd ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getSemaphoreFdKHX( Semaphore semaphore, ExternalSemaphoreHandleTypeFlagBitsKHX handleType ) const + { + int fd; + Result result = static_cast( vkGetSemaphoreFdKHX( m_device, static_cast( semaphore ), static_cast( handleType ), &fd ) ); + return createResultValue( result, fd, "vk::Device::getSemaphoreFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo ) const + { + return static_cast( vkImportSemaphoreFdKHX( m_device, reinterpret_cast( pImportSemaphoreFdInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::importSemaphoreFdKHX( const ImportSemaphoreFdInfoKHX & importSemaphoreFdInfo ) const + { + Result result = static_cast( vkImportSemaphoreFdKHX( m_device, reinterpret_cast( &importSemaphoreFdInfo ) ) ); + return createResultValue( result, "vk::Device::importSemaphoreFdKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT* pDisplayPowerInfo ) const + { + return static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayPowerInfo ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::displayPowerControlEXT( DisplayKHR display, const DisplayPowerInfoEXT & displayPowerInfo ) const + { + Result result = static_cast( vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( &displayPowerInfo ) ) ); + return createResultValue( result, "vk::Device::displayPowerControlEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::registerEventEXT( const DeviceEventInfoEXT* pDeviceEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + { + return static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( pDeviceEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::registerEventEXT( const DeviceEventInfoEXT & deviceEventInfo, const AllocationCallbacks & allocator ) const + { + Fence fence; + Result result = static_cast( vkRegisterDeviceEventEXT( m_device, reinterpret_cast( &deviceEventInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, "vk::Device::registerEventEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT* pDisplayEventInfo, const AllocationCallbacks* pAllocator, Fence* pFence ) const + { + return static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayEventInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pFence ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::registerDisplayEventEXT( DisplayKHR display, const DisplayEventInfoEXT & displayEventInfo, const AllocationCallbacks & allocator ) const + { + Fence fence; + Result result = static_cast( vkRegisterDisplayEventEXT( m_device, static_cast( display ), reinterpret_cast( &displayEventInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &fence ) ) ); + return createResultValue( result, fence, "vk::Device::registerDisplayEventEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue ) const + { + return static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), pCounterValue ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValue Device::getSwapchainCounterEXT( SwapchainKHR swapchain, SurfaceCounterFlagBitsEXT counter ) const + { + uint64_t counterValue; + Result result = static_cast( vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), &counterValue ) ); + return createResultValue( result, counterValue, "vk::Device::getSwapchainCounterEXT", { Result::eSuccess, Result::eErrorDeviceLost, Result::eErrorOutOfDateKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, PeerMemoryFeatureFlagsKHX* pPeerMemoryFeatures ) const + { + vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PeerMemoryFeatureFlagsKHX Device::getGroupPeerMemoryFeaturesKHX( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const + { + PeerMemoryFeatureFlagsKHX peerMemoryFeatures; + vkGetDeviceGroupPeerMemoryFeaturesKHX( m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); + return peerMemoryFeatures; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::bindBufferMemory2KHX( uint32_t bindInfoCount, const BindBufferMemoryInfoKHX* pBindInfos ) const + { + return static_cast( vkBindBufferMemory2KHX( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::bindBufferMemory2KHX( ArrayProxy bindInfos ) const + { + Result result = static_cast( vkBindBufferMemory2KHX( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, "vk::Device::bindBufferMemory2KHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::bindImageMemory2KHX( uint32_t bindInfoCount, const BindImageMemoryInfoKHX* pBindInfos ) const + { + return static_cast( vkBindImageMemory2KHX( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::bindImageMemory2KHX( ArrayProxy bindInfos ) const + { + Result result = static_cast( vkBindImageMemory2KHX( m_device, bindInfos.size() , reinterpret_cast( bindInfos.data() ) ) ); + return createResultValue( result, "vk::Device::bindImageMemory2KHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getGroupPresentCapabilitiesKHX( DeviceGroupPresentCapabilitiesKHX* pDeviceGroupPresentCapabilities ) const + { + return static_cast( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast( pDeviceGroupPresentCapabilities ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getGroupPresentCapabilitiesKHX() const + { + DeviceGroupPresentCapabilitiesKHX deviceGroupPresentCapabilities; + Result result = static_cast( vkGetDeviceGroupPresentCapabilitiesKHX( m_device, reinterpret_cast( &deviceGroupPresentCapabilities ) ) ); + return createResultValue( result, deviceGroupPresentCapabilities, "vk::Device::getGroupPresentCapabilitiesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface, DeviceGroupPresentModeFlagsKHX* pModes ) const + { + return static_cast( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast( surface ), reinterpret_cast( pModes ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getGroupSurfacePresentModesKHX( SurfaceKHR surface ) const + { + DeviceGroupPresentModeFlagsKHX modes; + Result result = static_cast( vkGetDeviceGroupSurfacePresentModesKHX( m_device, static_cast( surface ), reinterpret_cast( &modes ) ) ); + return createResultValue( result, modes, "vk::Device::getGroupSurfacePresentModesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX* pAcquireInfo, uint32_t* pImageIndex ) const + { + return static_cast( vkAcquireNextImage2KHX( m_device, reinterpret_cast( pAcquireInfo ), pImageIndex ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValue Device::acquireNextImage2KHX( const AcquireNextImageInfoKHX & acquireInfo ) const + { + uint32_t imageIndex; + Result result = static_cast( vkAcquireNextImage2KHX( m_device, reinterpret_cast( &acquireInfo ), &imageIndex ) ); + return createResultValue( result, imageIndex, "vk::Device::acquireNextImage2KHX", { Result::eSuccess, Result::eTimeout, Result::eNotReady, Result::eSuboptimalKHR } ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate ) const + { + return static_cast( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDescriptorUpdateTemplate ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::createDescriptorUpdateTemplateKHR( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator ) const + { + DescriptorUpdateTemplateKHR descriptorUpdateTemplate; + Result result = static_cast( vkCreateDescriptorUpdateTemplateKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &descriptorUpdateTemplate ) ) ); + return createResultValue( result, descriptorUpdateTemplate, "vk::Device::createDescriptorUpdateTemplateKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDescriptorUpdateTemplateKHR Device::createDescriptorUpdateTemplateKHRUnique( const DescriptorUpdateTemplateCreateInfoKHR & createInfo, Optional allocator ) const + { + DescriptorUpdateTemplateKHRDeleter deleter( *this, allocator ); + return UniqueDescriptorUpdateTemplateKHR( createDescriptorUpdateTemplateKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const AllocationCallbacks* pAllocator ) const + { + vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( DescriptorUpdateTemplateKHR descriptorUpdateTemplate, Optional allocator ) const + { + vkDestroyDescriptorUpdateTemplateKHR( m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( DescriptorSet descriptorSet, DescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void* pData ) const + { + vkUpdateDescriptorSetWithTemplateKHR( m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); + } + + VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( uint32_t swapchainCount, const SwapchainKHR* pSwapchains, const HdrMetadataEXT* pMetadata ) const + { + vkSetHdrMetadataEXT( m_device, swapchainCount, reinterpret_cast( pSwapchains ), reinterpret_cast( pMetadata ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( ArrayProxy swapchains, ArrayProxy metadata ) const + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + assert( swapchains.size() == metadata.size() ); +#else + if ( swapchains.size() != metadata.size() ) + { + throw std::logic_error( "vk::Device::setHdrMetadataEXT: swapchains.size() != metadata.size()" ); + } +#endif // VULKAN_HPP_NO_EXCEPTIONS + vkSetHdrMetadataEXT( m_device, swapchains.size() , reinterpret_cast( swapchains.data() ), reinterpret_cast( metadata.data() ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain, RefreshCycleDurationGOOGLE* pDisplayTimingProperties ) const + { + return static_cast( vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( pDisplayTimingProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Device::getRefreshCycleDurationGOOGLE( SwapchainKHR swapchain ) const + { + RefreshCycleDurationGOOGLE displayTimingProperties; + Result result = static_cast( vkGetRefreshCycleDurationGOOGLE( m_device, static_cast( swapchain ), reinterpret_cast( &displayTimingProperties ) ) ); + return createResultValue( result, displayTimingProperties, "vk::Device::getRefreshCycleDurationGOOGLE" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain, uint32_t* pPresentationTimingCount, PastPresentationTimingGOOGLE* pPresentationTimings ) const + { + return static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), pPresentationTimingCount, reinterpret_cast( pPresentationTimings ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Device::getPastPresentationTimingGOOGLE( SwapchainKHR swapchain ) const + { + std::vector presentationTimings; + uint32_t presentationTimingCount; + Result result = static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && presentationTimingCount ) + { + presentationTimings.resize( presentationTimingCount ); + result = static_cast( vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, reinterpret_cast( presentationTimings.data() ) ) ); + } + return createResultValue( result, presentationTimings, "vk::Device::getPastPresentationTimingGOOGLE" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class DeviceDeleter; + using UniqueDevice = UniqueHandle; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + class PhysicalDevice { public: @@ -20026,11 +25750,15 @@ namespace vk : m_physicalDevice(VK_NULL_HANDLE) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - PhysicalDevice(VkPhysicalDevice physicalDevice) + PhysicalDevice( std::nullptr_t ) + : m_physicalDevice(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT PhysicalDevice(VkPhysicalDevice physicalDevice) : m_physicalDevice(physicalDevice) {} +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) PhysicalDevice& operator=(VkPhysicalDevice physicalDevice) { m_physicalDevice = physicalDevice; @@ -20038,6 +25766,12 @@ namespace vk } #endif + PhysicalDevice& operator=( std::nullptr_t ) + { + m_physicalDevice = VK_NULL_HANDLE; + return *this; + } + bool operator==(PhysicalDevice const &rhs) const { return m_physicalDevice == rhs.m_physicalDevice; @@ -20053,680 +25787,240 @@ namespace vk return m_physicalDevice < rhs.m_physicalDevice; } - void getProperties( PhysicalDeviceProperties* pProperties ) const - { - vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( pProperties ) ); - } - + void getProperties( PhysicalDeviceProperties* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceProperties getProperties() const - { - PhysicalDeviceProperties properties; - vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( &properties ) ); - return properties; - } + PhysicalDeviceProperties getProperties() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties ) const - { - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); - } - + void getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getQueueFamilyProperties() const - { - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - return queueFamilyProperties; - } + template > + std::vector getQueueFamilyProperties() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties ) const - { - vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); - } - + void getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceMemoryProperties getMemoryProperties() const - { - PhysicalDeviceMemoryProperties memoryProperties; - vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - return memoryProperties; - } + PhysicalDeviceMemoryProperties getMemoryProperties() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFeatures( PhysicalDeviceFeatures* pFeatures ) const - { - vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( pFeatures ) ); - } - + void getFeatures( PhysicalDeviceFeatures* pFeatures ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceFeatures getFeatures() const - { - PhysicalDeviceFeatures features; - vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( &features ) ); - return features; - } + PhysicalDeviceFeatures getFeatures() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getFormatProperties( Format format, FormatProperties* pFormatProperties ) const - { - vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); - } - + void getFormatProperties( Format format, FormatProperties* pFormatProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - FormatProperties getFormatProperties( Format format ) const - { - FormatProperties formatProperties; - vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - return formatProperties; - } + FormatProperties getFormatProperties( Format format ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties ) const - { - return static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( pImageFormatProperties ) ) ); - } - + Result getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags ) const - { - ImageFormatProperties imageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( &imageFormatProperties ) ) ); - return createResultValue( result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties" ); - } + ResultValueType::type getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice ) const - { - return static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDevice ) ) ); - } - + Result createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDevice( const DeviceCreateInfo & createInfo, Optional allocator = nullptr ) const - { - Device device; - Result result = static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &device ) ) ); - return createResultValue( result, device, "vk::PhysicalDevice::createDevice" ); - } + ResultValueType::type createDevice( const DeviceCreateInfo & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDevice createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) const - { - return static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - + Result enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateDeviceLayerProperties() const - { - std::vector properties; - uint32_t propertyCount; - Result result; - do - { - result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && propertyCount ) - { - properties.resize( propertyCount ); - result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); - properties.resize( propertyCount ); - return createResultValue( result, properties, "vk::PhysicalDevice::enumerateDeviceLayerProperties" ); - } + template > + typename ResultValueType>::type enumerateDeviceLayerProperties() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) const - { - return static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - + Result enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumerateDeviceExtensionProperties( Optional layerName = nullptr ) const - { - std::vector properties; - uint32_t propertyCount; - Result result; - do - { - result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && propertyCount ) - { - properties.resize( propertyCount ); - result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); - properties.resize( propertyCount ); - return createResultValue( result, properties, "vk::PhysicalDevice::enumerateDeviceExtensionProperties" ); - } + template > + typename ResultValueType>::type enumerateDeviceExtensionProperties( Optional layerName = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - void getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties ) const - { - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), pPropertyCount, reinterpret_cast( pProperties ) ); - } - + void getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling ) const - { - std::vector properties; - uint32_t propertyCount; - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, reinterpret_cast( properties.data() ) ); - return properties; - } + template > + std::vector getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties ) const - { - return static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - + Result getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPropertiesKHR() const - { - std::vector properties; - uint32_t propertyCount; - Result result; - do - { - result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && propertyCount ) - { - properties.resize( propertyCount ); - result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); - properties.resize( propertyCount ); - return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayPropertiesKHR" ); - } + template > + typename ResultValueType>::type getDisplayPropertiesKHR() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties ) const - { - return static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - + Result getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPlanePropertiesKHR() const - { - std::vector properties; - uint32_t propertyCount; - Result result; - do - { - result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && propertyCount ) - { - properties.resize( propertyCount ); - result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); - properties.resize( propertyCount ); - return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayPlanePropertiesKHR" ); - } + template > + typename ResultValueType>::type getDisplayPlanePropertiesKHR() const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays ) const - { - return static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); - } - + Result getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const - { - std::vector displays; - uint32_t displayCount; - Result result; - do - { - result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && displayCount ) - { - displays.resize( displayCount ); - result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( displayCount <= displays.size() ); - displays.resize( displayCount ); - return createResultValue( result, displays, "vk::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); - } + template > + typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties ) const - { - return static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - + Result getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getDisplayModePropertiesKHR( DisplayKHR display ) const - { - std::vector properties; - uint32_t propertyCount; - Result result; - do - { - result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && propertyCount ) - { - properties.resize( propertyCount ); - result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( propertyCount <= properties.size() ); - properties.resize( propertyCount ); - return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayModePropertiesKHR" ); - } + template > + typename ResultValueType>::type getDisplayModePropertiesKHR( DisplayKHR display ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode ) const - { - return static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMode ) ) ); - } - + Result createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - DisplayModeKHR mode; - Result result = static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &mode ) ) ); - return createResultValue( result, mode, "vk::PhysicalDevice::createDisplayModeKHR" ); - } + ResultValueType::type createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities ) const - { - return static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( pCapabilities ) ) ); - } - + Result getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex ) const - { - DisplayPlaneCapabilitiesKHR capabilities; - Result result = static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( &capabilities ) ) ); - return createResultValue( result, capabilities, "vk::PhysicalDevice::getDisplayPlaneCapabilitiesKHR" ); - } + ResultValueType::type getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_MIR_KHR - Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection ) const - { - return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection ); - } + Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_MIR_KHR*/ + Result getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_MIR_KHR - Bool32 getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection ) const - { - return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection ); - } -#endif /*VK_USE_PLATFORM_MIR_KHR*/ + ResultValueType::type getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported ) const - { - return static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), pSupported ) ); - } - + Result getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface ) const - { - Bool32 supported; - Result result = static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), &supported ) ); - return createResultValue( result, supported, "vk::PhysicalDevice::getSurfaceSupportKHR" ); - } + ResultValueType::type getSurfaceCapabilitiesKHR( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities ) const - { - return static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); - } - + Result getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceCapabilitiesKHR( SurfaceKHR surface ) const - { - SurfaceCapabilitiesKHR surfaceCapabilities; - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, surfaceCapabilities, "vk::PhysicalDevice::getSurfaceCapabilitiesKHR" ); - } + template > + typename ResultValueType>::type getSurfaceFormatsKHR( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats ) const - { - return static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); - } - + Result getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSurfaceFormatsKHR( SurfaceKHR surface ) const - { - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - Result result; - do - { - result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( surfaceFormatCount <= surfaceFormats.size() ); - surfaceFormats.resize( surfaceFormatCount ); - return createResultValue( result, surfaceFormats, "vk::PhysicalDevice::getSurfaceFormatsKHR" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes ) const - { - return static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), pPresentModeCount, reinterpret_cast( pPresentModes ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type getSurfacePresentModesKHR( SurfaceKHR surface ) const - { - std::vector presentModes; - uint32_t presentModeCount; - Result result; - do - { - result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( presentModeCount <= presentModes.size() ); - presentModes.resize( presentModeCount ); - return createResultValue( result, presentModes, "vk::PhysicalDevice::getSurfacePresentModesKHR" ); - } + template > + typename ResultValueType>::type getSurfacePresentModesKHR( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_WAYLAND_KHR - Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display ) const - { - return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, display ); - } + Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ +#ifdef VK_USE_PLATFORM_WIN32_KHR + Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const; +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const - { - return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &display ); - } -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + + Result getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + DeviceGeneratedCommandsLimitsNVX getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getFeatures2KHR( PhysicalDeviceFeatures2KHR* pFeatures ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PhysicalDeviceFeatures2KHR getFeatures2KHR() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getProperties2KHR( PhysicalDeviceProperties2KHR* pProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PhysicalDeviceProperties2KHR getProperties2KHR() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getFormatProperties2KHR( Format format, FormatProperties2KHR* pFormatProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + FormatProperties2KHR getFormatProperties2KHR( Format format ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, ImageFormatProperties2KHR* pImageFormatProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2KHR* pQueueFamilyProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + std::vector getQueueFamilyProperties2KHR() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2KHR* pMemoryProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PhysicalDeviceMemoryProperties2KHR getMemoryProperties2KHR() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2KHR* pProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + std::vector getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, ExternalBufferPropertiesKHX* pExternalBufferProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ExternalBufferPropertiesKHX getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX & externalBufferInfo ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ExternalSemaphorePropertiesKHX getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX & externalSemaphoreInfo ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WIN32_KHR - Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const - { - return vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WIN32_KHR - Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const - { - return vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_XLIB_KHR - Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const - { - return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, dpy, visualID ); - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XLIB_KHR - Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const - { - return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &dpy, visualID ); - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_XCB_KHR - Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const - { - return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection, visual_id ); - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XCB_KHR - Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const - { - return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection, visual_id ); - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const - { - return static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( pExternalImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType ) const - { - ExternalImageFormatPropertiesNV externalImageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( &externalImageFormatProperties ) ) ); - return createResultValue( result, externalImageFormatProperties, "vk::PhysicalDevice::getExternalImageFormatPropertiesNV" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits ) const - { - vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( pFeatures ), reinterpret_cast( pLimits ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features, DeviceGeneratedCommandsLimitsNVX & limits ) const - { - vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( &features ), reinterpret_cast( &limits ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getFeatures2KHR( PhysicalDeviceFeatures2KHR* pFeatures ) const - { - vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( pFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceFeatures2KHR getFeatures2KHR() const - { - PhysicalDeviceFeatures2KHR features; - vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); - return features; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getProperties2KHR( PhysicalDeviceProperties2KHR* pProperties ) const - { - vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceProperties2KHR getProperties2KHR() const - { - PhysicalDeviceProperties2KHR properties; - vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getFormatProperties2KHR( Format format, FormatProperties2KHR* pFormatProperties ) const - { - vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - FormatProperties2KHR getFormatProperties2KHR( Format format ) const - { - FormatProperties2KHR formatProperties; - vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - return formatProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, ImageFormatProperties2KHR* pImageFormatProperties ) const - { - return static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pImageFormatInfo ), reinterpret_cast( pImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const - { - ImageFormatProperties2KHR imageFormatProperties; - Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); - return createResultValue( result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties2KHR" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2KHR* pQueueFamilyProperties ) const - { - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getQueueFamilyProperties2KHR() const - { - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - return queueFamilyProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2KHR* pMemoryProperties ) const - { - vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PhysicalDeviceMemoryProperties2KHR getMemoryProperties2KHR() const - { - PhysicalDeviceMemoryProperties2KHR memoryProperties; - vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - return memoryProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2KHR* pProperties ) const - { - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pFormatInfo ), pPropertyCount, reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - std::vector getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const - { - std::vector properties; - uint32_t propertyCount; - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - Result releaseDisplayEXT( DisplayKHR display ) const - { - return static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); - } -#endif /*!VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type releaseDisplayEXT( DisplayKHR display ) const - { - Result result = static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); - return createResultValue( result, "vk::PhysicalDevice::releaseDisplayEXT" ); - } + Result releaseDisplayEXT( DisplayKHR display ) const; +#else + ResultValueType::type releaseDisplayEXT( DisplayKHR display ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - Result acquireXlibDisplayEXT( Display* dpy, DisplayKHR display ) const - { - return static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, dpy, static_cast( display ) ) ); - } -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - + Result acquireXlibDisplayEXT( Display* dpy, DisplayKHR display ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - ResultValueType::type acquireXlibDisplayEXT( DisplayKHR display ) const - { - Display dpy; - Result result = static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, &dpy, static_cast( display ) ) ); - return createResultValue( result, dpy, "vk::PhysicalDevice::acquireXlibDisplayEXT" ); - } -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ + ResultValueType::type acquireXlibDisplayEXT( DisplayKHR display ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - Result getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay ) const - { - return static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, dpy, rrOutput, reinterpret_cast( pDisplay ) ) ); - } + Result getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ + Result getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT - ResultValueType::type getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput, DisplayKHR & display ) const - { - Result result = static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ) ); - return createResultValue( result, "vk::PhysicalDevice::getRandROutputDisplayEXT" ); - } -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ + ResultValueType::type getSurfaceCapabilities2EXT( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - Result getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities ) const - { - return static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); - } - + Result getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type getSurfaceCapabilities2EXT( SurfaceKHR surface ) const - { - SurfaceCapabilities2EXT surfaceCapabilities; - Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); - return createResultValue( result, surfaceCapabilities, "vk::PhysicalDevice::getSurfaceCapabilities2EXT" ); - } + template > + typename ResultValueType>::type getPresentRectanglesKHX( SurfaceKHR surface ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkPhysicalDevice() const + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPhysicalDevice() const { return m_physicalDevice; } @@ -20746,311 +26040,694 @@ namespace vk }; static_assert( sizeof( PhysicalDevice ) == sizeof( VkPhysicalDevice ), "handle and wrapper have different size!" ); - class Instance +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class DeviceDeleter { public: - Instance() - : m_instance(VK_NULL_HANDLE) + DeviceDeleter( Optional allocator = nullptr ) + : m_allocator( allocator ) {} -#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) - Instance(VkInstance instance) - : m_instance(instance) - {} - - Instance& operator=(VkInstance instance) + void operator()( Device device ) { - m_instance = instance; - return *this; - } -#endif - - bool operator==(Instance const &rhs) const - { - return m_instance == rhs.m_instance; - } - - bool operator!=(Instance const &rhs) const - { - return m_instance != rhs.m_instance; - } - - bool operator<(Instance const &rhs) const - { - return m_instance < rhs.m_instance; - } - - void destroy( const AllocationCallbacks* pAllocator ) const - { - vkDestroyInstance( m_instance, reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroy( Optional allocator = nullptr ) const - { - vkDestroyInstance( m_instance, reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices ) const - { - return static_cast( vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template > - typename ResultValueType>::type enumeratePhysicalDevices() const - { - std::vector physicalDevices; - uint32_t physicalDeviceCount; - Result result; - do - { - result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); - if ( ( result == Result::eSuccess ) && physicalDeviceCount ) - { - physicalDevices.resize( physicalDeviceCount ); - result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - assert( physicalDeviceCount <= physicalDevices.size() ); - physicalDevices.resize( physicalDeviceCount ); - return createResultValue( result, physicalDevices, "vk::Instance::enumeratePhysicalDevices" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - PFN_vkVoidFunction getProcAddr( const char* pName ) const - { - return vkGetInstanceProcAddr( m_instance, pName ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - PFN_vkVoidFunction getProcAddr( const std::string & name ) const - { - return vkGetInstanceProcAddr( m_instance, name.c_str() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_ANDROID_KHR - Result createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_ANDROID_KHR - ResultValueType::type createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createAndroidSurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createDisplayPlaneSurfaceKHR" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_MIR_KHR - Result createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_MIR_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_MIR_KHR - ResultValueType::type createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createMirSurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_MIR_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator ) const - { - vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroySurfaceKHR( SurfaceKHR surface, Optional allocator = nullptr ) const - { - vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_VI_NN - Result createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_VI_NN*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_VI_NN - ResultValueType::type createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createViSurfaceNN" ); - } -#endif /*VK_USE_PLATFORM_VI_NN*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - Result createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - ResultValueType::type createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createWaylandSurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_WIN32_KHR - Result createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_WIN32_KHR - ResultValueType::type createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createWin32SurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_XLIB_KHR - Result createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XLIB_KHR - ResultValueType::type createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createXlibSurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VK_USE_PLATFORM_XCB_KHR - Result createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const - { - return static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -#ifdef VK_USE_PLATFORM_XCB_KHR - ResultValueType::type createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const - { - SurfaceKHR surface; - Result result = static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); - return createResultValue( result, surface, "vk::Instance::createXcbSurfaceKHR" ); - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - Result createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback ) const - { - return static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCallback ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - ResultValueType::type createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr ) const - { - DebugReportCallbackEXT callback; - Result result = static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &callback ) ) ); - return createResultValue( result, callback, "vk::Instance::createDebugReportCallbackEXT" ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator ) const - { - vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator = nullptr ) const - { - vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( static_cast( allocator)) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const - { - vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, pLayerPrefix, pMessage ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - assert( layerPrefix.size() == message.size() ); -#else - if ( layerPrefix.size() != message.size() ) - { - throw std::logic_error( "vk::Instance::debugReportMessageEXT: layerPrefix.size() != message.size()" ); - } -#endif // VULKAN_HPP_NO_EXCEPTIONS - vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, layerPrefix.c_str(), message.c_str() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if !defined(VULKAN_HPP_TYPESAFE_CONVERSION) - explicit -#endif - operator VkInstance() const - { - return m_instance; - } - - explicit operator bool() const - { - return m_instance != VK_NULL_HANDLE; - } - - bool operator!() const - { - return m_instance == VK_NULL_HANDLE; + device.destroy( m_allocator ); } private: - VkInstance m_instance; + Optional m_allocator; }; - static_assert( sizeof( Instance ) == sizeof( VkInstance ), "handle and wrapper have different size!" ); +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getProperties( PhysicalDeviceProperties* pProperties ) const + { + vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceProperties PhysicalDevice::getProperties() const + { + PhysicalDeviceProperties properties; + vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( &properties ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties* pQueueFamilyProperties ) const + { + vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties() const + { + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; + vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); + vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); + return queueFamilyProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties( PhysicalDeviceMemoryProperties* pMemoryProperties ) const + { + vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties PhysicalDevice::getMemoryProperties() const + { + PhysicalDeviceMemoryProperties memoryProperties; + vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); + return memoryProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getFeatures( PhysicalDeviceFeatures* pFeatures ) const + { + vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( pFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceFeatures PhysicalDevice::getFeatures() const + { + PhysicalDeviceFeatures features; + vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( &features ) ); + return features; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties( Format format, FormatProperties* pFormatProperties ) const + { + vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE FormatProperties PhysicalDevice::getFormatProperties( Format format ) const + { + FormatProperties formatProperties; + vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); + return formatProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ImageFormatProperties* pImageFormatProperties ) const + { + return static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( pImageFormatProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags ) const + { + ImageFormatProperties imageFormatProperties; + Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::createDevice( const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice ) const + { + return static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pDevice ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDevice( const DeviceCreateInfo & createInfo, Optional allocator ) const + { + Device device; + Result result = static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &device ) ) ); + return createResultValue( result, device, "vk::PhysicalDevice::createDevice" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDevice PhysicalDevice::createDeviceUnique( const DeviceCreateInfo & createInfo, Optional allocator ) const + { + DeviceDeleter deleter( allocator ); + return UniqueDevice( createDevice( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceLayerProperties( uint32_t* pPropertyCount, LayerProperties* pProperties ) const + { + return static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceLayerProperties() const + { + std::vector properties; + uint32_t propertyCount; + Result result; + do + { + result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && propertyCount ) + { + properties.resize( propertyCount ); + result = static_cast( vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + return createResultValue( result, properties, "vk::PhysicalDevice::enumerateDeviceLayerProperties" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, ExtensionProperties* pProperties ) const + { + return static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName ) const + { + std::vector properties; + uint32_t propertyCount; + Result result; + do + { + result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && propertyCount ) + { + properties.resize( propertyCount ); + result = static_cast( vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + return createResultValue( result, properties, "vk::PhysicalDevice::enumerateDeviceExtensionProperties" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling, uint32_t* pPropertyCount, SparseImageFormatProperties* pProperties ) const + { + vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), pPropertyCount, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties( Format format, ImageType type, SampleCountFlagBits samples, ImageUsageFlags usage, ImageTiling tiling ) const + { + std::vector properties; + uint32_t propertyCount; + vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, nullptr ); + properties.resize( propertyCount ); + vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( samples ), static_cast( usage ), static_cast( tiling ), &propertyCount, reinterpret_cast( properties.data() ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPropertiesKHR( uint32_t* pPropertyCount, DisplayPropertiesKHR* pProperties ) const + { + return static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPropertiesKHR() const + { + std::vector properties; + uint32_t propertyCount; + Result result; + do + { + result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && propertyCount ) + { + properties.resize( propertyCount ); + result = static_cast( vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayPropertiesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, DisplayPlanePropertiesKHR* pProperties ) const + { + return static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlanePropertiesKHR() const + { + std::vector properties; + uint32_t propertyCount; + Result result; + do + { + result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && propertyCount ) + { + properties.resize( propertyCount ); + result = static_cast( vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayPlanePropertiesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, uint32_t* pDisplayCount, DisplayKHR* pDisplays ) const + { + return static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const + { + std::vector displays; + uint32_t displayCount; + Result result; + do + { + result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && displayCount ) + { + displays.resize( displayCount ); + result = static_cast( vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( displayCount <= displays.size() ); + displays.resize( displayCount ); + return createResultValue( result, displays, "vk::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display, uint32_t* pPropertyCount, DisplayModePropertiesKHR* pProperties ) const + { + return static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayModePropertiesKHR( DisplayKHR display ) const + { + std::vector properties; + uint32_t propertyCount; + Result result; + do + { + result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && propertyCount ) + { + properties.resize( propertyCount ); + result = static_cast( vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( propertyCount <= properties.size() ); + properties.resize( propertyCount ); + return createResultValue( result, properties, "vk::PhysicalDevice::getDisplayModePropertiesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, DisplayModeKHR* pMode ) const + { + return static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pMode ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR & createInfo, Optional allocator ) const + { + DisplayModeKHR mode; + Result result = static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &mode ) ) ); + return createResultValue( result, mode, "vk::PhysicalDevice::createDisplayModeKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex, DisplayPlaneCapabilitiesKHR* pCapabilities ) const + { + return static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( pCapabilities ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getDisplayPlaneCapabilitiesKHR( DisplayModeKHR mode, uint32_t planeIndex ) const + { + DisplayPlaneCapabilitiesKHR capabilities; + Result result = static_cast( vkGetDisplayPlaneCapabilitiesKHR( m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( &capabilities ) ) ); + return createResultValue( result, capabilities, "vk::PhysicalDevice::getDisplayPlaneCapabilitiesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_MIR_KHR + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection* connection ) const + { + return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getMirPresentationSupportKHR( uint32_t queueFamilyIndex, MirConnection & connection ) const + { + return vkGetPhysicalDeviceMirPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface, Bool32* pSupported ) const + { + return static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), pSupported ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, SurfaceKHR surface ) const + { + Bool32 supported; + Result result = static_cast( vkGetPhysicalDeviceSurfaceSupportKHR( m_physicalDevice, queueFamilyIndex, static_cast( surface ), &supported ) ); + return createResultValue( result, supported, "vk::PhysicalDevice::getSurfaceSupportKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface, SurfaceCapabilitiesKHR* pSurfaceCapabilities ) const + { + return static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilitiesKHR( SurfaceKHR surface ) const + { + SurfaceCapabilitiesKHR surfaceCapabilities; + Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, surfaceCapabilities, "vk::PhysicalDevice::getSurfaceCapabilitiesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface, uint32_t* pSurfaceFormatCount, SurfaceFormatKHR* pSurfaceFormats ) const + { + return static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfaceFormatsKHR( SurfaceKHR surface ) const + { + std::vector surfaceFormats; + uint32_t surfaceFormatCount; + Result result; + do + { + result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && surfaceFormatCount ) + { + surfaceFormats.resize( surfaceFormatCount ); + result = static_cast( vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( surfaceFormatCount <= surfaceFormats.size() ); + surfaceFormats.resize( surfaceFormatCount ); + return createResultValue( result, surfaceFormats, "vk::PhysicalDevice::getSurfaceFormatsKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface, uint32_t* pPresentModeCount, PresentModeKHR* pPresentModes ) const + { + return static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), pPresentModeCount, reinterpret_cast( pPresentModes ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getSurfacePresentModesKHR( SurfaceKHR surface ) const + { + std::vector presentModes; + uint32_t presentModeCount; + Result result; + do + { + result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && presentModeCount ) + { + presentModes.resize( presentModeCount ); + result = static_cast( vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( presentModeCount <= presentModes.size() ); + presentModes.resize( presentModeCount ); + return createResultValue( result, presentModes, "vk::PhysicalDevice::getSurfacePresentModesKHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display ) const + { + return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, display ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const + { + return vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &display ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const + { + return vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ); + } +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display* dpy, VisualID visualID ) const + { + return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, dpy, visualID ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const + { + return vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &dpy, visualID ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id ) const + { + return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection, visual_id ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const + { + return vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection, visual_id ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType, ExternalImageFormatPropertiesNV* pExternalImageFormatProperties ) const + { + return static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( pExternalImageFormatProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getExternalImageFormatPropertiesNV( Format format, ImageType type, ImageTiling tiling, ImageUsageFlags usage, ImageCreateFlags flags, ExternalMemoryHandleTypeFlagsNV externalHandleType ) const + { + ExternalImageFormatPropertiesNV externalImageFormatProperties; + Result result = static_cast( vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, static_cast( format ), static_cast( type ), static_cast( tiling ), static_cast( usage ), static_cast( flags ), static_cast( externalHandleType ), reinterpret_cast( &externalImageFormatProperties ) ) ); + return createResultValue( result, externalImageFormatProperties, "vk::PhysicalDevice::getExternalImageFormatPropertiesNV" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX* pFeatures, DeviceGeneratedCommandsLimitsNVX* pLimits ) const + { + vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( pFeatures ), reinterpret_cast( pLimits ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE DeviceGeneratedCommandsLimitsNVX PhysicalDevice::getGeneratedCommandsPropertiesNVX( DeviceGeneratedCommandsFeaturesNVX & features ) const + { + DeviceGeneratedCommandsLimitsNVX limits; + vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( m_physicalDevice, reinterpret_cast( &features ), reinterpret_cast( &limits ) ); + return limits; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getFeatures2KHR( PhysicalDeviceFeatures2KHR* pFeatures ) const + { + vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( pFeatures ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceFeatures2KHR PhysicalDevice::getFeatures2KHR() const + { + PhysicalDeviceFeatures2KHR features; + vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); + return features; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getProperties2KHR( PhysicalDeviceProperties2KHR* pProperties ) const + { + vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceProperties2KHR PhysicalDevice::getProperties2KHR() const + { + PhysicalDeviceProperties2KHR properties; + vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2KHR( Format format, FormatProperties2KHR* pFormatProperties ) const + { + vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE FormatProperties2KHR PhysicalDevice::getFormatProperties2KHR( Format format ) const + { + FormatProperties2KHR formatProperties; + vkGetPhysicalDeviceFormatProperties2KHR( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); + return formatProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, ImageFormatProperties2KHR* pImageFormatProperties ) const + { + return static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pImageFormatInfo ), reinterpret_cast( pImageFormatProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getImageFormatProperties2KHR( const PhysicalDeviceImageFormatInfo2KHR & imageFormatInfo ) const + { + ImageFormatProperties2KHR imageFormatProperties; + Result result = static_cast( vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &imageFormatInfo ), reinterpret_cast( &imageFormatProperties ) ) ); + return createResultValue( result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties2KHR" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, QueueFamilyProperties2KHR* pQueueFamilyProperties ) const + { + vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2KHR() const + { + std::vector queueFamilyProperties; + uint32_t queueFamilyPropertyCount; + vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); + queueFamilyProperties.resize( queueFamilyPropertyCount ); + vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); + return queueFamilyProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2KHR( PhysicalDeviceMemoryProperties2KHR* pMemoryProperties ) const + { + vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PhysicalDeviceMemoryProperties2KHR PhysicalDevice::getMemoryProperties2KHR() const + { + PhysicalDeviceMemoryProperties2KHR memoryProperties; + vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); + return memoryProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, SparseImageFormatProperties2KHR* pProperties ) const + { + vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( pFormatInfo ), pPropertyCount, reinterpret_cast( pProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE std::vector PhysicalDevice::getSparseImageFormatProperties2KHR( const PhysicalDeviceSparseImageFormatInfo2KHR & formatInfo ) const + { + std::vector properties; + uint32_t propertyCount; + vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); + properties.resize( propertyCount ); + vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, reinterpret_cast( properties.data() ) ); + return properties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX* pExternalBufferInfo, ExternalBufferPropertiesKHX* pExternalBufferProperties ) const + { + vkGetPhysicalDeviceExternalBufferPropertiesKHX( m_physicalDevice, reinterpret_cast( pExternalBufferInfo ), reinterpret_cast( pExternalBufferProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ExternalBufferPropertiesKHX PhysicalDevice::getExternalBufferPropertiesKHX( const PhysicalDeviceExternalBufferInfoKHX & externalBufferInfo ) const + { + ExternalBufferPropertiesKHX externalBufferProperties; + vkGetPhysicalDeviceExternalBufferPropertiesKHX( m_physicalDevice, reinterpret_cast( &externalBufferInfo ), reinterpret_cast( &externalBufferProperties ) ); + return externalBufferProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void PhysicalDevice::getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo, ExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties ) const + { + vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( m_physicalDevice, reinterpret_cast( pExternalSemaphoreInfo ), reinterpret_cast( pExternalSemaphoreProperties ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ExternalSemaphorePropertiesKHX PhysicalDevice::getExternalSemaphorePropertiesKHX( const PhysicalDeviceExternalSemaphoreInfoKHX & externalSemaphoreInfo ) const + { + ExternalSemaphorePropertiesKHX externalSemaphoreProperties; + vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( m_physicalDevice, reinterpret_cast( &externalSemaphoreInfo ), reinterpret_cast( &externalSemaphoreProperties ) ); + return externalSemaphoreProperties; + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE Result PhysicalDevice::releaseDisplayEXT( DisplayKHR display ) const + { + return static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); + } +#else + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::releaseDisplayEXT( DisplayKHR display ) const + { + Result result = static_cast( vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); + return createResultValue( result, "vk::PhysicalDevice::releaseDisplayEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + VULKAN_HPP_INLINE Result PhysicalDevice::acquireXlibDisplayEXT( Display* dpy, DisplayKHR display ) const + { + return static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, dpy, static_cast( display ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::acquireXlibDisplayEXT( DisplayKHR display ) const + { + Display dpy; + Result result = static_cast( vkAcquireXlibDisplayEXT( m_physicalDevice, &dpy, static_cast( display ) ) ); + return createResultValue( result, dpy, "vk::PhysicalDevice::acquireXlibDisplayEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ + +#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT + VULKAN_HPP_INLINE Result PhysicalDevice::getRandROutputDisplayEXT( Display* dpy, RROutput rrOutput, DisplayKHR* pDisplay ) const + { + return static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, dpy, rrOutput, reinterpret_cast( pDisplay ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput ) const + { + DisplayKHR display; + Result result = static_cast( vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ) ); + return createResultValue( result, display, "vk::PhysicalDevice::getRandROutputDisplayEXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface, SurfaceCapabilities2EXT* pSurfaceCapabilities ) const + { + return static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type PhysicalDevice::getSurfaceCapabilities2EXT( SurfaceKHR surface ) const + { + SurfaceCapabilities2EXT surfaceCapabilities; + Result result = static_cast( vkGetPhysicalDeviceSurfaceCapabilities2EXT( m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ) ); + return createResultValue( result, surfaceCapabilities, "vk::PhysicalDevice::getSurfaceCapabilities2EXT" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface, uint32_t* pRectCount, Rect2D* pRects ) const + { + return static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), pRectCount, reinterpret_cast( pRects ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getPresentRectanglesKHX( SurfaceKHR surface ) const + { + std::vector rects; + uint32_t rectCount; + Result result; + do + { + result = static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), &rectCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && rectCount ) + { + rects.resize( rectCount ); + result = static_cast( vkGetPhysicalDevicePresentRectanglesKHX( m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( rectCount <= rects.size() ); + rects.resize( rectCount ); + return createResultValue( result, rects, "vk::PhysicalDevice::getPresentRectanglesKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ struct CmdProcessCommandsInfoNVX { @@ -21081,12 +26758,6 @@ namespace vk return *this; } - CmdProcessCommandsInfoNVX& setSType( StructureType sType_ ) - { - sType = sType_; - return *this; - } - CmdProcessCommandsInfoNVX& setPNext( const void* pNext_ ) { pNext = pNext_; @@ -21197,20 +26868,762 @@ namespace vk }; static_assert( sizeof( CmdProcessCommandsInfoNVX ) == sizeof( VkCmdProcessCommandsInfoNVX ), "struct and wrapper have different size!" ); + struct PhysicalDeviceGroupPropertiesKHX + { + operator const VkPhysicalDeviceGroupPropertiesKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( physicalDeviceCount == rhs.physicalDeviceCount ) + && ( memcmp( physicalDevices, rhs.physicalDevices, VK_MAX_DEVICE_GROUP_SIZE_KHX * sizeof( PhysicalDevice ) ) == 0 ) + && ( subsetAllocation == rhs.subsetAllocation ); + } + + bool operator!=( PhysicalDeviceGroupPropertiesKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + void* pNext; + uint32_t physicalDeviceCount; + PhysicalDevice physicalDevices[VK_MAX_DEVICE_GROUP_SIZE_KHX]; + Bool32 subsetAllocation; + }; + static_assert( sizeof( PhysicalDeviceGroupPropertiesKHX ) == sizeof( VkPhysicalDeviceGroupPropertiesKHX ), "struct and wrapper have different size!" ); + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class DebugReportCallbackEXTDeleter; + using UniqueDebugReportCallbackEXT = UniqueHandle; + class SurfaceKHRDeleter; + using UniqueSurfaceKHR = UniqueHandle; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + + class Instance + { + public: + Instance() + : m_instance(VK_NULL_HANDLE) + {} + + Instance( std::nullptr_t ) + : m_instance(VK_NULL_HANDLE) + {} + + VULKAN_HPP_TYPESAFE_EXPLICIT Instance(VkInstance instance) + : m_instance(instance) + {} + +#if defined(VULKAN_HPP_TYPESAFE_CONVERSION) + Instance& operator=(VkInstance instance) + { + m_instance = instance; + return *this; + } +#endif + + Instance& operator=( std::nullptr_t ) + { + m_instance = VK_NULL_HANDLE; + return *this; + } + + bool operator==(Instance const &rhs) const + { + return m_instance == rhs.m_instance; + } + + bool operator!=(Instance const &rhs) const + { + return m_instance != rhs.m_instance; + } + + bool operator<(Instance const &rhs) const + { + return m_instance < rhs.m_instance; + } + + void destroy( const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroy( Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + typename ResultValueType>::type enumeratePhysicalDevices() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + PFN_vkVoidFunction getProcAddr( const char* pName ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + PFN_vkVoidFunction getProcAddr( const std::string & name ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_ANDROID_KHR + Result createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + + Result createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_MIR_KHR + Result createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + + void destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroySurfaceKHR( SurfaceKHR surface, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_VI_NN + Result createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_VI_NN*/ + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + Result createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + Result createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + Result createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + Result createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + + Result createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueDebugReportCallbackEXT createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + void debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + Result enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template > + typename ResultValueType>::type enumeratePhysicalDeviceGroupsKHX() const; +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + Result createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + Result createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const; +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueSurfaceKHR createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator = nullptr ) const; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + + VULKAN_HPP_TYPESAFE_EXPLICIT operator VkInstance() const + { + return m_instance; + } + + explicit operator bool() const + { + return m_instance != VK_NULL_HANDLE; + } + + bool operator!() const + { + return m_instance == VK_NULL_HANDLE; + } + + private: + VkInstance m_instance; + }; + static_assert( sizeof( Instance ) == sizeof( VkInstance ), "handle and wrapper have different size!" ); + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class DebugReportCallbackEXTDeleter + { + public: + DebugReportCallbackEXTDeleter( Instance instance = Instance(), Optional allocator = nullptr ) + : m_instance( instance ) + , m_allocator( allocator ) + {} + + void operator()( DebugReportCallbackEXT debugReportCallbackEXT ) + { + m_instance.destroyDebugReportCallbackEXT( debugReportCallbackEXT, m_allocator ); + } + + private: + Instance m_instance; + Optional m_allocator; + }; + + class SurfaceKHRDeleter + { + public: + SurfaceKHRDeleter( Instance instance = Instance(), Optional allocator = nullptr ) + : m_instance( instance ) + , m_allocator( allocator ) + {} + + void operator()( SurfaceKHR surfaceKHR ) + { + m_instance.destroySurfaceKHR( surfaceKHR, m_allocator ); + } + + private: + Instance m_instance; + Optional m_allocator; + }; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + + VULKAN_HPP_INLINE void Instance::destroy( const AllocationCallbacks* pAllocator ) const + { + vkDestroyInstance( m_instance, reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Instance::destroy( Optional allocator ) const + { + vkDestroyInstance( m_instance, reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, PhysicalDevice* pPhysicalDevices ) const + { + return static_cast( vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDevices() const + { + std::vector physicalDevices; + uint32_t physicalDeviceCount; + Result result; + do + { + result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && physicalDeviceCount ) + { + physicalDevices.resize( physicalDeviceCount ); + result = static_cast( vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( physicalDeviceCount <= physicalDevices.size() ); + physicalDevices.resize( physicalDeviceCount ); + return createResultValue( result, physicalDevices, "vk::Instance::enumeratePhysicalDevices" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const char* pName ) const + { + return vkGetInstanceProcAddr( m_instance, pName ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const std::string & name ) const + { + return vkGetInstanceProcAddr( m_instance, name.c_str() ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_ANDROID_KHR + VULKAN_HPP_INLINE Result Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createAndroidSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createAndroidSurfaceKHRUnique( const AndroidSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createAndroidSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ + + VULKAN_HPP_INLINE Result Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createDisplayPlaneSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createDisplayPlaneSurfaceKHRUnique( const DisplaySurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createDisplayPlaneSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_MIR_KHR + VULKAN_HPP_INLINE Result Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createMirSurfaceKHR( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createMirSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createMirSurfaceKHRUnique( const MirSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createMirSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MIR_KHR*/ + + VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks* pAllocator ) const + { + vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( SurfaceKHR surface, Optional allocator ) const + { + vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_VI_NN + VULKAN_HPP_INLINE Result Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createViSurfaceNN( const ViSurfaceCreateInfoNN & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateViSurfaceNN( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createViSurfaceNN" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createViSurfaceNNUnique( const ViSurfaceCreateInfoNN & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createViSurfaceNN( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_VI_NN*/ + +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + VULKAN_HPP_INLINE Result Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createWaylandSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createWaylandSurfaceKHRUnique( const WaylandSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createWaylandSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ + +#ifdef VK_USE_PLATFORM_WIN32_KHR + VULKAN_HPP_INLINE Result Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createWin32SurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createWin32SurfaceKHRUnique( const Win32SurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createWin32SurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_WIN32_KHR*/ + +#ifdef VK_USE_PLATFORM_XLIB_KHR + VULKAN_HPP_INLINE Result Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createXlibSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createXlibSurfaceKHRUnique( const XlibSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createXlibSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XLIB_KHR*/ + +#ifdef VK_USE_PLATFORM_XCB_KHR + VULKAN_HPP_INLINE Result Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createXcbSurfaceKHR" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createXcbSurfaceKHRUnique( const XcbSurfaceCreateInfoKHR & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createXcbSurfaceKHR( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_XCB_KHR*/ + + VULKAN_HPP_INLINE Result Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT* pCreateInfo, const AllocationCallbacks* pAllocator, DebugReportCallbackEXT* pCallback ) const + { + return static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pCallback ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator ) const + { + DebugReportCallbackEXT callback; + Result result = static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &callback ) ) ); + return createResultValue( result, callback, "vk::Instance::createDebugReportCallbackEXT" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueDebugReportCallbackEXT Instance::createDebugReportCallbackEXTUnique( const DebugReportCallbackCreateInfoEXT & createInfo, Optional allocator ) const + { + DebugReportCallbackEXTDeleter deleter( *this, allocator ); + return UniqueDebugReportCallbackEXT( createDebugReportCallbackEXT( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks* pAllocator ) const + { + vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, Optional allocator ) const + { + vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( static_cast( allocator ) ) ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage ) const + { + vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, pLayerPrefix, pMessage ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( DebugReportFlagsEXT flags, DebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const std::string & layerPrefix, const std::string & message ) const + { +#ifdef VULKAN_HPP_NO_EXCEPTIONS + assert( layerPrefix.size() == message.size() ); +#else + if ( layerPrefix.size() != message.size() ) + { + throw std::logic_error( "vk::Instance::debugReportMessageEXT: layerPrefix.size() != message.size()" ); + } +#endif // VULKAN_HPP_NO_EXCEPTIONS + vkDebugReportMessageEXT( m_instance, static_cast( flags ), static_cast( objectType ), object, location, messageCode, layerPrefix.c_str(), message.c_str() ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + + VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDeviceGroupsKHX( uint32_t* pPhysicalDeviceGroupCount, PhysicalDeviceGroupPropertiesKHX* pPhysicalDeviceGroupProperties ) const + { + return static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + template + VULKAN_HPP_INLINE typename ResultValueType>::type Instance::enumeratePhysicalDeviceGroupsKHX() const + { + std::vector physicalDeviceGroupProperties; + uint32_t physicalDeviceGroupCount; + Result result; + do + { + result = static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, nullptr ) ); + if ( ( result == Result::eSuccess ) && physicalDeviceGroupCount ) + { + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + result = static_cast( vkEnumeratePhysicalDeviceGroupsKHX( m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ) ); + } + } while ( result == Result::eIncomplete ); + assert( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); + physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); + return createResultValue( result, physicalDeviceGroupProperties, "vk::Instance::enumeratePhysicalDeviceGroupsKHX" ); + } +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE Result Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createIOSSurfaceMVK( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateIOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createIOSSurfaceMVK" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createIOSSurfaceMVKUnique( const IOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createIOSSurfaceMVK( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE Result Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK* pCreateInfo, const AllocationCallbacks* pAllocator, SurfaceKHR* pSurface ) const + { + return static_cast( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pSurface ) ) ); + } +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + VULKAN_HPP_INLINE ResultValueType::type Instance::createMacOSSurfaceMVK( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + { + SurfaceKHR surface; + Result result = static_cast( vkCreateMacOSSurfaceMVK( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &surface ) ) ); + return createResultValue( result, surface, "vk::Instance::createMacOSSurfaceMVK" ); + } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueSurfaceKHR Instance::createMacOSSurfaceMVKUnique( const MacOSSurfaceCreateInfoMVK & createInfo, Optional allocator ) const + { + SurfaceKHRDeleter deleter( *this, allocator ); + return UniqueSurfaceKHR( createMacOSSurfaceMVK( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + + struct DeviceGroupDeviceCreateInfoKHX + { + DeviceGroupDeviceCreateInfoKHX( uint32_t physicalDeviceCount_ = 0, const PhysicalDevice* pPhysicalDevices_ = nullptr ) + : sType( StructureType::eDeviceGroupDeviceCreateInfoKHX ) + , pNext( nullptr ) + , physicalDeviceCount( physicalDeviceCount_ ) + , pPhysicalDevices( pPhysicalDevices_ ) + { + } + + DeviceGroupDeviceCreateInfoKHX( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupDeviceCreateInfoKHX) ); + } + + DeviceGroupDeviceCreateInfoKHX& operator=( VkDeviceGroupDeviceCreateInfoKHX const & rhs ) + { + memcpy( this, &rhs, sizeof(DeviceGroupDeviceCreateInfoKHX) ); + return *this; + } + + DeviceGroupDeviceCreateInfoKHX& setPNext( const void* pNext_ ) + { + pNext = pNext_; + return *this; + } + + DeviceGroupDeviceCreateInfoKHX& setPhysicalDeviceCount( uint32_t physicalDeviceCount_ ) + { + physicalDeviceCount = physicalDeviceCount_; + return *this; + } + + DeviceGroupDeviceCreateInfoKHX& setPPhysicalDevices( const PhysicalDevice* pPhysicalDevices_ ) + { + pPhysicalDevices = pPhysicalDevices_; + return *this; + } + + operator const VkDeviceGroupDeviceCreateInfoKHX&() const + { + return *reinterpret_cast(this); + } + + bool operator==( DeviceGroupDeviceCreateInfoKHX const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ) + && ( physicalDeviceCount == rhs.physicalDeviceCount ) + && ( pPhysicalDevices == rhs.pPhysicalDevices ); + } + + bool operator!=( DeviceGroupDeviceCreateInfoKHX const& rhs ) const + { + return !operator==( rhs ); + } + + private: + StructureType sType; + + public: + const void* pNext; + uint32_t physicalDeviceCount; + const PhysicalDevice* pPhysicalDevices; + }; + static_assert( sizeof( DeviceGroupDeviceCreateInfoKHX ) == sizeof( VkDeviceGroupDeviceCreateInfoKHX ), "struct and wrapper have different size!" ); + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class InstanceDeleter; + using UniqueInstance = UniqueHandle; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + + Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance ); +#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE + ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator = nullptr ); +#ifndef VULKAN_HPP_NO_SMART_HANDLE + UniqueInstance createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator = nullptr ); +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ +#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + +#ifndef VULKAN_HPP_NO_SMART_HANDLE + class InstanceDeleter + { + public: + InstanceDeleter( Optional allocator = nullptr ) + : m_allocator( allocator ) + {} + + void operator()( Instance instance ) + { + instance.destroy( m_allocator ); + } + + private: + Optional m_allocator; + }; +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ + VULKAN_HPP_INLINE Result createInstance( const InstanceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Instance* pInstance ) { return static_cast( vkCreateInstance( reinterpret_cast( pCreateInfo ), reinterpret_cast( pAllocator ), reinterpret_cast( pInstance ) ) ); } - #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - VULKAN_HPP_INLINE ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator = nullptr ) + VULKAN_HPP_INLINE ResultValueType::type createInstance( const InstanceCreateInfo & createInfo, Optional allocator ) { Instance instance; - Result result = static_cast( vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &instance ) ) ); + Result result = static_cast( vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator ) ), reinterpret_cast( &instance ) ) ); return createResultValue( result, instance, "vk::createInstance" ); } +#ifndef VULKAN_HPP_NO_SMART_HANDLE + VULKAN_HPP_INLINE UniqueInstance createInstanceUnique( const InstanceCreateInfo & createInfo, Optional allocator ) + { + InstanceDeleter deleter( allocator ); + return UniqueInstance( createInstance( createInfo, allocator ), deleter ); + } +#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + VULKAN_HPP_INLINE std::string to_string(FramebufferCreateFlagBits) { return "(void)"; @@ -21371,16 +27784,6 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlagBits) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlags) - { - return "{}"; - } - VULKAN_HPP_INLINE std::string to_string(BufferViewCreateFlagBits) { return "(void)"; @@ -21471,16 +27874,6 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlagBits) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlags) - { - return "{}"; - } - VULKAN_HPP_INLINE std::string to_string(DescriptorPoolResetFlagBits) { return "(void)"; @@ -21491,12 +27884,12 @@ namespace vk return "{}"; } - VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagBitsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagBitsKHR) { return "(void)"; } - VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagsKHR) + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateCreateFlagsKHR) { return "{}"; } @@ -21619,6 +28012,34 @@ namespace vk } #endif /*VK_USE_PLATFORM_XCB_KHR*/ +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE std::string to_string(IOSSurfaceCreateFlagBitsMVK) + { + return "(void)"; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_IOS_MVK + VULKAN_HPP_INLINE std::string to_string(IOSSurfaceCreateFlagsMVK) + { + return "{}"; + } +#endif /*VK_USE_PLATFORM_IOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE std::string to_string(MacOSSurfaceCreateFlagBitsMVK) + { + return "(void)"; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + +#ifdef VK_USE_PLATFORM_MACOS_MVK + VULKAN_HPP_INLINE std::string to_string(MacOSSurfaceCreateFlagsMVK) + { + return "{}"; + } +#endif /*VK_USE_PLATFORM_MACOS_MVK*/ + VULKAN_HPP_INLINE std::string to_string(CommandPoolTrimFlagBitsKHR) { return "(void)"; @@ -21629,6 +28050,26 @@ namespace vk return "{}"; } + VULKAN_HPP_INLINE std::string to_string(PipelineViewportSwizzleStateCreateFlagBitsNV) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineViewportSwizzleStateCreateFlagsNV) + { + return "{}"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineDiscardRectangleStateCreateFlagBitsEXT) + { + return "(void)"; + } + + VULKAN_HPP_INLINE std::string to_string(PipelineDiscardRectangleStateCreateFlagsEXT) + { + return "{}"; + } + VULKAN_HPP_INLINE std::string to_string(ImageLayout value) { switch (value) @@ -22323,6 +28764,9 @@ namespace vk case StructureType::eDedicatedAllocationImageCreateInfoNV: return "DedicatedAllocationImageCreateInfoNV"; case StructureType::eDedicatedAllocationBufferCreateInfoNV: return "DedicatedAllocationBufferCreateInfoNV"; case StructureType::eDedicatedAllocationMemoryAllocateInfoNV: return "DedicatedAllocationMemoryAllocateInfoNV"; + case StructureType::eRenderPassMultiviewCreateInfoKHX: return "RenderPassMultiviewCreateInfoKHX"; + case StructureType::ePhysicalDeviceMultiviewFeaturesKHX: return "PhysicalDeviceMultiviewFeaturesKHX"; + case StructureType::ePhysicalDeviceMultiviewPropertiesKHX: return "PhysicalDeviceMultiviewPropertiesKHX"; case StructureType::eExternalMemoryImageCreateInfoNV: return "ExternalMemoryImageCreateInfoNV"; case StructureType::eExportMemoryAllocateInfoNV: return "ExportMemoryAllocateInfoNV"; case StructureType::eImportMemoryWin32HandleInfoNV: return "ImportMemoryWin32HandleInfoNV"; @@ -22337,19 +28781,70 @@ namespace vk case StructureType::ePhysicalDeviceMemoryProperties2KHR: return "PhysicalDeviceMemoryProperties2KHR"; case StructureType::eSparseImageFormatProperties2KHR: return "SparseImageFormatProperties2KHR"; case StructureType::ePhysicalDeviceSparseImageFormatInfo2KHR: return "PhysicalDeviceSparseImageFormatInfo2KHR"; + case StructureType::eMemoryAllocateFlagsInfoKHX: return "MemoryAllocateFlagsInfoKHX"; + case StructureType::eBindBufferMemoryInfoKHX: return "BindBufferMemoryInfoKHX"; + case StructureType::eBindImageMemoryInfoKHX: return "BindImageMemoryInfoKHX"; + case StructureType::eDeviceGroupRenderPassBeginInfoKHX: return "DeviceGroupRenderPassBeginInfoKHX"; + case StructureType::eDeviceGroupCommandBufferBeginInfoKHX: return "DeviceGroupCommandBufferBeginInfoKHX"; + case StructureType::eDeviceGroupSubmitInfoKHX: return "DeviceGroupSubmitInfoKHX"; + case StructureType::eDeviceGroupBindSparseInfoKHX: return "DeviceGroupBindSparseInfoKHX"; + case StructureType::eDeviceGroupPresentCapabilitiesKHX: return "DeviceGroupPresentCapabilitiesKHX"; + case StructureType::eImageSwapchainCreateInfoKHX: return "ImageSwapchainCreateInfoKHX"; + case StructureType::eBindImageMemorySwapchainInfoKHX: return "BindImageMemorySwapchainInfoKHX"; + case StructureType::eAcquireNextImageInfoKHX: return "AcquireNextImageInfoKHX"; + case StructureType::eDeviceGroupPresentInfoKHX: return "DeviceGroupPresentInfoKHX"; + case StructureType::eDeviceGroupSwapchainCreateInfoKHX: return "DeviceGroupSwapchainCreateInfoKHX"; case StructureType::eValidationFlagsEXT: return "ValidationFlagsEXT"; case StructureType::eViSurfaceCreateInfoNN: return "ViSurfaceCreateInfoNN"; + case StructureType::ePhysicalDeviceGroupPropertiesKHX: return "PhysicalDeviceGroupPropertiesKHX"; + case StructureType::eDeviceGroupDeviceCreateInfoKHX: return "DeviceGroupDeviceCreateInfoKHX"; + case StructureType::ePhysicalDeviceExternalImageFormatInfoKHX: return "PhysicalDeviceExternalImageFormatInfoKHX"; + case StructureType::eExternalImageFormatPropertiesKHX: return "ExternalImageFormatPropertiesKHX"; + case StructureType::ePhysicalDeviceExternalBufferInfoKHX: return "PhysicalDeviceExternalBufferInfoKHX"; + case StructureType::eExternalBufferPropertiesKHX: return "ExternalBufferPropertiesKHX"; + case StructureType::ePhysicalDeviceIdPropertiesKHX: return "PhysicalDeviceIdPropertiesKHX"; + case StructureType::ePhysicalDeviceProperties2KHX: return "PhysicalDeviceProperties2KHX"; + case StructureType::eImageFormatProperties2KHX: return "ImageFormatProperties2KHX"; + case StructureType::ePhysicalDeviceImageFormatInfo2KHX: return "PhysicalDeviceImageFormatInfo2KHX"; + case StructureType::eExternalMemoryBufferCreateInfoKHX: return "ExternalMemoryBufferCreateInfoKHX"; + case StructureType::eExternalMemoryImageCreateInfoKHX: return "ExternalMemoryImageCreateInfoKHX"; + case StructureType::eExportMemoryAllocateInfoKHX: return "ExportMemoryAllocateInfoKHX"; + case StructureType::eImportMemoryWin32HandleInfoKHX: return "ImportMemoryWin32HandleInfoKHX"; + case StructureType::eExportMemoryWin32HandleInfoKHX: return "ExportMemoryWin32HandleInfoKHX"; + case StructureType::eMemoryWin32HandlePropertiesKHX: return "MemoryWin32HandlePropertiesKHX"; + case StructureType::eImportMemoryFdInfoKHX: return "ImportMemoryFdInfoKHX"; + case StructureType::eMemoryFdPropertiesKHX: return "MemoryFdPropertiesKHX"; + case StructureType::eWin32KeyedMutexAcquireReleaseInfoKHX: return "Win32KeyedMutexAcquireReleaseInfoKHX"; + case StructureType::ePhysicalDeviceExternalSemaphoreInfoKHX: return "PhysicalDeviceExternalSemaphoreInfoKHX"; + case StructureType::eExternalSemaphorePropertiesKHX: return "ExternalSemaphorePropertiesKHX"; + case StructureType::eExportSemaphoreCreateInfoKHX: return "ExportSemaphoreCreateInfoKHX"; + case StructureType::eImportSemaphoreWin32HandleInfoKHX: return "ImportSemaphoreWin32HandleInfoKHX"; + case StructureType::eExportSemaphoreWin32HandleInfoKHX: return "ExportSemaphoreWin32HandleInfoKHX"; + case StructureType::eD3D12FenceSubmitInfoKHX: return "D3D12FenceSubmitInfoKHX"; + case StructureType::eImportSemaphoreFdInfoKHX: return "ImportSemaphoreFdInfoKHX"; + case StructureType::ePhysicalDevicePushDescriptorPropertiesKHR: return "PhysicalDevicePushDescriptorPropertiesKHR"; + case StructureType::ePresentRegionsKHR: return "PresentRegionsKHR"; + case StructureType::eDescriptorUpdateTemplateCreateInfoKHR: return "DescriptorUpdateTemplateCreateInfoKHR"; case StructureType::eObjectTableCreateInfoNVX: return "ObjectTableCreateInfoNVX"; case StructureType::eIndirectCommandsLayoutCreateInfoNVX: return "IndirectCommandsLayoutCreateInfoNVX"; case StructureType::eCmdProcessCommandsInfoNVX: return "CmdProcessCommandsInfoNVX"; case StructureType::eCmdReserveSpaceForCommandsInfoNVX: return "CmdReserveSpaceForCommandsInfoNVX"; case StructureType::eDeviceGeneratedCommandsLimitsNVX: return "DeviceGeneratedCommandsLimitsNVX"; case StructureType::eDeviceGeneratedCommandsFeaturesNVX: return "DeviceGeneratedCommandsFeaturesNVX"; + case StructureType::ePipelineViewportWScalingStateCreateInfoNV: return "PipelineViewportWScalingStateCreateInfoNV"; case StructureType::eSurfaceCapabilities2EXT: return "SurfaceCapabilities2EXT"; case StructureType::eDisplayPowerInfoEXT: return "DisplayPowerInfoEXT"; case StructureType::eDeviceEventInfoEXT: return "DeviceEventInfoEXT"; case StructureType::eDisplayEventInfoEXT: return "DisplayEventInfoEXT"; case StructureType::eSwapchainCounterCreateInfoEXT: return "SwapchainCounterCreateInfoEXT"; + case StructureType::ePresentTimesInfoGOOGLE: return "PresentTimesInfoGOOGLE"; + case StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX: return "PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"; + case StructureType::ePipelineViewportSwizzleStateCreateInfoNV: return "PipelineViewportSwizzleStateCreateInfoNV"; + case StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT: return "PhysicalDeviceDiscardRectanglePropertiesEXT"; + case StructureType::ePipelineDiscardRectangleStateCreateInfoEXT: return "PipelineDiscardRectangleStateCreateInfoEXT"; + case StructureType::eHdrMetadataEXT: return "HdrMetadataEXT"; + case StructureType::eIosSurfaceCreateInfoMVK: return "IosSurfaceCreateInfoMVK"; + case StructureType::eMacosSurfaceCreateInfoMVK: return "MacosSurfaceCreateInfoMVK"; default: return "invalid"; } } @@ -22377,6 +28872,18 @@ namespace vk case DynamicState::eStencilCompareMask: return "StencilCompareMask"; case DynamicState::eStencilWriteMask: return "StencilWriteMask"; case DynamicState::eStencilReference: return "StencilReference"; + case DynamicState::eViewportWScalingNV: return "ViewportWScalingNV"; + case DynamicState::eDiscardRectangleEXT: return "DiscardRectangleEXT"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorUpdateTemplateTypeKHR value) + { + switch (value) + { + case DescriptorUpdateTemplateTypeKHR::eDescriptorSet: return "DescriptorSet"; + case DescriptorUpdateTemplateTypeKHR::ePushDescriptors: return "PushDescriptors"; default: return "invalid"; } } @@ -22434,6 +28941,7 @@ namespace vk switch (value) { case MemoryHeapFlagBits::eDeviceLocal: return "DeviceLocal"; + case MemoryHeapFlagBits::eMultiInstanceKHX: return "MultiInstanceKHX"; default: return "invalid"; } } @@ -22443,6 +28951,7 @@ namespace vk if (!value) return "{}"; std::string result; if (value & MemoryHeapFlagBits::eDeviceLocal) result += "DeviceLocal | "; + if (value & MemoryHeapFlagBits::eMultiInstanceKHX) result += "MultiInstanceKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -22624,6 +29133,7 @@ namespace vk case ImageCreateFlagBits::eSparseAliased: return "SparseAliased"; case ImageCreateFlagBits::eMutableFormat: return "MutableFormat"; case ImageCreateFlagBits::eCubeCompatible: return "CubeCompatible"; + case ImageCreateFlagBits::eBindSfrKHX: return "BindSfrKHX"; case ImageCreateFlagBits::e2DArrayCompatibleKHR: return "2DArrayCompatibleKHR"; default: return "invalid"; } @@ -22638,6 +29148,7 @@ namespace vk if (value & ImageCreateFlagBits::eSparseAliased) result += "SparseAliased | "; if (value & ImageCreateFlagBits::eMutableFormat) result += "MutableFormat | "; if (value & ImageCreateFlagBits::eCubeCompatible) result += "CubeCompatible | "; + if (value & ImageCreateFlagBits::eBindSfrKHX) result += "BindSfrKHX | "; if (value & ImageCreateFlagBits::e2DArrayCompatibleKHR) result += "2DArrayCompatibleKHR | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -22649,6 +29160,8 @@ namespace vk case PipelineCreateFlagBits::eDisableOptimization: return "DisableOptimization"; case PipelineCreateFlagBits::eAllowDerivatives: return "AllowDerivatives"; case PipelineCreateFlagBits::eDerivative: return "Derivative"; + case PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX: return "ViewIndexFromDeviceIndexKHX"; + case PipelineCreateFlagBits::eDispatchBaseKHX: return "DispatchBaseKHX"; default: return "invalid"; } } @@ -22660,6 +29173,8 @@ namespace vk if (value & PipelineCreateFlagBits::eDisableOptimization) result += "DisableOptimization | "; if (value & PipelineCreateFlagBits::eAllowDerivatives) result += "AllowDerivatives | "; if (value & PipelineCreateFlagBits::eDerivative) result += "Derivative | "; + if (value & PipelineCreateFlagBits::eViewIndexFromDeviceIndexKHX) result += "ViewIndexFromDeviceIndexKHX | "; + if (value & PipelineCreateFlagBits::eDispatchBaseKHX) result += "DispatchBaseKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -23102,6 +29617,8 @@ namespace vk switch (value) { case DependencyFlagBits::eByRegion: return "ByRegion"; + case DependencyFlagBits::eViewLocalKHX: return "ViewLocalKHX"; + case DependencyFlagBits::eDeviceGroupKHX: return "DeviceGroupKHX"; default: return "invalid"; } } @@ -23111,6 +29628,8 @@ namespace vk if (!value) return "{}"; std::string result; if (value & DependencyFlagBits::eByRegion) result += "ByRegion | "; + if (value & DependencyFlagBits::eViewLocalKHX) result += "ViewLocalKHX | "; + if (value & DependencyFlagBits::eDeviceGroupKHX) result += "DeviceGroupKHX | "; return "{" + result.substr(0, result.size() - 3) + "}"; } @@ -23131,18 +29650,19 @@ namespace vk switch (value) { case ColorSpaceKHR::eSrgbNonlinear: return "SrgbNonlinear"; - case ColorSpaceKHR::eDisplayP3LinearEXT: return "DisplayP3LinearEXT"; case ColorSpaceKHR::eDisplayP3NonlinearEXT: return "DisplayP3NonlinearEXT"; - case ColorSpaceKHR::eScrgbLinearEXT: return "ScrgbLinearEXT"; - case ColorSpaceKHR::eScrgbNonlinearEXT: return "ScrgbNonlinearEXT"; + case ColorSpaceKHR::eExtendedSrgbLinearEXT: return "ExtendedSrgbLinearEXT"; case ColorSpaceKHR::eDciP3LinearEXT: return "DciP3LinearEXT"; case ColorSpaceKHR::eDciP3NonlinearEXT: return "DciP3NonlinearEXT"; case ColorSpaceKHR::eBt709LinearEXT: return "Bt709LinearEXT"; case ColorSpaceKHR::eBt709NonlinearEXT: return "Bt709NonlinearEXT"; case ColorSpaceKHR::eBt2020LinearEXT: return "Bt2020LinearEXT"; - case ColorSpaceKHR::eBt2020NonlinearEXT: return "Bt2020NonlinearEXT"; + case ColorSpaceKHR::eHdr10St2084EXT: return "Hdr10St2084EXT"; + case ColorSpaceKHR::eDolbyvisionEXT: return "DolbyvisionEXT"; + case ColorSpaceKHR::eHdr10HlgEXT: return "Hdr10HlgEXT"; case ColorSpaceKHR::eAdobergbLinearEXT: return "AdobergbLinearEXT"; case ColorSpaceKHR::eAdobergbNonlinearEXT: return "AdobergbNonlinearEXT"; + case ColorSpaceKHR::ePassThroughEXT: return "PassThroughEXT"; default: return "invalid"; } } @@ -23288,6 +29808,7 @@ namespace vk case DebugReportObjectTypeEXT::eDisplayModeKhr: return "DisplayModeKhr"; case DebugReportObjectTypeEXT::eObjectTableNvx: return "ObjectTableNvx"; case DebugReportObjectTypeEXT::eIndirectCommandsLayoutNvx: return "IndirectCommandsLayoutNvx"; + case DebugReportObjectTypeEXT::eDescriptorUpdateTemplateKhrKHR: return "DescriptorUpdateTemplateKhrKHR"; default: return "invalid"; } } @@ -23436,6 +29957,117 @@ namespace vk } } + VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlagBits value) + { + switch (value) + { + case DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR: return "PushDescriptorKHR"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DescriptorSetLayoutCreateFlags value) + { + if (!value) return "{}"; + std::string result; + if (value & DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR) result += "PushDescriptorKHR | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagBitsKHX value) + { + switch (value) + { + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd: return "OpaqueFd"; + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32: return "OpaqueWin32"; + case ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture: return "D3D11Texture"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt: return "D3D11TextureKmt"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap: return "D3D12Heap"; + case ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource: return "D3D12Resource"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryHandleTypeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueFd) result += "OpaqueFd | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32) result += "OpaqueWin32 | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D11Texture) result += "D3D11Texture | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D11TextureKmt) result += "D3D11TextureKmt | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Heap) result += "D3D12Heap | "; + if (value & ExternalMemoryHandleTypeFlagBitsKHX::eD3D12Resource) result += "D3D12Resource | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagBitsKHX value) + { + switch (value) + { + case ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly: return "DedicatedOnly"; + case ExternalMemoryFeatureFlagBitsKHX::eExportable: return "Exportable"; + case ExternalMemoryFeatureFlagBitsKHX::eImportable: return "Importable"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalMemoryFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalMemoryFeatureFlagBitsKHX::eDedicatedOnly) result += "DedicatedOnly | "; + if (value & ExternalMemoryFeatureFlagBitsKHX::eExportable) result += "Exportable | "; + if (value & ExternalMemoryFeatureFlagBitsKHX::eImportable) result += "Importable | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagBitsKHX value) + { + switch (value) + { + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd: return "OpaqueFd"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32: return "OpaqueWin32"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence: return "D3D12Fence"; + case ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd: return "FenceFd"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreHandleTypeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueFd) result += "OpaqueFd | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32) result += "OpaqueWin32 | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eOpaqueWin32Kmt) result += "OpaqueWin32Kmt | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eD3D12Fence) result += "D3D12Fence | "; + if (value & ExternalSemaphoreHandleTypeFlagBitsKHX::eFenceFd) result += "FenceFd | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagBitsKHX value) + { + switch (value) + { + case ExternalSemaphoreFeatureFlagBitsKHX::eExportable: return "Exportable"; + case ExternalSemaphoreFeatureFlagBitsKHX::eImportable: return "Importable"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(ExternalSemaphoreFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & ExternalSemaphoreFeatureFlagBitsKHX::eExportable) result += "Exportable | "; + if (value & ExternalSemaphoreFeatureFlagBitsKHX::eImportable) result += "Importable | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + VULKAN_HPP_INLINE std::string to_string(SurfaceCounterFlagBitsEXT value) { switch (value) @@ -23482,6 +30114,131 @@ namespace vk } } + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagBitsKHX value) + { + switch (value) + { + case PeerMemoryFeatureFlagBitsKHX::eCopySrc: return "CopySrc"; + case PeerMemoryFeatureFlagBitsKHX::eCopyDst: return "CopyDst"; + case PeerMemoryFeatureFlagBitsKHX::eGenericSrc: return "GenericSrc"; + case PeerMemoryFeatureFlagBitsKHX::eGenericDst: return "GenericDst"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(PeerMemoryFeatureFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & PeerMemoryFeatureFlagBitsKHX::eCopySrc) result += "CopySrc | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eCopyDst) result += "CopyDst | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eGenericSrc) result += "GenericSrc | "; + if (value & PeerMemoryFeatureFlagBitsKHX::eGenericDst) result += "GenericDst | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagBitsKHX value) + { + switch (value) + { + case MemoryAllocateFlagBitsKHX::eDeviceMask: return "DeviceMask"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(MemoryAllocateFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & MemoryAllocateFlagBitsKHX::eDeviceMask) result += "DeviceMask | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagBitsKHX value) + { + switch (value) + { + case DeviceGroupPresentModeFlagBitsKHX::eLocal: return "Local"; + case DeviceGroupPresentModeFlagBitsKHX::eRemote: return "Remote"; + case DeviceGroupPresentModeFlagBitsKHX::eSum: return "Sum"; + case DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice: return "LocalMultiDevice"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DeviceGroupPresentModeFlagsKHX value) + { + if (!value) return "{}"; + std::string result; + if (value & DeviceGroupPresentModeFlagBitsKHX::eLocal) result += "Local | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eRemote) result += "Remote | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eSum) result += "Sum | "; + if (value & DeviceGroupPresentModeFlagBitsKHX::eLocalMultiDevice) result += "LocalMultiDevice | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagBitsKHR value) + { + switch (value) + { + case SwapchainCreateFlagBitsKHR::eBindSfrKHX: return "BindSfrKHX"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SwapchainCreateFlagsKHR value) + { + if (!value) return "{}"; + std::string result; + if (value & SwapchainCreateFlagBitsKHR::eBindSfrKHX) result += "BindSfrKHX | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + + VULKAN_HPP_INLINE std::string to_string(ViewportCoordinateSwizzleNV value) + { + switch (value) + { + case ViewportCoordinateSwizzleNV::ePositiveX: return "PositiveX"; + case ViewportCoordinateSwizzleNV::eNegativeX: return "NegativeX"; + case ViewportCoordinateSwizzleNV::ePositiveY: return "PositiveY"; + case ViewportCoordinateSwizzleNV::eNegativeY: return "NegativeY"; + case ViewportCoordinateSwizzleNV::ePositiveZ: return "PositiveZ"; + case ViewportCoordinateSwizzleNV::eNegativeZ: return "NegativeZ"; + case ViewportCoordinateSwizzleNV::ePositiveW: return "PositiveW"; + case ViewportCoordinateSwizzleNV::eNegativeW: return "NegativeW"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(DiscardRectangleModeEXT value) + { + switch (value) + { + case DiscardRectangleModeEXT::eInclusive: return "Inclusive"; + case DiscardRectangleModeEXT::eExclusive: return "Exclusive"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlagBits value) + { + switch (value) + { + case SubpassDescriptionFlagBits::ePerViewAttributesNVX: return "PerViewAttributesNVX"; + case SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX: return "PerViewPositionXOnlyNVX"; + default: return "invalid"; + } + } + + VULKAN_HPP_INLINE std::string to_string(SubpassDescriptionFlags value) + { + if (!value) return "{}"; + std::string result; + if (value & SubpassDescriptionFlagBits::ePerViewAttributesNVX) result += "PerViewAttributesNVX | "; + if (value & SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX) result += "PerViewPositionXOnlyNVX | "; + return "{" + result.substr(0, result.size() - 3) + "}"; + } + } // namespace vk #endif