27 lines
730 B
C++
27 lines
730 B
C++
#pragma once
|
|
|
|
#include <set>
|
|
#include <string>
|
|
|
|
#include "copium/pipeline/ShaderBinding.h"
|
|
|
|
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);
|
|
};
|
|
}
|