Skip to content

Commit

Permalink
CustomPipeline: Mark arrays as constexpr
Browse files Browse the repository at this point in the history
Ensures that these go into the ro section.
  • Loading branch information
lioncash committed Feb 1, 2024
1 parent cb7083d commit 2539888
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ namespace
{
bool IsQualifier(std::string_view value)
{
static std::array<std::string_view, 7> qualifiers = {"attribute", "const", "highp", "lowp",
"mediump", "uniform", "varying"};
static constexpr std::array<std::string_view, 7> qualifiers = {
"attribute", "const", "highp", "lowp", "mediump", "uniform", "varying",
};
return std::find(qualifiers.begin(), qualifiers.end(), value) != qualifiers.end();
}

bool IsBuiltInMacro(std::string_view value)
{
static std::array<std::string_view, 5> built_in = {"__LINE__", "__FILE__", "__VERSION__",
"GL_core_profile", "GL_compatibility_profile"};
static constexpr std::array<std::string_view, 5> built_in = {
"__LINE__", "__FILE__", "__VERSION__", "GL_core_profile", "GL_compatibility_profile",
};
return std::find(built_in.begin(), built_in.end(), value) != built_in.end();
}

Expand Down

0 comments on commit 2539888

Please sign in to comment.