Refactor UniformBuffers and DescriptorSets

- Refactor UniformBuffers to keep track of the uniforms it contains
- Refactor DescriptorSets to initialize UniformsBuffers and keep track
  of all its bindings
- DescriptorSets can now be created from the Pipeline
- Add custom DescriptorSets to Renderer
This commit is contained in:
Thraix
2023-03-24 22:27:03 +01:00
parent fbf53234f3
commit 9faec15fd6
22 changed files with 469 additions and 173 deletions
@@ -0,0 +1,25 @@
#pragma once
#include "copium/pipeline/ShaderBinding.h"
#include <string>
#include <set>
namespace Copium
{
class ShaderReflector
{
public:
std::set<ShaderBinding> bindings;
public:
ShaderReflector(const std::string& vertexGlslFile, const std::string& fragmentGlslFile);
private:
void ParseGlslFile(const std::string& glslFile, ShaderType type);
void ParseLine(const std::string& str, int& index);
void ParseWhitespace(const std::string& str, int& index);
void ParseLayout(const std::string& str, int& index, ShaderType type);
std::string_view ParseWord(const std::string& str, int& index);
void ParseUniformBuffer(const std::string& str, int& index, ShaderBinding& binding);
};
}