1
1

base.d 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. ** Copyright (c) 2015-2016 The Khronos Group Inc.
  3. **
  4. ** Permission is hereby granted, free of charge, to any person obtaining a
  5. ** copy of this software and/or associated documentation files (the
  6. ** "Materials"), to deal in the Materials without restriction, including
  7. ** without limitation the rights to use, copy, modify, merge, publish,
  8. ** distribute, sublicense, and/or sell copies of the Materials, and to
  9. ** permit persons to whom the Materials are furnished to do so, subject to
  10. ** the following conditions:
  11. **
  12. ** The above copyright notice and this permission notice shall be included
  13. ** in all copies or substantial portions of the Materials.
  14. **
  15. ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  22. */
  23. module derelict.vulkan.base;
  24. extern(System):
  25. //#include "vk_platform.h"
  26. alias VK_VERSION_MAJOR = (uint ver) => ver >> 22;
  27. alias VK_VERSION_MINOR = (uint ver) => (ver >> 12) & 0x3ff;
  28. alias VK_VERSION_PATCH = (uint ver) => ver & 0xfff;
  29. alias VK_MAKE_VERSION = (uint major, uint minor, uint patch) =>
  30. (major << 22) | (minor << 12) | patch;
  31. package mixin template VK_DEFINE_HANDLE(string name) {
  32. mixin("struct " ~ name ~ "_T; \n alias " ~ name ~ " = " ~ name ~ "_T*;");
  33. }
  34. package mixin template VK_DEFINE_NON_DISPATCHABLE_HANDLE(string name) {
  35. mixin("alias " ~ name ~ " = void*;");
  36. }
  37. // #if defined(__LP64__) || defined(_WIN64)
  38. // || defined(__x86_64__) || defined(_M_X64)
  39. // || defined(__ia64) || defined (_M_IA64)
  40. // || defined(__aarch64__) || defined(__powerpc64__)
  41. alias VkFlags = uint;
  42. alias VkBool32 = uint;
  43. alias VkDeviceSize = ulong;
  44. alias VkSampleMask = uint;
  45. enum VK_VERSION_1_0 = 1;
  46. enum VK_API_VERSION = VK_MAKE_VERSION(1, 0, 3); // Vulkan API version supported by this binding
  47. enum VK_NULL_HANDLE = null;
  48. enum VK_TRUE = 1;
  49. enum VK_FALSE = 0;
  50. enum VK_UUID_SIZE = 16;
  51. enum VK_WHOLE_SIZE = (~0UL);
  52. enum VK_LOD_CLAMP_NONE = 1000.0f;
  53. enum VK_ATTACHMENT_UNUSED = (~0U);
  54. enum VK_SUBPASS_EXTERNAL = (~0U);
  55. enum VK_QUEUE_FAMILY_IGNORED = (~0U);
  56. enum VK_REMAINING_MIP_LEVELS = (~0U);
  57. enum VK_REMAINING_ARRAY_LAYERS = (~0U);
  58. enum VK_MAX_MEMORY_TYPES = 32;
  59. enum VK_MAX_MEMORY_HEAPS = 16;
  60. enum VK_MAX_EXTENSION_NAME_SIZE = 256;
  61. enum VK_MAX_DESCRIPTION_SIZE = 256;
  62. enum VK_MAX_PHYSICAL_DEVICE_NAME_SIZE = 256;