浏览代码

vulkan: sort shaders for more deterministic binary (#11315)

Fixes #11306.
Jeff Bolz 11 月之前
父节点
当前提交
1971adf55e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

+ 2 - 1
ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

@@ -17,13 +17,13 @@
 #include <cstring>
 #include <cstring>
 #include <cstdlib>
 #include <cstdlib>
 #include <cassert>
 #include <cassert>
+#include <algorithm>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/types.h>
 
 
 #ifdef _WIN32
 #ifdef _WIN32
     #include <windows.h>
     #include <windows.h>
     #include <direct.h> // For _mkdir on Windows
     #include <direct.h> // For _mkdir on Windows
-    #include <algorithm> // For std::replace on w64devkit
 #else
 #else
     #include <unistd.h>
     #include <unistd.h>
     #include <sys/wait.h>
     #include <sys/wait.h>
@@ -502,6 +502,7 @@ void write_output_files() {
     fprintf(hdr, "#include <cstdint>\n\n");
     fprintf(hdr, "#include <cstdint>\n\n");
     fprintf(src, "#include \"%s\"\n\n", basename(target_hpp).c_str());
     fprintf(src, "#include \"%s\"\n\n", basename(target_hpp).c_str());
 
 
+    std::sort(shader_fnames.begin(), shader_fnames.end());
     for (const auto& pair : shader_fnames) {
     for (const auto& pair : shader_fnames) {
         const std::string& name = pair.first;
         const std::string& name = pair.first;
         #ifdef _WIN32
         #ifdef _WIN32