mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:58:28 +02:00
Fix overlimit shader char strings
This commit is contained in:
parent
c8bb26ae74
commit
f611990b10
3 changed files with 9 additions and 8 deletions
|
@ -83,7 +83,7 @@ enum DeferredShader_BufferSlot {
|
||||||
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
static void loadLightProgram(const std::string& vertSource, const std::string& fragSource, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
||||||
|
|
||||||
void DeferredLightingEffect::init() {
|
void DeferredLightingEffect::init() {
|
||||||
_directionalAmbientSphereLightLocations = std::make_shared<LightLocations>();
|
_directionalAmbientSphereLightLocations = std::make_shared<LightLocations>();
|
||||||
|
@ -171,9 +171,9 @@ void DeferredLightingEffect::unsetLocalLightsBatch(gpu::Batch& batch, int cluste
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* fragSource, LightLocationsPtr& locations) {
|
static gpu::ShaderPointer makeLightProgram(const std::string& vertSource, const std::string& fragSource, LightLocationsPtr& locations) {
|
||||||
auto VS = gpu::Shader::createVertex(std::string(vertSource));
|
auto VS = gpu::Shader::createVertex(vertSource);
|
||||||
auto PS = gpu::Shader::createPixel(std::string(fragSource));
|
auto PS = gpu::Shader::createPixel(fragSource);
|
||||||
|
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* f
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
static void loadLightProgram(const std::string& vertSource, const std::string& fragSource, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
||||||
|
|
||||||
gpu::ShaderPointer program = makeLightProgram(vertSource, fragSource, locations);
|
gpu::ShaderPointer program = makeLightProgram(vertSource, fragSource, locations);
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ const std::string PIXEL_SHADER_DEFINES{ R"GLSL(
|
||||||
#define GPU_TRANSFORM_STEREO_SPLIT_SCREEN
|
#define GPU_TRANSFORM_STEREO_SPLIT_SCREEN
|
||||||
)GLSL" };
|
)GLSL" };
|
||||||
|
|
||||||
void testShaderBuild(const char* vs_src, const char * fs_src) {
|
void testShaderBuild(const std::string& vs_src, const std::string& fs_src) {
|
||||||
std::string error;
|
std::string error;
|
||||||
std::vector<char> binary;
|
std::vector<char> binary;
|
||||||
GLuint vs, fs;
|
GLuint vs, fs;
|
||||||
|
|
|
@ -211,12 +211,13 @@ int main (int argc, char** argv) {
|
||||||
targetStringStream << "// File generated by Scribe " << vars["_SCRIBE_DATE"] << std::endl;
|
targetStringStream << "// File generated by Scribe " << vars["_SCRIBE_DATE"] << std::endl;
|
||||||
targetStringStream << "#ifndef scribe_" << targetName << "_h" << std::endl;
|
targetStringStream << "#ifndef scribe_" << targetName << "_h" << std::endl;
|
||||||
targetStringStream << "#define scribe_" << targetName << "_h" << std::endl << std::endl;
|
targetStringStream << "#define scribe_" << targetName << "_h" << std::endl << std::endl;
|
||||||
|
targetStringStream << "#include <string>" << std::endl << std::endl;
|
||||||
|
|
||||||
targetStringStream << "const char " << targetName << "[] = \n";
|
targetStringStream << "static std::string " << targetName << " = std::string()\n";
|
||||||
|
|
||||||
// Write the pages content
|
// Write the pages content
|
||||||
for (auto page : pages) {
|
for (auto page : pages) {
|
||||||
targetStringStream << "R\"SCRIBE(\n" << page->str() << "\n)SCRIBE\"\n";
|
targetStringStream << "+ std::string(R\"SCRIBE(\n" << page->str() << "\n)SCRIBE\")\n";
|
||||||
}
|
}
|
||||||
targetStringStream << ";\n" << std::endl << std::endl;
|
targetStringStream << ";\n" << std::endl << std::endl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue