mirror of https://gitlab.freedesktop.org/mesa/mesa
clc: add clc_validate_spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
This commit is contained in:
parent
ab032f4bfd
commit
8fcfc51dad
|
@ -1149,6 +1149,17 @@ clc_link_spirv_binaries(const struct clc_linker_args *args,
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
clc_validate_spirv(const struct clc_binary *spirv,
|
||||
const struct clc_logger *logger)
|
||||
{
|
||||
SPIRVMessageConsumer msgconsumer(logger);
|
||||
spvtools::SpirvTools tools(spirv_target);
|
||||
tools.SetMessageConsumer(msgconsumer);
|
||||
const uint32_t *data = static_cast<const uint32_t *>(spirv->data);
|
||||
return tools.Validate(data, spirv->size / 4);
|
||||
}
|
||||
|
||||
int
|
||||
clc_spirv_specialize(const struct clc_binary *in_spirv,
|
||||
const struct clc_parsed_spirv *parsed_data,
|
||||
|
|
|
@ -73,6 +73,10 @@ clc_link_spirv_binaries(const struct clc_linker_args *args,
|
|||
const struct clc_logger *logger,
|
||||
struct clc_binary *out_spirv);
|
||||
|
||||
bool
|
||||
clc_validate_spirv(const struct clc_binary *spirv,
|
||||
const struct clc_logger *logger);
|
||||
|
||||
int
|
||||
clc_spirv_specialize(const struct clc_binary *in_spirv,
|
||||
const struct clc_parsed_spirv *parsed_data,
|
||||
|
|
Loading…
Reference in New Issue