Skip to content

Commit

Permalink
Merge pull request #15 from RandomShaper/bye_bye_dxil_dll
Browse files Browse the repository at this point in the history
Remove patch to the no longer needed validation feature
  • Loading branch information
akien-mga authored Jul 11, 2024
2 parents e101346 + 1e66fa0 commit 27a49f8
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions godot-patches/01_godot_nir_goodies.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27a49f8

Please sign in to comment.