Module: Mesa Branch: main Commit: 75415e58e3968b483905ed38be8ca4442ef4bafb URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=75415e58e3968b483905ed38be8ca4442ef4bafb
Author: Caleb Cornett <[email protected]> Date: Wed Jan 11 10:48:56 2023 -0500 dxil_validator: Add support for Xbox GDK. In addition to the DLL names being different, we don't have to do the versioning work since we don't have to fuss with known bad versions (for example). Co-authored-by: Ethan Lee <[email protected]> Co-authored-by: David Jacewicz <[email protected]> Co-authored-by: tieuchanlong <[email protected]> Reviewed-by: Jesse Natalie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022> --- src/microsoft/compiler/dxil_validator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/microsoft/compiler/dxil_validator.cpp b/src/microsoft/compiler/dxil_validator.cpp index cda43ca7939..4b68957a7da 100644 --- a/src/microsoft/compiler/dxil_validator.cpp +++ b/src/microsoft/compiler/dxil_validator.cpp @@ -31,7 +31,13 @@ static HMODULE load_dxil_mod() { /* First, try to load DXIL.dll from the default search-path */ +#if defined(_GAMING_XBOX_SCARLETT) + HMODULE mod = LoadLibraryA("dxcompiler_xs.dll"); +#elif defined (_GAMING_XBOX) + HMODULE mod = LoadLibraryA("dxcompiler_x.dll"); +#else HMODULE mod = LoadLibraryA("DXIL.dll"); +#endif if (mod) return mod; @@ -101,6 +107,7 @@ get_validator_version(IDxcValidator *val) return NO_DXIL_VALIDATION; } +#ifndef _GAMING_XBOX static uint64_t get_dll_version(HMODULE mod) { @@ -139,11 +146,13 @@ get_dll_version(HMODULE mod) free(version_data); return ret; } +#endif static enum dxil_validator_version get_filtered_validator_version(HMODULE mod, enum dxil_validator_version raw) { switch (raw) { +#ifndef _GAMING_XBOX case DXIL_VALIDATOR_1_6: { uint64_t dxil_version = get_dll_version(mod); static constexpr uint64_t known_bad_version = @@ -153,6 +162,7 @@ get_filtered_validator_version(HMODULE mod, enum dxil_validator_version raw) return DXIL_VALIDATOR_1_5; FALLTHROUGH; } +#endif default: return raw; }
