mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 14:38:06 +02:00
spirv_to_dxil: expose version number
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12227>
This commit is contained in:
parent
bc3c71b87a
commit
92b0cf8e77
4 changed files with 24 additions and 4 deletions
|
|
@ -21,10 +21,13 @@
|
||||||
|
|
||||||
libspirv_to_dxil = both_libraries(
|
libspirv_to_dxil = both_libraries(
|
||||||
'spirv_to_dxil',
|
'spirv_to_dxil',
|
||||||
files(
|
[
|
||||||
'spirv_to_dxil.c',
|
files(
|
||||||
'spirv_to_dxil.h',
|
'spirv_to_dxil.c',
|
||||||
),
|
'spirv_to_dxil.h',
|
||||||
|
),
|
||||||
|
sha1_h,
|
||||||
|
],
|
||||||
vs_module_defs : 'spirv_to_dxil.def',
|
vs_module_defs : 'spirv_to_dxil.def',
|
||||||
dependencies : [idep_nir, idep_libdxil_compiler],
|
dependencies : [idep_nir, idep_libdxil_compiler],
|
||||||
include_directories : [inc_include, inc_src, inc_compiler, inc_gallium],
|
include_directories : [inc_include, inc_src, inc_compiler, inc_gallium],
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
#include "spirv/nir_spirv.h"
|
#include "spirv/nir_spirv.h"
|
||||||
#include "util/blob.h"
|
#include "util/blob.h"
|
||||||
|
|
||||||
|
#include "git_sha1.h"
|
||||||
|
|
||||||
bool
|
bool
|
||||||
spirv_to_dxil(const uint32_t *words, size_t word_count,
|
spirv_to_dxil(const uint32_t *words, size_t word_count,
|
||||||
struct dxil_spirv_specialization *specializations,
|
struct dxil_spirv_specialization *specializations,
|
||||||
|
|
@ -173,3 +175,14 @@ spirv_to_dxil_free(void* buffer)
|
||||||
{
|
{
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
spirv_to_dxil_get_version()
|
||||||
|
{
|
||||||
|
const char sha1[] = MESA_GIT_SHA1;
|
||||||
|
const char* dash = strchr(sha1, '-');
|
||||||
|
if (dash) {
|
||||||
|
return strtoull(dash + 1, NULL, 16);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
EXPORTS
|
EXPORTS
|
||||||
spirv_to_dxil
|
spirv_to_dxil
|
||||||
spirv_to_dxil_free
|
spirv_to_dxil_free
|
||||||
|
spirv_to_dxil_get_version
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,9 @@ spirv_to_dxil(const uint32_t* words,
|
||||||
void
|
void
|
||||||
spirv_to_dxil_free(void* buffer);
|
spirv_to_dxil_free(void* buffer);
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
spirv_to_dxil_get_version();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue