diff options
Diffstat (limited to 'tools/render-test/vk-module.h')
| -rw-r--r-- | tools/render-test/vk-module.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/render-test/vk-module.h b/tools/render-test/vk-module.h new file mode 100644 index 000000000..dd3c1eaa1 --- /dev/null +++ b/tools/render-test/vk-module.h @@ -0,0 +1,38 @@ +// vk-module.h +#pragma once + +#include "../../source/core/slang-defines.h" +#include "../../source/core/slang-result.h" + +#if SLANG_WINDOWS_FAMILY +# define VK_USE_PLATFORM_WIN32_KHR 1 +#else +# define VK_USE_PLATFORM_XLIB_KHR 1 +#endif + +#define VK_NO_PROTOTYPES +#include <vulkan/vulkan.h> + +namespace renderer_test { + +struct VulkanModule +{ + /// true if has been initialized + SLANG_FORCE_INLINE bool isInitialized() const { return m_module != nullptr; } + + /// Get a function by name + PFN_vkVoidFunction getFunction(const char* name) const; + + /// Initialize + Slang::Result init(); + /// Destroy + void destroy(); + + /// Dtor + ~VulkanModule() { destroy(); } + + protected: + void* m_module = nullptr; +}; + +} // renderer_test |
