Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
}
}
+ if (keep_executable_info) {
+ for (int i = 0; i < MESA_VULKAN_SHADER_STAGES; ++i) {
+ struct radv_shader *shader = pipeline->shaders[i];
+ if (!shader)
+ continue;
+
+ if (!modules[i] || modules[i]->nir)
+ continue;
+
+ shader->spirv = malloc(modules[i]->size);
+ memcpy(shader->spirv, modules[i]->data, modules[i]->size);
+ shader->spirv_size = modules[i]->size;
+ }
+ }
+
/* Upload shader binaries. */
radv_upload_shaders(device, pipeline, binaries, gs_copy_binary);
if (keep_shader_info) {
shader->nir_string = radv_dump_nir_shaders(shaders, shader_count);
- if (!gs_copy_shader && !trap_handler_shader && !module->nir) {
- shader->spirv = malloc(module->size);
- if (!shader->spirv) {
- free(shader);
- free(binary);
- return NULL;
- }
-
- memcpy(shader->spirv, module->data, module->size);
- shader->spirv_size = module->size;
- }
}
/* Copy the shader binary configuration to store it in the cache. */