mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-12 06:50:32 +01:00
nvk: Report NIR shader in pipeline executable properties
All other drivers in mesa report NIR for VK_KHR_pipeline_executable_properties let's do the same as this can be useful to see what we have right before compilation. Signed-off-by: Mary Guillemard <mary@mary.zone> Reviewed-by: Mel Henning <mhenning@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39772>
This commit is contained in:
parent
a274b9c6a8
commit
822da92d68
2 changed files with 14 additions and 0 deletions
|
|
@ -520,6 +520,9 @@ nvk_compile_nir(struct nvk_device *dev, nir_shader *nir,
|
|||
shader->data_size = data_size;
|
||||
}
|
||||
|
||||
if (dump_asm)
|
||||
shader->nir_str = nir_shader_as_str(nir, NULL);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -870,6 +873,7 @@ nvk_shader_destroy(struct vk_device *vk_dev,
|
|||
}
|
||||
|
||||
free((void *)shader->data_ptr);
|
||||
ralloc_free((void *)shader->nir_str);
|
||||
|
||||
vk_shader_free(&dev->vk, pAllocator, &shader->vk);
|
||||
}
|
||||
|
|
@ -1273,6 +1277,15 @@ nvk_shader_get_executable_internal_representations(
|
|||
|
||||
assert(executable_index == 0);
|
||||
|
||||
if (shader->nir_str != NULL) {
|
||||
vk_outarray_append_typed(VkPipelineExecutableInternalRepresentationKHR, &out, ir) {
|
||||
WRITE_STR(ir->name, "NIR shader");
|
||||
WRITE_STR(ir->description, "NIR shader");
|
||||
if (!write_ir_text(ir, shader->nir_str))
|
||||
incomplete_text = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (shader->nak != NULL && shader->nak->asm_str != NULL) {
|
||||
vk_outarray_append_typed(VkPipelineExecutableInternalRepresentationKHR, &out, ir) {
|
||||
WRITE_STR(ir->name, "NAK assembly");
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ struct nvk_shader {
|
|||
float min_sample_shading;
|
||||
|
||||
struct nak_shader_bin *nak;
|
||||
const char *nir_str;
|
||||
const void *code_ptr;
|
||||
uint32_t code_size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue