spirv2dxil: Fix build after spirv_to_dxil signature change
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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user