diff options
author | Daniel Story <daniel.story@ntd.nintendo.com> | 2022-12-21 11:53:23 -0800 |
---|---|---|
committer | Daniel Story [NTD] <daniel.story@ntd.nintendo.com> | 2022-12-21 11:53:50 -0800 |
commit | a88f67412426860da8efdfe0ce247ae7c95f7572 (patch) | |
tree | 9964af19cbf8a9afb8bc918808e25e214b342e5b | |
parent | dcae18737622fac35ee9c48e44fa487cf524af9d (diff) | |
download | glslang-a88f67412426860da8efdfe0ce247ae7c95f7572.tar.gz |
Fix issues with MaxDualSourceDrawBuffersEXT
-rw-r--r-- | StandAlone/ResourceLimits.cpp | 2 | ||||
-rw-r--r-- | glslang/Include/glslang_c_interface.h | 8 | ||||
-rw-r--r-- | gtests/BuiltInResource.FromFile.cpp | 10 |
3 files changed, 19 insertions, 1 deletions
diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp index 6e1a3d85..0e9d1b54 100644 --- a/StandAlone/ResourceLimits.cpp +++ b/StandAlone/ResourceLimits.cpp @@ -505,6 +505,8 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config) resources->maxTaskWorkGroupSizeZ_EXT = value; else if (tokenStr == "MaxMeshViewCountEXT") resources->maxMeshViewCountEXT = value; + else if (tokenStr == "MaxDualSourceDrawBuffersEXT") + resources->maxDualSourceDrawBuffersEXT = value; else if (tokenStr == "nonInductiveForLoops") resources->limits.nonInductiveForLoops = (value != 0); else if (tokenStr == "whileLoops") diff --git a/glslang/Include/glslang_c_interface.h b/glslang/Include/glslang_c_interface.h index f540f26d..28d52330 100644 --- a/glslang/Include/glslang_c_interface.h +++ b/glslang/Include/glslang_c_interface.h @@ -157,7 +157,13 @@ typedef struct glslang_resource_s { int max_task_work_group_size_y_ext; int max_task_work_group_size_z_ext; int max_mesh_view_count_ext; - int maxDualSourceDrawBuffersEXT; + union + { + int max_dual_source_draw_buffers_ext; + + /* Incorrectly capitalized name retained for backward compatibility */ + int maxDualSourceDrawBuffersEXT; + }; glslang_limits_t limits; } glslang_resource_t; diff --git a/gtests/BuiltInResource.FromFile.cpp b/gtests/BuiltInResource.FromFile.cpp index 9a7c9b57..eeea5118 100644 --- a/gtests/BuiltInResource.FromFile.cpp +++ b/gtests/BuiltInResource.FromFile.cpp @@ -53,5 +53,15 @@ TEST_F(DefaultResourceTest, FromFile) ASSERT_EQ(expectedConfig, realConfig); } +TEST_F(DefaultResourceTest, UnrecognizedLimit) +{ + const std::string defaultConfig = GetDefaultTBuiltInResourceString(); + testing::internal::CaptureStdout(); + TBuiltInResource resources; + DecodeResourceLimits(&resources, const_cast<char*>(defaultConfig.c_str())); + std::string output = testing::internal::GetCapturedStdout(); + ASSERT_EQ(output.find("unrecognized limit"), std::string::npos); +} + } // anonymous namespace } // namespace glslangtest |