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:
@@ -37,9 +37,9 @@
|
||||
#include <sstream>
|
||||
#include <cctype>
|
||||
|
||||
#include "ResourceLimits.h"
|
||||
#include "glslang/Public/ResourceLimits.h"
|
||||
|
||||
namespace glslang {
|
||||
TBuiltInResource Resources;
|
||||
|
||||
const TBuiltInResource DefaultTBuiltInResource = {
|
||||
/* .MaxLights = */ 32,
|
||||
@@ -529,4 +529,12 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
TBuiltInResource* GetResources()
|
||||
{
|
||||
return &Resources;
|
||||
}
|
||||
|
||||
const TBuiltInResource* GetDefaultResources()
|
||||
{
|
||||
return &DefaultTBuiltInResource;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user