Files
UnrealEngineUWP/Engine/Source/Developer
dan elksnitis 6aa37eca15 [shaders] additions & fixes to STB preprocessor for shader preprocessing. With the following all Lyra shaders compile and generate identical bytecode on PC SM5/6.
- add explicit extern "C" on preprocessor methods to allow linking from C++ code
- add custom callbacks for include path resolution and file loading/unloading
- add padding space following macro expansion ending with a > to work around DXC bug (not handling >> correctly if it occurs at the end of a templated type)
- adding explicit handling for HLSL infinity constant (1.#INF); the # character outside of a directive was previously putting the preprocessor into an error state
- change line directive output to use #line format rather than # (DXC is ok with the latter but minifier doesn't currently handle it), and also always include the filename (so when minifying don't have to be careful not to strip the line directive with the filename in it); this also matches mcpp behaviour
- adding const-correctness and casts where needed to avoid const casts/compile errors in calling C++ code and satisfy Mac/Intellisense compilers
- bugfix: parsing of '.' was immediately putting the scanning state machine into "number" mode resulting in skipped macro expansion in code of the form "var.MACRO.var2"/numbers; added extra state transitions and changing the default transition when encountering '.' to an explicit mode that can allow either transitioning to parsing identifiers or numbers depending on following characters.
- bugfix: macros with an empty parameter list were incorrectly terminating said list on expansion (adding extra rparens)
- bugfix: set file load mode as "callback" when callback used for loading, and check the mode in the free callbacks
- various minor changes to satisfy Clang code analysis

#preflight 637e3391e30d438849ddf902
#rb Yuriy.ODonnell

[CL 23249332 by dan elksnitis in ue5-main branch]
2022-11-23 09:58:24 -05:00
..
2022-09-20 15:39:39 -04:00
2022-10-19 16:01:55 -04:00
2022-10-29 02:59:59 -04:00
2022-11-03 17:59:46 -04:00
2022-11-01 16:02:53 -04:00
2022-11-18 10:10:41 -05:00