summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorTheresa Foley <tfoleyNV@users.noreply.github.com>2021-08-11 12:24:43 -0700
committerGitHub <noreply@github.com>2021-08-11 12:24:43 -0700
commit389d21d982da34815b65b10cae63088c397eecc8 (patch)
tree82b1d11a139074845b53bf2971cc0e1c5a2b1f1f /tools/render-test
parent4323a15708cafa6411ec10ef8fefb736f8bda82c (diff)
Handle unexpected character in mangled names (#1919)
This change is related to a case where a user saw a `/` character printed as part of a structure field name in output HLSL (which obviously broke downstream compilation). The root cause in that case was that a module that was `import`ed was found via a file system directory path, and thus the module name that the Slang compiler formed included a `/`. Due to other factors the structure field was emitted based on its mangled name (missing name hint), and that meant the bare `/` escaped into the output. That situation implies some other things maybe are questionable: * Could we have avoided a `/` ending up in the module name to begin with? Maybe, but we kind of want to support non-ASCII characters in names in the long run. * Could we have fixed whatever was causing the name hint to be dropped? Maybe, but we don't ever want name hints to be *required* for valid compilation (hence why they are "hints"). Even if we investigate these other issues, it is important that the name mangling scheme only ever produce output that uses a constrained subset of ASCII that we expect most compilation targets can support (GLSL being an annoying outlier because of its rules around `_`). This change adds a path where when mangling a `Name` as part of a mangled symbol name we check for the presence of bytes that aren't allowed and then produce an escaped form instead if needed. Note that the code is still byte-oriented for now aothough in the long-run it might want to be oriented around Unicode code points or extended grapheme clusters.
Diffstat (limited to 'tools/render-test')
0 files changed, 0 insertions, 0 deletions