spirv2dxil: Fix build after spirv_to_dxil signature change
authorJesse Natalie <jenatali@microsoft.com>
Sat, 4 Sep 2021 17:28:18 +0000 (10:28 -0700)
committerJesse Natalie <jenatali@microsoft.com>
Sun, 5 Sep 2021 02:47:41 +0000 (19:47 -0700)
Fixes: ada05759 ("spirv_to_dxil: Convert out parameters to a single object")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5322
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12728>

src/microsoft/spirv_to_dxil/spirv2dxil.c

index 3f7b427..858f58c 100644 (file)
@@ -121,23 +121,29 @@ main(int argc, char **argv)
 
    size_t word_count = file_size / WORD_SIZE;
 
-   void *data;
-   size_t size;
+   struct dxil_spirv_runtime_conf conf;
+   memset(&conf, 0, sizeof(conf));
+   conf.runtime_data_cbv.base_shader_register = 0;
+   conf.runtime_data_cbv.register_space = 31;
+   conf.zero_based_vertex_instance_id = true;
+
+   struct dxil_spirv_object obj;
+   memset(&obj, 0, sizeof(obj));
    if (spirv_to_dxil((uint32_t *)file_contents, word_count, NULL, 0,
                      (dxil_spirv_shader_stage)shader_stage, entry_point,
-                     &data, &size)) {
+                     &conf, &obj)) {
       FILE *file = fopen(output_file, "wb");
       if (!file) {
          fprintf(stderr, "Failed to open %s, %s\n", output_file,
                  strerror(errno));
-         spirv_to_dxil_free(data);
+         spirv_to_dxil_free(&obj);
          free(file_contents);
          return 1;
       }
 
-      fwrite(data, sizeof(char), size, file);
+      fwrite(obj.binary.buffer, sizeof(char), obj.binary.size, file);
       fclose(file);
-      spirv_to_dxil_free(data);
+      spirv_to_dxil_free(&obj);
    } else {
       fprintf(stderr, "Compilation failed\n");
       return 1;