5#include <ext/vulkan/spirv/GlslangToSpv.h>
9#include <unordered_map>
10#include <unordered_set>
18using std::unordered_map;
19using std::unordered_set;
53 static int determineAlignment(
const unordered_map<
string, vector<string>>& structs,
const vector<string>& uniforms);
60 inline static int align(
int alignment,
int offset) {
61 auto alignRemainder = offset % alignment;
62 return alignRemainder == 0?offset:offset + (alignment - alignRemainder);
77 const unordered_map<string, string>& definitionValues,
78 const unordered_map<
string, vector<string>>& structs,
79 const vector<string>& uniforms,
81 unordered_set<string>& uniformStructsArrays,
96 static void loadShader(
VKRenderer::shader_type& shader, int32_t type,
const string& pathName,
const string& fileName,
const string& definitions =
string(),
const string& functions =
string());
GL3/Core -> Vulkan shader program.
static constexpr uint32_t SHADER_VERTEX_SHADER
static bool addToShaderUniformBufferObject(VKRenderer::shader_type &shader, const unordered_map< string, string > &definitionValues, const unordered_map< string, vector< string > > &structs, const vector< string > &uniforms, const string &prefix, unordered_set< string > &uniformStructsArrays, string &uniformsBlock)
Add shader uniform buffer object.
static int align(int alignment, int offset)
Align.
static void loadShader(VKRenderer::shader_type &shader, int32_t type, const string &pathName, const string &fileName, const string &definitions=string(), const string &functions=string())
Loads a shader.
static bool linkProgram(VKRenderer::program_type &program)
Links attached shaders to a program.
static constexpr bool VERBOSE
static EShLanguage shaderFindLanguage(const VkShaderStageFlagBits shaderType)
Shader VK type to language converter.
static void shaderInitResources(TBuiltInResource &resources)
Set up shader constraints/resources.
static constexpr uint32_t SHADER_FRAGMENT_SHADER
static int determineAlignment(const unordered_map< string, vector< string > > &structs, const vector< string > &uniforms)
Determine alignment.
static constexpr uint32_t SHADER_COMPUTE_SHADER