This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 2423a719e07069518b18f403f9a39bc5374e3111 Author: Lynne <[email protected]> AuthorDate: Wed Apr 8 15:11:25 2026 +0200 Commit: Lynne <[email protected]> CommitDate: Fri May 22 15:27:07 2026 +0900 swscale/vulkan: put entire linear matrix+vector as constant data Rather than only using what we need. The driver will remove any unused constants. Sponsored-by: Sovereign Tech Fund --- libswscale/vulkan/ops.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/libswscale/vulkan/ops.c b/libswscale/vulkan/ops.c index ccd517c68b..7109f221f3 100644 --- a/libswscale/vulkan/ops.c +++ b/libswscale/vulkan/ops.c @@ -535,26 +535,19 @@ static void define_shader_consts(SwsOpList *ops, SPICtx *spi, SPIRVIDs *id) } break; case SWS_OP_LINEAR: { + float val; for (int i = 0; i < 4; i++) { - float val; - if (op->lin.m[i][0].num) { - val = op->lin.m[i][0].num/(float)op->lin.m[i][0].den; - id->const_ids[id->nb_const_ids++] = - spi_OpConstantFloat(spi, f32_type, val); - } - if (op->lin.m[i][4].num) { - val = op->lin.m[i][4].num/(float)op->lin.m[i][4].den; - id->const_ids[id->nb_const_ids++] = - spi_OpConstantFloat(spi, f32_type, val); - } - for (int j = 1; j < 4; j++) { - if (!op->lin.m[i][j].num) - continue; + for (int j = 0; j < 4; j++) { val = op->lin.m[i][j].num/(float)op->lin.m[i][j].den; id->const_ids[id->nb_const_ids++] = spi_OpConstantFloat(spi, f32_type, val); } } + for (int i = 0; i < 4; i++) { + val = op->lin.m[i][4].num/(float)op->lin.m[i][4].den; + id->const_ids[id->nb_const_ids++] = + spi_OpConstantFloat(spi, f32_type, val); + } break; } default: @@ -639,7 +632,7 @@ static void define_shader_bindings(SwsOpList *ops, SPICtx *spi, SPIRVIDs *id, } static int insert_bitexact_linear(const SwsOp *op, SPICtx *spi, SPIRVIDs *id, - int data, int linear_ops_idx, int *nb_const_ids) + int data, int linear_ops_idx, int const_off) { int type_s = op->type == SWS_PIXEL_F32 ? id->f32_type : id->u32_type; int type_v = op->type == SWS_PIXEL_F32 ? id->f32vec4_type : id->u32vec4_type; @@ -661,20 +654,20 @@ static int insert_bitexact_linear(const SwsOp *op, SPICtx *spi, SPIRVIDs *id, res[j] = op->type == SWS_PIXEL_F32 ? id->f32_0 : id->u32_cid[0]; if (op->lin.m[j][0].num) res[j] = spi_OpFMul(spi, type_s, tmp[0], - id->const_ids[(*nb_const_ids)++]); + id->const_ids[const_off + j*4 + 0]); if (op->lin.m[j][0].num && op->lin.m[j][4].num) res[j] = spi_OpFAdd(spi, type_s, - id->const_ids[(*nb_const_ids)++], res[j]); + id->const_ids[const_off + 4*4 + j], res[j]); else if (op->lin.m[j][4].num) - res[j] = id->const_ids[(*nb_const_ids)++]; + res[j] = id->const_ids[const_off + 4*4 + j]; for (int i = 1; i < 4; i++) { if (!op->lin.m[j][i].num) continue; int v = spi_OpFMul(spi, type_s, tmp[i], - id->const_ids[(*nb_const_ids)++]); + id->const_ids[const_off + j*4 + i]); if (op->lin.m[j][0].num || op->lin.m[j][4].num) res[j] = spi_OpFAdd(spi, type_s, res[j], v); else @@ -954,8 +947,9 @@ static int add_ops_spirv(VulkanPriv *p, FFVulkanOpsCtx *s, break; } case SWS_OP_LINEAR: { - data = insert_bitexact_linear(op, spi, id, data, nb_linear_ops, &nb_const_ids); + data = insert_bitexact_linear(op, spi, id, data, nb_linear_ops, nb_const_ids); nb_linear_ops++; + nb_const_ids += 4*5; break; } case SWS_OP_UNPACK: _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
