mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
compiler: drop vtn_bindgen
Now unused Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33329>
This commit is contained in:
parent
4f9eace864
commit
6d5375017a
3 changed files with 1 additions and 87 deletions
|
|
@ -833,7 +833,7 @@ with_driver_using_cl = with_gallium_iris or with_intel_vk or \
|
|||
|
||||
if get_option('mesa-clc') == 'system'
|
||||
prog_mesa_clc = find_program('mesa_clc', native : true)
|
||||
prog_vtn_bindgen = find_program('vtn_bindgen', native : true)
|
||||
prog_vtn_bindgen2 = find_program('vtn_bindgen2', native : true)
|
||||
# Even with mesa-clc already built, rusticl still needs clc.
|
||||
with_clc = with_gallium_rusticl
|
||||
else
|
||||
|
|
|
|||
|
|
@ -79,19 +79,6 @@ spirv2nir = executable(
|
|||
|
||||
if get_option('mesa-clc') != 'system' and (with_driver_using_cl or \
|
||||
get_option('install-mesa-clc'))
|
||||
prog_vtn_bindgen = executable(
|
||||
'vtn_bindgen',
|
||||
['vtn_bindgen.c'],
|
||||
include_directories : [inc_include, inc_src],
|
||||
c_args : [c_msvc_compat_args, no_override_init_args],
|
||||
dependencies : [idep_vtn, idep_mesautil],
|
||||
# If we can run host binaries directly, just build vtn_bindgen for the host.
|
||||
# Most commonly this happens when doing a cross compile from an x86_64 build
|
||||
# machine to an x86 host
|
||||
native : not meson.can_run_host_binaries(),
|
||||
install : get_option('install-mesa-clc'),
|
||||
)
|
||||
|
||||
prog_vtn_bindgen2 = executable(
|
||||
'vtn_bindgen2',
|
||||
['vtn_bindgen2.c'],
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* Copyright 2024 Valve Corporation
|
||||
* Copyright 2023 Alyssa Rosenzweig
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "compiler/spirv/nir_spirv.h"
|
||||
|
||||
static const struct spirv_to_nir_options spirv_options = {
|
||||
.environment = NIR_SPIRV_OPENCL,
|
||||
.shared_addr_format = nir_address_format_62bit_generic,
|
||||
.global_addr_format = nir_address_format_62bit_generic,
|
||||
.temp_addr_format = nir_address_format_62bit_generic,
|
||||
.constant_addr_format = nir_address_format_64bit_global,
|
||||
.create_library = true,
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 3) {
|
||||
fprintf(stderr, "Usage: %s [input spir-v] [output header]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *infile = argv[1];
|
||||
const char *outfile = argv[2];
|
||||
|
||||
FILE *fin = fopen(infile, "rb");
|
||||
if (!fin) {
|
||||
fprintf(stderr, "Failed to open %s\n", infile);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fseek(fin, 0L, SEEK_END);
|
||||
size_t len = ftell(fin);
|
||||
rewind(fin);
|
||||
|
||||
uint32_t *map = malloc(ALIGN_POT(len, 4));
|
||||
if (!map) {
|
||||
fprintf(stderr, "Failed to allocate");
|
||||
fclose(fin);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fread(map, 1, len, fin);
|
||||
fclose(fin);
|
||||
|
||||
FILE *fout = fopen(outfile, "w");
|
||||
if (!fout) {
|
||||
fprintf(stderr, "Failed to open %s\n", outfile);
|
||||
free(map);
|
||||
return 1;
|
||||
}
|
||||
|
||||
glsl_type_singleton_init_or_ref();
|
||||
|
||||
fprintf(fout, "/*\n");
|
||||
fprintf(fout, " * Copyright Mesa3D Contributors\n");
|
||||
fprintf(fout, " * SPDX-License-Identifier: MIT\n");
|
||||
fprintf(fout, " *\n");
|
||||
fprintf(fout, " * Autogenerated file, do not edit\n");
|
||||
fprintf(fout, " */\n");
|
||||
fprintf(fout, "#pragma once\n");
|
||||
fprintf(fout, "#include <stdint.h>\n");
|
||||
|
||||
spirv_library_to_nir_builder(fout, map, len / 4, &spirv_options);
|
||||
|
||||
glsl_type_singleton_decref();
|
||||
fclose(fout);
|
||||
free(map);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue