Advertisement
RicardasSim

VkClearValue test cpp

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