From b5793abeef8d3a7a751c81007de1c35f91f10760 Mon Sep 17 00:00:00 2001 From: Vivek Trivedi Date: Sat, 6 Dec 2025 21:03:56 -0800 Subject: [PATCH] Using push constants for clone op parameters. (#16113) Summary: This diff modifies the clone operation in the Executorch Vulkan backend to use push constants instead of a uniform buffer for storing the output limits. Reviewed By: yipjustin Differential Revision: D88097604 --- backends/vulkan/runtime/graph/ops/glsl/clone.glsl | 5 ++++- backends/vulkan/runtime/graph/ops/impl/Clone.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backends/vulkan/runtime/graph/ops/glsl/clone.glsl b/backends/vulkan/runtime/graph/ops/glsl/clone.glsl index 3bd1af8bb0c..e7f18526d06 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/clone.glsl +++ b/backends/vulkan/runtime/graph/ops/glsl/clone.glsl @@ -16,7 +16,10 @@ layout(std430) buffer; ${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)} ${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)} -${layout_declare_ubo(B, "ivec3", "out_limits")} + +layout(push_constant) uniform restrict Block { + ivec3 out_limits; +}; layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; diff --git a/backends/vulkan/runtime/graph/ops/impl/Clone.cpp b/backends/vulkan/runtime/graph/ops/impl/Clone.cpp index 059aade5b04..a64cb0143a9 100644 --- a/backends/vulkan/runtime/graph/ops/impl/Clone.cpp +++ b/backends/vulkan/runtime/graph/ops/impl/Clone.cpp @@ -48,9 +48,9 @@ void add_clone_node( // Inputs and Outputs {{out, vkapi::kWrite}, {in, vkapi::kRead}}, // Parameter Buffers - {graph.logical_limits_ubo(out)}, - // Push Constants {}, + // Push Constants + {graph.logical_limits_pc_of(out)}, // Specialization Constants {}, // Resize Args