Skip to content

Commit

Permalink
dep/reshadefx: Avoid emitting more reserved keywords as identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jul 7, 2024
1 parent 6f50e12 commit ff7bfaa
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dep/reshadefx/src/effect_codegen_hlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,27 @@ class codegen_hlsl final : public codegen
// HLSL compiler complains about "technique" and "pass" names in strict mode (no matter the casing)
if (stringicmp(name, "line") ||
stringicmp(name, "pass") ||
stringicmp(name, "technique"))
stringicmp(name, "technique") ||
stringicmp(name, "point") ||
stringicmp(name, "export") ||
stringicmp(name, "extern") ||
stringicmp(name, "compile") ||
stringicmp(name, "discard") ||
stringicmp(name, "half") ||
stringicmp(name, "in") ||
stringicmp(name, "lineadj") ||
stringicmp(name, "matrix") ||
stringicmp(name, "sample") ||
stringicmp(name, "sampler") ||
stringicmp(name, "shared") ||
stringicmp(name, "precise") ||
stringicmp(name, "register") ||
stringicmp(name, "texture") ||
stringicmp(name, "unorm") ||
stringicmp(name, "triangle") ||
stringicmp(name, "triangleadj") ||
stringicmp(name, "out") ||
stringicmp(name, "vector"))
// This is guaranteed to not clash with user defined names, since those starting with an underscore are filtered out in 'define_name'
name = '_' + name;

Expand Down

0 comments on commit ff7bfaa

Please sign in to comment.