2022-01-18 20:28:25 +00:00
|
|
|
#ifndef VULKANCPPSETUP_SHADERLOADER_H
|
|
|
|
#define VULKANCPPSETUP_SHADERLOADER_H
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <qvulkanfunctions.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
|
|
|
|
class ShaderLoader {
|
|
|
|
private:
|
2022-01-18 22:33:20 +00:00
|
|
|
std::vector<VkShaderModule> loadedShaders{};
|
2022-01-18 20:28:25 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ShaderLoader() = default;
|
|
|
|
~ShaderLoader() = default;
|
|
|
|
|
|
|
|
std::vector<VkShaderModule>
|
|
|
|
loadShaders(VkDevice device, QVulkanDeviceFunctions *deviceFunctions,
|
|
|
|
std::string const *shaderFilenames,
|
|
|
|
std::size_t shaderFilenameCount);
|
|
|
|
|
|
|
|
template <std::size_t amount>
|
|
|
|
std::vector<VkShaderModule>
|
|
|
|
loadShaders(VkDevice device, QVulkanDeviceFunctions *deviceFunctions,
|
|
|
|
const std::array<std::string, amount> &shaderFilenames) {
|
|
|
|
return loadShaders(device, deviceFunctions, shaderFilenames.data(),
|
|
|
|
shaderFilenames.size());
|
|
|
|
}
|
|
|
|
|
|
|
|
void destroyShaders(VkDevice device, QVulkanDeviceFunctions *devFuncs);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VULKANCPPSETUP_SHADERLOADER_H
|