Merge pull request #15 from RandomShaper/bye_bye_dxil_dll

Remove patch to the no longer needed validation feature
This commit is contained in:
Rémi Verschelde
2024-07-11 23:17:32 +02:00
committed by GitHub

View File

@@ -657,59 +657,6 @@ index ca170c5..7fab628 100644
};
struct dxil_instr;
diff --git a/godot-mesa/src/microsoft/compiler/dxil_validator.cpp b/godot-mesa/src/microsoft/compiler/dxil_validator.cpp
index 4b68957..ece1e46 100644
--- a/godot-mesa/src/microsoft/compiler/dxil_validator.cpp
+++ b/godot-mesa/src/microsoft/compiler/dxil_validator.cpp
@@ -25,6 +25,7 @@ struct dxil_validator {
extern "C" {
extern IMAGE_DOS_HEADER __ImageBase;
+extern char godot_nir_arch_name[32];
}
static HMODULE
@@ -36,7 +37,10 @@ load_dxil_mod()
#elif defined (_GAMING_XBOX)
HMODULE mod = LoadLibraryA("dxcompiler_x.dll");
#else
- HMODULE mod = LoadLibraryA("DXIL.dll");
+ HMODULE mod = NULL;
+ if (!godot_nir_arch_name[0]) {
+ mod = LoadLibraryA("DXIL.dll");
+ }
#endif
if (mod)
return mod;
@@ -60,12 +64,27 @@ load_dxil_mod()
}
*(last_slash + 1) = '\0';
+
+ if (godot_nir_arch_name[0]) {
+ strcat_s(self_path, godot_nir_arch_name);
+ strcat_s(self_path, "\\");
+ }
+
if (strcat_s(self_path, "DXIL.dll") != 0) {
debug_printf("DXIL: Unable to get path to DXIL.dll next to self");
return NULL;
}
- return LoadLibraryA(self_path);
+ mod = LoadLibraryA(self_path);
+ if (mod)
+ return mod;
+
+ mod = LoadLibraryA("DXIL.dll");
+ if (mod)
+ return mod;
+
+ godot_nir_arch_name[0] = '\0';
+ return nullptr;
}
static IDxcValidator *
diff --git a/godot-mesa/src/microsoft/compiler/nir_to_dxil.c b/godot-mesa/src/microsoft/compiler/nir_to_dxil.c
index c4de9dd..3c0223f 100644
--- a/godot-mesa/src/microsoft/compiler/nir_to_dxil.c