RicardasSim

variants c

Nov 5th, 2018
654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. //(I)
  2.  
  3. #define INSTANCE_LAYER_COUNT 2
  4. const char *g_pInstanceLayers[] = {"VK_LAYER_NV_optimus","VK_LAYER_LUNARG_standard_validation"};
  5.  
  6. //#define INSTANCE_LAYER_COUNT 0
  7. //const char *g_pInstanceLayers[] = {0};
  8.  
  9. #if INSTANCE_LAYER_COUNT > 0
  10.     // somFunc(...,INSTANCE_LAYER_COUNT,...);
  11. #endif
  12.  
  13. //(II)
  14.  
  15. const char *g_pInstanceLayers[] = {"VK_LAYER_NV_optimus","VK_LAYER_LUNARG_standard_validation"};
  16.  
  17. int nNumberOfEllements = 0;
  18.  
  19. nNumberOfEllements = sizeof(g_pInstanceLayers) / sizeof(char*);
  20. //or nNumberOfEllements = sizeof(g_pInstanceLayers) / sizeof(g_pInstanceLayers[0]);
  21.  
  22. printf("Number of ellements in the g_pInstanceLayers array is %d\n", nNumberOfEllements);
  23.  
  24. if(nNumberOfEllements)
  25. {
  26.     // somFunc(...,nNumberOfEllements,...);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment