[FFmpeg-devel] [PATCH] avutil/vulkan_glslang: Fix build failure

Lynne dev at lynne.ee
Tue Dec 17 05:06:19 EET 2024


On 17/12/2024 12:04, Lynne via ffmpeg-devel wrote:
> On 17/12/2024 11:42, Zhao Zhili wrote:
>>
>>
>>> On Dec 17, 2024, at 09:12, Lynne via ffmpeg-devel <ffmpeg- 
>>> devel at ffmpeg.org> wrote:
>>>
>>> On 16/12/2024 20:55, Zhao Zhili wrote:
>>>> From: Zhao Zhili <zhilizhao at tencent.com>
>>>> compile_only was added since glslang 13.1.0.
>>>> ---
>>>>   libavutil/vulkan_glslang.c | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>> diff --git a/libavutil/vulkan_glslang.c b/libavutil/vulkan_glslang.c
>>>> index 9e1b8f4d8d..9e7a33223b 100644
>>>> --- a/libavutil/vulkan_glslang.c
>>>> +++ b/libavutil/vulkan_glslang.c
>>>> @@ -192,7 +192,9 @@ static int glslc_shader_compile(FFVulkanContext 
>>>> *s, FFVkSPIRVCompiler *ctx,
>>>>           .optimize_size = 0,
>>>>           .disassemble = 0,
>>>>           .validate = 1,
>>>> +#if ((GLSLANG_VERSION_MAJOR) >= 14)
>>>>           .compile_only = 0,
>>>> +#endif
>>>>       };
>>>>   #endif
>>>
>>>
>>> The changelog reads:
>>>
>>>> Release 13.1.1
>>>>     Initialize compile_only field in C interface
>>
>> That’s for a variable inside the implementation of 
>> glslang_program_SPIRV_generate()
>>
>> https://github.com/KhronosGroup/glslang/commit/ 
>> fd1f96d2020496760290e5cef5d68ae83e5dd5c4
>>
>> While we are using glslang_program_SPIRV_generate_with_options().
>>
>> We can’t just check less than 13.1.1, as the compile_only was added 
>> since 13.1.0. But we can
>> just remove “.compile_only = 0”, and let default initialization kick 
>> in. Keep the explicit initialize of
>> compile_only is for clarity. I can remove it if you prefer clean and 
>> less conditional compile.
>>
>>>
>>> It's initialized to 0 in the new version.
>>> https://github.com/KhronosGroup/glslang/commit/ 
>>> fd1f96d2020496760290e5cef5d68ae83e5dd5c4
>>>
>>> Shouldn't this check for the version being **less than** 13.1.1?
>>> <OpenPGP_0xA2FEA5F03F034464.asc>_______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>>>
> 
> Ah, I see.
> We should just keep it as-is. We'll never be using compile-only without 
> linking.
> 
> Besides, the plan is to switch to Slang as soon as its viable and rm -rf 
> all glslang/shaderc compilation code.
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

*by that I mean just omitting the setting and using default 
0-initialization.
Could you send a patch to comment the line out, something like:
/* .compile_only = 0, */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241217/b6abef77/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241217/b6abef77/attachment.sig>


More information about the ffmpeg-devel mailing list