Date: Wed, 12 May 2021 22:47:58 +0000
On Wednesday, May 12, 2021 12:51 PM, Charlie Barto <Charles.Barto_at_[hidden]> wrote:
> extern “C” VkResult vkCreateInstance(const VkInstanceCreateInfo*, const VKAllocationCallbacks*, VkInstance*);
>
>
>
> in C:
>
> VkInstance instance = 0;
>
> VkResult result = vkCreateInstance(&(VkInstanceCreateInfo){
>
> .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
>
> .pApplicationInfo = &(VkApplicationInfo) {
>
> .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
>
> .pApplicationName = “Hello World”,
>
> .applicationVersion = VK_MAKE_VERSION(0, 1, 0),
>
> .pEngineName = “No Engine”,
>
> .apiVersion = VK_API_VERSION_1_2
>
> }}, NULL, &instance);
>
>
>
> This usecase isn’t supported if the semantics are (T){…} === T{…}
The following is legal given the proposal:
VkInstance instance = 0;
VkResult result = vkCreateInstance((VkInstanceCreateInfo[]) {{
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pApplicationInfo = (VkApplicationInfo[]) {{
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pApplicationName = "Hello World",
.applicationVersion = VK_MAKE_VERSION(0, 1, 0),
.pEngineName = "No Engine",
.apiVersion = VK_API_VERSION_1_2
}}
}}, nullptr, &instance);
Although it looks somewhat strange (GCC
forbids array-prvalue -> pointer conversion,
but the standard allows it).
https://godbolt.org/z/7n6rG8orY
Does that work for you?
> extern “C” VkResult vkCreateInstance(const VkInstanceCreateInfo*, const VKAllocationCallbacks*, VkInstance*);
>
>
>
> in C:
>
> VkInstance instance = 0;
>
> VkResult result = vkCreateInstance(&(VkInstanceCreateInfo){
>
> .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
>
> .pApplicationInfo = &(VkApplicationInfo) {
>
> .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
>
> .pApplicationName = “Hello World”,
>
> .applicationVersion = VK_MAKE_VERSION(0, 1, 0),
>
> .pEngineName = “No Engine”,
>
> .apiVersion = VK_API_VERSION_1_2
>
> }}, NULL, &instance);
>
>
>
> This usecase isn’t supported if the semantics are (T){…} === T{…}
The following is legal given the proposal:
VkInstance instance = 0;
VkResult result = vkCreateInstance((VkInstanceCreateInfo[]) {{
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pApplicationInfo = (VkApplicationInfo[]) {{
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pApplicationName = "Hello World",
.applicationVersion = VK_MAKE_VERSION(0, 1, 0),
.pEngineName = "No Engine",
.apiVersion = VK_API_VERSION_1_2
}}
}}, nullptr, &instance);
Although it looks somewhat strange (GCC
forbids array-prvalue -> pointer conversion,
but the standard allows it).
https://godbolt.org/z/7n6rG8orY
Does that work for you?
-- Zhihao Yuan, ID lichray The best way to predict the future is to invent it. _______________________________________________
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail
wsBzBAEBCAAGBQJgnFsQACEJELvdJpAo+x+4FiEEq579O5Q2C/mSvp73u90m
kCj7H7j8uwf/WMNhdgFxNAUzZTTLW5kUGoTFVvr+edZv3wLoaiUC/jzK4uB5
+NAoaQMmW8i6CBbibLDO9RrY9YoDkkqaJhyzri9d06Fg0Fn8mwvZQwhN3UIP
fEG9wm4Hqde4t/poKXPTy38fclSh9B5BApLb/4Y1H4FN/l6wolkLPq0Ng/gM
0dKKVM5LVPA2+3wUbCqBIWAASmvVRmDyYez2VSCjfxiwfhmdBVEENw7Gazdi
Sf+Q5PZpe4Uy0yqjs13rTPQLVcuR5W1JCxNhW7aT2WuC1oEvsCsPs3xDa5nf
iobxNLVsleY5iB2waw3l2GhHXKOqqoiNILp7MlYWWbJGDbkjcnXNUA==
=nh3p
-----END PGP SIGNATURE-----
-----------------------b1a1916ffc5c338f75132f73a9a79fad--
Version: ProtonMail
wsBzBAEBCAAGBQJgnFsQACEJELvdJpAo+x+4FiEEq579O5Q2C/mSvp73u90m
kCj7H7j8uwf/WMNhdgFxNAUzZTTLW5kUGoTFVvr+edZv3wLoaiUC/jzK4uB5
+NAoaQMmW8i6CBbibLDO9RrY9YoDkkqaJhyzri9d06Fg0Fn8mwvZQwhN3UIP
fEG9wm4Hqde4t/poKXPTy38fclSh9B5BApLb/4Y1H4FN/l6wolkLPq0Ng/gM
0dKKVM5LVPA2+3wUbCqBIWAASmvVRmDyYez2VSCjfxiwfhmdBVEENw7Gazdi
Sf+Q5PZpe4Uy0yqjs13rTPQLVcuR5W1JCxNhW7aT2WuC1oEvsCsPs3xDa5nf
iobxNLVsleY5iB2waw3l2GhHXKOqqoiNILp7MlYWWbJGDbkjcnXNUA==
=nh3p
-----END PGP SIGNATURE-----
-----------------------b1a1916ffc5c338f75132f73a9a79fad--
Received on 2021-05-12 17:48:10