[FFmpeg-cvslog] vulkan_shaderc: fix error reporting for certain errors

Lynne git at videolan.org
Sun Aug 11 06:21:05 EEST 2024


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Wed Jul 24 00:53:28 2024 +0200| [2f7dfb0d157b680bca68bc9e57f7c3529fbfc0fe] | committer: Lynne

vulkan_shaderc: fix error reporting for certain errors

The issue is that shaderc_result_get_num_errors may sometime
return 0 even when shaderc_result_get_compilation_status returns
a non-zero error code.
Since we use the result from the former, override the status
if it returned 0.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f7dfb0d157b680bca68bc9e57f7c3529fbfc0fe
---

 libavfilter/vulkan_shaderc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vulkan_shaderc.c b/libavfilter/vulkan_shaderc.c
index 38be1030ad..455e81767e 100644
--- a/libavfilter/vulkan_shaderc.c
+++ b/libavfilter/vulkan_shaderc.c
@@ -65,6 +65,9 @@ static int shdc_shader_compile(FFVkSPIRVCompiler *ctx, void *avctx,
     warn = shaderc_result_get_num_warnings(res);
     message = shaderc_result_get_error_message(res);
 
+    if (ret != shaderc_compilation_status_success && !err)
+        err = 1;
+
     loglevel = err ? AV_LOG_ERROR : warn ? AV_LOG_WARNING : AV_LOG_VERBOSE;
 
     ff_vk_shader_print(avctx, shd, loglevel);



More information about the ffmpeg-cvslog mailing list