aco/tests: Assert that the requested IR is actually provided

In particular, assembly will not be provided if no disassembler is available
for the given GPU architecture.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
This commit is contained in:
Tony Wasserka 2021-09-28 17:59:43 +02:00
parent 3c1802accd
commit b70e551a51
1 changed files with 20 additions and 17 deletions

View File

@ -386,28 +386,31 @@ void print_pipeline_ir(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBi
result = GetPipelineExecutableInternalRepresentationsKHR(device, &exec_info, &ir_count, ir);
assert(result == VK_SUCCESS);
for (unsigned i = 0; i < ir_count; i++) {
if (strcmp(ir[i].name, name))
continue;
VkPipelineExecutableInternalRepresentationKHR* requested_ir = nullptr;
for (unsigned i = 0; i < ir_count; ++i) {
if (strcmp(ir[i].name, name) == 0) {
requested_ir = &ir[i];
break;
}
}
assert(requested_ir && "Could not find requested IR");
char *data = (char*)malloc(ir[i].dataSize);
ir[i].pData = data;
result = GetPipelineExecutableInternalRepresentationsKHR(device, &exec_info, &ir_count, ir);
assert(result == VK_SUCCESS);
char *data = (char*)malloc(requested_ir->dataSize);
requested_ir->pData = data;
result = GetPipelineExecutableInternalRepresentationsKHR(device, &exec_info, &ir_count, ir);
assert(result == VK_SUCCESS);
if (remove_encoding) {
for (char *c = data; *c; c++) {
if (*c == ';') {
for (; *c && *c != '\n'; c++)
*c = ' ';
}
if (remove_encoding) {
for (char *c = data; *c; c++) {
if (*c == ';') {
for (; *c && *c != '\n'; c++)
*c = ' ';
}
}
fprintf(output, "%s", data);
free(data);
return;
}
fprintf(output, "%s", data);
free(data);
}
VkShaderModule __qoCreateShaderModule(VkDevice dev, const QoShaderModuleCreateInfo *module_info)