RicardasSim

VkClearValue test c

Sep 25th, 2018
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. //-std=c99
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include <vulkan/vulkan.h>
  6.  
  7. int main (int argc, char **argv)
  8. {
  9.  
  10. /*
  11. from VulkanSDK
  12.  
  13. typedef union VkClearColorValue {
  14.     float       float32[4];
  15.     int32_t     int32[4];
  16.     uint32_t    uint32[4];
  17. } VkClearColorValue;
  18.  
  19. typedef struct VkClearDepthStencilValue {
  20.     float       depth;
  21.     uint32_t    stencil;
  22. } VkClearDepthStencilValue;
  23.  
  24. typedef union VkClearValue {
  25.     VkClearColorValue           color;
  26.     VkClearDepthStencilValue    depthStencil;
  27. } VkClearValue;
  28. */
  29.    
  30.     VkClearValue clearValue[]={
  31.     {.color = {.float32 = {0.1f,0.2f,0.3f,1.0f}}},
  32.     {.depthStencil = {.depth=1.0, .stencil=0}}
  33.     };
  34.  
  35.     printf("clearValue[0] (0): %f\n",clearValue[0].color.float32[0]);      
  36.     printf("clearValue[0] (1): %f\n",clearValue[0].color.float32[1]);
  37.     printf("clearValue[0] (2): %f\n",clearValue[0].color.float32[2]);
  38.     printf("clearValue[0] (3): %f\n",clearValue[0].color.float32[3]);
  39.  
  40.     printf("clearValue[1] (0): %f\n",clearValue[1].depthStencil.depth);    
  41.     printf("clearValue[1] (1): %d\n\n",clearValue[1].depthStencil.stencil);
  42.  
  43.  
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment