Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. ...
  2. static union {
  3.     ...
  4.     VkSurfaceFormatKHR sf[BUFFERSIZE/sizeof (VkSurfaceFormatKHR)];
  5.     ...
  6. } tmpbuffer;
  7.  
  8. ... y después para invocar a la función:
  9.  
  10. VkSurfaceFormatKHR buff = tmpbuffer.sf;
  11. int len = BUFFERSIZE/sizeof (VkSurfaceFormatKHR);
  12. VkResult res = vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surf, &len, buff);
  13. if (res != VK_SUCCESS || VK_INCOMPLETE) {
  14.     /* manejar errores */...
  15. }
  16. if (res == VK_INCOMPLETE) {
  17.     buff = malloc(len * sizeof (VkSurfaceFormatKHR));
  18.     vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surf, &len, buff);
  19. }
  20.  
  21. [..] usarlo [..];
  22.  
  23. /*liberarlo:*/
  24. if (res == VK_INCOMPLETE) free(buff);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement