radv_pipeline_create_ps_epilog(struct radv_graphics_pipeline *pipeline,
const struct radv_pipeline_key *pipeline_key,
VkGraphicsPipelineLibraryFlagBitsEXT lib_flags,
- bool noop_fs)
+ bool noop_fs,
+ struct radv_shader_part_binary **ps_epilog_binary)
{
struct radv_device *device = pipeline->base.device;
bool needs_ps_epilog = false;
}
if (needs_ps_epilog) {
- pipeline->ps_epilog = radv_create_ps_epilog(device, &pipeline_key->ps.epilog);
+ pipeline->ps_epilog =
+ radv_create_ps_epilog(device, &pipeline_key->ps.epilog, ps_epilog_binary);
if (!pipeline->ps_epilog)
return false;
}
const char *noop_fs_entrypoint = "noop_fs";
struct radv_shader_binary *binaries[MESA_VULKAN_SHADER_STAGES] = {NULL};
struct radv_shader_binary *gs_copy_binary = NULL;
+ struct radv_shader_part_binary *ps_epilog_binary = NULL;
unsigned char hash[20];
bool keep_executable_info =
radv_pipeline_capture_shaders(pipeline->base.device, pCreateInfo->flags);
pipeline_feedback.flags |= VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT;
/* TODO: Add PS epilogs to the cache. */
- if (!radv_pipeline_create_ps_epilog(pipeline, pipeline_key, lib_flags, noop_fs))
+ if (!radv_pipeline_create_ps_epilog(pipeline, pipeline_key, lib_flags, noop_fs, NULL))
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
result = VK_SUCCESS;
radv_pipeline_nir_to_asm(pipeline, stages, pipeline_key, pipeline_layout, keep_executable_info,
keep_statistic_info, active_nir_stages, binaries, &gs_copy_binary);
- if (!radv_pipeline_create_ps_epilog(pipeline, pipeline_key, lib_flags, noop_fs))
+ if (!radv_pipeline_create_ps_epilog(pipeline, pipeline_key, lib_flags, noop_fs,
+ &ps_epilog_binary))
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
if (keep_executable_info) {
}
free(gs_copy_binary);
+ free(ps_epilog_binary);
for (int i = 0; i < MESA_VULKAN_SHADER_STAGES; ++i) {
free(binaries[i]);
if (stages[i].nir) {
}
struct radv_shader_part *
-radv_create_ps_epilog(struct radv_device *device, const struct radv_ps_epilog_key *key)
+radv_create_ps_epilog(struct radv_device *device, const struct radv_ps_epilog_key *key,
+ struct radv_shader_part_binary **binary_out)
{
struct radv_shader_part *epilog;
struct radv_shader_args args = {0};
fprintf(stderr, "\ndisasm:\n%s\n", epilog->disasm_string);
}
- free(binary);
+ if (binary_out) {
+ *binary_out = binary;
+ } else {
+ free(binary);
+ }
return epilog;