This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 141fdf837e00fa4622f42ab173b39dae09f3ab77
Author:     Niklas Haas <[email protected]>
AuthorDate: Wed Oct 21 02:26:42 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sat Oct 24 19:10:48 2026 +0000

    swscale/vulkan/ops: split shader emission from add_ops_spirv()
    
    Allows the caller to handle setup and cleanup of the SPIR-V context in
    one place, regardless of where emission fails.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/vulkan/ops.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/libswscale/vulkan/ops.c b/libswscale/vulkan/ops.c
index 8a84f7f865..60378d028b 100644
--- a/libswscale/vulkan/ops.c
+++ b/libswscale/vulkan/ops.c
@@ -977,13 +977,10 @@ static int rw_op_img_count(const SwsOp *op, const uint8_t 
*planes)
     return count;
 }
 
-static int add_ops_spirv(SwsContext *sws, VulkanPriv *p, FFVulkanOpsCtx *s,
-                         const SwsOpList *ops, FFVulkanShader *shd)
+static int emit_shader(SwsContext *sws, VulkanPriv *p, FFVulkanOpsCtx *s,
+                       const SwsOpList *ops, FFVulkanShader *shd, SPICtx *spi)
 {
-    uint8_t spvbuf[1024*16];
-    SPICtx spi_context = { 0 }, *spi = &spi_context;
     SPIRVIDs spid_data = { 0 }, *id = &spid_data;
-    spi_init(spi, spvbuf, sizeof(spvbuf));
 
     if (ops->num_ops > MAX_OPS)
         return AVERROR(ENOTSUP);
@@ -1339,6 +1336,19 @@ static int add_ops_spirv(SwsContext *sws, VulkanPriv *p, 
FFVulkanOpsCtx *s,
     /* Return and finalize */
     spi_OpReturn(spi);
     spi_OpFunctionEnd(spi);
+    return 0;
+}
+
+static int add_ops_spirv(SwsContext *sws, VulkanPriv *p, FFVulkanOpsCtx *s,
+                         const SwsOpList *ops, FFVulkanShader *shd)
+{
+    uint8_t spvbuf[1024*16];
+    SPICtx spi_context = { 0 }, *spi = &spi_context;
+    spi_init(spi, spvbuf, sizeof(spvbuf));
+
+    int err = emit_shader(sws, p, s, ops, shd, spi);
+    if (err < 0)
+        return err;
 
     int len = spi_end(spi);
     if (len < 0)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to