summaryrefslogtreecommitdiff
path: root/source/slang/slang-lookup-glslstd450.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-01-24 17:29:09 +0800
committerGitHub <noreply@github.com>2024-01-24 17:29:09 +0800
commit4e7e820c3dda716334ccbe9854379e46d8d332bb (patch)
tree2b1456d26133d901c397bd64391494ed1ac44c41 /source/slang/slang-lookup-glslstd450.cpp
parentba4baf41155afcc4943dcc3887a7c7a324607939 (diff)
Generate lookup tables from cmake (#3461)
* Generate lookup tables from cmake * Correct add_custom_command generator dependencies * set options for lookup table source * include path * use slang_add_target for capability generated targets * vs project regenerate * ci wobble --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-lookup-glslstd450.cpp')
-rw-r--r--source/slang/slang-lookup-glslstd450.cpp132
1 files changed, 0 insertions, 132 deletions
diff --git a/source/slang/slang-lookup-glslstd450.cpp b/source/slang/slang-lookup-glslstd450.cpp
deleted file mode 100644
index 2920335ec..000000000
--- a/source/slang/slang-lookup-glslstd450.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// Hash function for GLSLstd450
-//
-// This file was thoughtfully generated by a machine,
-// don't even think about modifying it yourself!
-//
-
-#include "../core/slang-common.h"
-#include "../core/slang-string.h"
-#include "spirv/unified1/GLSL.std.450.h"
-
-
-namespace Slang
-{
-
-bool lookupGLSLstd450(const UnownedStringSlice& str, GLSLstd450& value)
-{
- static const unsigned tableSalt[81] = {
- 1, 3, 0, 0, 6, 1, 2, 3, 0, 0, 0, 1, 4, 0, 1, 0,
- 0, 0, 1, 3, 0, 0, 5, 0, 2, 0, 0, 0, 0, 0, 1, 0,
- 2, 1, 1, 1, 8, 3, 1, 3, 0, 0, 3, 0, 3, 0, 9, 0,
- 16, 0, 1, 0, 2, 0, 1, 1, 0, 0, 0, 2, 16, 15, 6, 1,
- 1, 2, 2, 7, 7, 2, 24, 0, 16, 27, 1, 1, 176, 0, 11, 0,
- 6
- };
-
- using KV = std::pair<const char*, GLSLstd450>;
-
- static const KV words[81] =
- {
- {"InterpolateAtOffset", GLSLstd450InterpolateAtOffset},
- {"Floor", GLSLstd450Floor},
- {"UnpackDouble2x32", GLSLstd450UnpackDouble2x32},
- {"Acosh", GLSLstd450Acosh},
- {"FindUMsb", GLSLstd450FindUMsb},
- {"Sinh", GLSLstd450Sinh},
- {"NMin", GLSLstd450NMin},
- {"Cos", GLSLstd450Cos},
- {"UMax", GLSLstd450UMax},
- {"Sqrt", GLSLstd450Sqrt},
- {"Frexp", GLSLstd450Frexp},
- {"Determinant", GLSLstd450Determinant},
- {"ModfStruct", GLSLstd450ModfStruct},
- {"PackSnorm4x8", GLSLstd450PackSnorm4x8},
- {"FrexpStruct", GLSLstd450FrexpStruct},
- {"Cross", GLSLstd450Cross},
- {"FClamp", GLSLstd450FClamp},
- {"Fract", GLSLstd450Fract},
- {"FaceForward", GLSLstd450FaceForward},
- {"MatrixInverse", GLSLstd450MatrixInverse},
- {"PackUnorm4x8", GLSLstd450PackUnorm4x8},
- {"Log2", GLSLstd450Log2},
- {"Reflect", GLSLstd450Reflect},
- {"Radians", GLSLstd450Radians},
- {"Round", GLSLstd450Round},
- {"InverseSqrt", GLSLstd450InverseSqrt},
- {"Exp", GLSLstd450Exp},
- {"Normalize", GLSLstd450Normalize},
- {"UnpackSnorm2x16", GLSLstd450UnpackSnorm2x16},
- {"InterpolateAtCentroid", GLSLstd450InterpolateAtCentroid},
- {"Refract", GLSLstd450Refract},
- {"Fma", GLSLstd450Fma},
- {"UClamp", GLSLstd450UClamp},
- {"FAbs", GLSLstd450FAbs},
- {"RoundEven", GLSLstd450RoundEven},
- {"FSign", GLSLstd450FSign},
- {"SSign", GLSLstd450SSign},
- {"Asinh", GLSLstd450Asinh},
- {"PackHalf2x16", GLSLstd450PackHalf2x16},
- {"Tan", GLSLstd450Tan},
- {"SMin", GLSLstd450SMin},
- {"Degrees", GLSLstd450Degrees},
- {"PackSnorm2x16", GLSLstd450PackSnorm2x16},
- {"FMix", GLSLstd450FMix},
- {"Atan2", GLSLstd450Atan2},
- {"PackUnorm2x16", GLSLstd450PackUnorm2x16},
- {"NMax", GLSLstd450NMax},
- {"NClamp", GLSLstd450NClamp},
- {"FindSMsb", GLSLstd450FindSMsb},
- {"Atanh", GLSLstd450Atanh},
- {"Atan", GLSLstd450Atan},
- {"Modf", GLSLstd450Modf},
- {"Cosh", GLSLstd450Cosh},
- {"Exp2", GLSLstd450Exp2},
- {"Tanh", GLSLstd450Tanh},
- {"UMin", GLSLstd450UMin},
- {"FMin", GLSLstd450FMin},
- {"Log", GLSLstd450Log},
- {"SAbs", GLSLstd450SAbs},
- {"IMix", GLSLstd450IMix},
- {"Step", GLSLstd450Step},
- {"InterpolateAtSample", GLSLstd450InterpolateAtSample},
- {"UnpackHalf2x16", GLSLstd450UnpackHalf2x16},
- {"PackDouble2x32", GLSLstd450PackDouble2x32},
- {"FMax", GLSLstd450FMax},
- {"Length", GLSLstd450Length},
- {"Distance", GLSLstd450Distance},
- {"SmoothStep", GLSLstd450SmoothStep},
- {"UnpackUnorm2x16", GLSLstd450UnpackUnorm2x16},
- {"SMax", GLSLstd450SMax},
- {"UnpackSnorm4x8", GLSLstd450UnpackSnorm4x8},
- {"Asin", GLSLstd450Asin},
- {"UnpackUnorm4x8", GLSLstd450UnpackUnorm4x8},
- {"Ldexp", GLSLstd450Ldexp},
- {"Ceil", GLSLstd450Ceil},
- {"SClamp", GLSLstd450SClamp},
- {"Trunc", GLSLstd450Trunc},
- {"Sin", GLSLstd450Sin},
- {"Pow", GLSLstd450Pow},
- {"FindILsb", GLSLstd450FindILsb},
- {"Acos", GLSLstd450Acos},
- };
-
- static const auto hash = [](const UnownedStringSlice& str, UInt32 salt){
- UInt32 h = salt;
- for (const char c : str)
- h = (h * 0x01000193) ^ c;
- return h % 81;
- };
-
- const auto i = hash(str, tableSalt[hash(str, 0)]);
- if(str == words[i].first)
- {
- value = words[i].second;
- return true;
- }
- else
- {
- return false;
- }
-}
-
-}