Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- static union {
- ...
- VkSurfaceFormatKHR sf[BUFFERSIZE/sizeof (VkSurfaceFormatKHR)];
- ...
- } tmpbuffer;
- ... y después para invocar a la función:
- VkSurfaceFormatKHR buff = tmpbuffer.sf;
- int len = BUFFERSIZE/sizeof (VkSurfaceFormatKHR);
- VkResult res = vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surf, &len, buff);
- if (res != VK_SUCCESS || VK_INCOMPLETE) {
- /* manejar errores */...
- }
- if (res == VK_INCOMPLETE) {
- buff = malloc(len * sizeof (VkSurfaceFormatKHR));
- vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surf, &len, buff);
- }
- [..] usarlo [..];
- /*liberarlo:*/
- if (res == VK_INCOMPLETE) free(buff);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement