Add ShaderRegistry
This commit is contained in:
@@ -6,9 +6,7 @@
|
||||
|
||||
#include "Device.hpp"
|
||||
#include "Base/Utils.hpp"
|
||||
extern "C" {
|
||||
#include "Shader/Shaders.h"
|
||||
}
|
||||
#include "Shader/ShaderRegistry.hpp"
|
||||
|
||||
namespace openVulkanoCpp::Vulkan
|
||||
{
|
||||
@@ -92,18 +90,13 @@ namespace openVulkanoCpp::Vulkan
|
||||
vk::ShaderModule Device::CreateShaderModule(const std::string& filename) const
|
||||
{
|
||||
Array<char> buffer;
|
||||
void* data = nullptr;
|
||||
const void* data = nullptr;
|
||||
size_t size = 0;
|
||||
if (Utils::StartsWith(filename, "Shader/"))
|
||||
{
|
||||
for(uint32_t i = 0; i < fileTableSize; i++)
|
||||
{
|
||||
if (Utils::EndsWith(filename, fileTable[i].entryName))
|
||||
{
|
||||
data = const_cast<unsigned char*>(fileTable[i].data);
|
||||
size = fileTable[i].size;
|
||||
}
|
||||
}
|
||||
auto shader = ShaderRegistry::GetInstance().GetShader(filename.substr(7));
|
||||
data = shader.first;
|
||||
size = shader.second;
|
||||
}
|
||||
if (!data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user