Improve ResourceLimits interface to be more forward compatible
New interface allows users to generate ResourceLimits for interface so that additions to TBuiltInResource do not break the ABI. Users should use the glslang-default-resource-limits library and the Public/ResourceLimits.h header. Similar changes have been made to the C interface. Use Public/resource_limits_c.h. Fixes #2822
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
#include "SPIRV/disassemble.h"
|
||||
#include "SPIRV/doc.h"
|
||||
#include "SPIRV/SPVRemapper.h"
|
||||
#include "StandAlone/ResourceLimits.h"
|
||||
#include "glslang/Public/ResourceLimits.h"
|
||||
#include "glslang/Public/ShaderLang.h"
|
||||
|
||||
#include "Initializer.h"
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
shader->setStringsWithLengths(&shaderStrings, &shaderLengths, 1);
|
||||
if (!entryPointName.empty()) shader->setEntryPoint(entryPointName.c_str());
|
||||
return shader->parse(
|
||||
(resources ? resources : &glslang::DefaultTBuiltInResource),
|
||||
(resources ? resources : GetDefaultResources()),
|
||||
defaultVersion, isForwardCompatible, controls);
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ public:
|
||||
std::string ppShader;
|
||||
glslang::TShader::ForbidIncluder includer;
|
||||
const bool success = shader.preprocess(
|
||||
&glslang::DefaultTBuiltInResource, defaultVersion, defaultProfile,
|
||||
GetDefaultResources(), defaultVersion, defaultProfile,
|
||||
forceVersionProfile, isForwardCompatible, (EShMessages)(EShMsgOnlyPreprocessor | EShMsgCascadingErrors),
|
||||
&ppShader, includer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user