refrence parameter by const refrence, linked tothe original GLSL resources, fixed inlude

This commit is contained in:
aliPMPAINT 2021-02-27 11:22:49 +03:30
parent f60e71dd0b
commit 3cad95c2b6
2 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@
#include <glslang/Include/ResourceLimits.h>
#include <glslang/Public/ShaderLang.h>
#include <glslang/SPIRV/GlslangToSpv.h>
#include <SPIRV/GlslangToSpv.h>
#include "kompute/Core.hpp"
@ -36,7 +36,7 @@ public:
const std::vector<std::string>& files = {},
const std::string& entryPoint = "main",
std::vector<std::pair<std::string,std::string>> definitions = {},
const TBuiltInResource resources = defaultResource);
const TBuiltInResource& resources = defaultResource);
/**
* Compile a single glslang source from string value. Currently this function
@ -55,10 +55,12 @@ public:
const std::string& source,
const std::string& entryPoint = "main",
std::vector<std::pair<std::string,std::string>> definitions = {},
const TBuiltInResource resources = defaultResource);
const TBuiltInResource& resources = defaultResource);
private:
// The default resource limit for the GLSL compiler, can be overwritten
// Has been adobted by:
// https://github.com/KhronosGroup/glslang/blob/master/StandAlone/ResourceLimits.cpp
static constexpr TBuiltInResource defaultResource = {
/* .MaxLights = */ 0,
/* .MaxClipPlanes = */ 0,