Vulcan Nightmare

Experimentally bringing up vulcan support
This commit is contained in:
Kelsi 2026-02-21 19:41:21 -08:00
parent 863a786c48
commit 83b576e8d9
189 changed files with 12147 additions and 7820 deletions

View file

@ -0,0 +1,45 @@
#pragma once
#include <vulkan/vulkan.h>
#include <string>
#include <vector>
namespace wowee {
namespace rendering {
class VkShaderModule {
public:
VkShaderModule() = default;
~VkShaderModule();
VkShaderModule(const VkShaderModule&) = delete;
VkShaderModule& operator=(const VkShaderModule&) = delete;
VkShaderModule(VkShaderModule&& other) noexcept;
VkShaderModule& operator=(VkShaderModule&& other) noexcept;
// Load a SPIR-V file from disk
bool loadFromFile(VkDevice device, const std::string& path);
// Load from raw SPIR-V bytes
bool loadFromMemory(VkDevice device, const uint32_t* code, size_t sizeBytes);
void destroy();
::VkShaderModule getModule() const { return module_; }
bool isValid() const { return module_ != VK_NULL_HANDLE; }
// Create a VkPipelineShaderStageCreateInfo for this module
VkPipelineShaderStageCreateInfo stageInfo(VkShaderStageFlagBits stage,
const char* entryPoint = "main") const;
private:
VkDevice device_ = VK_NULL_HANDLE;
::VkShaderModule module_ = VK_NULL_HANDLE;
};
// Convenience: load a shader stage directly from a .spv file
VkPipelineShaderStageCreateInfo loadShaderStage(VkDevice device,
const std::string& path, VkShaderStageFlagBits stage);
} // namespace rendering
} // namespace wowee