From c70264fb9b434cf371c4c54a6bf205986e226919 Mon Sep 17 00:00:00 2001 From: Nathanael See Date: Wed, 26 Mar 2025 10:49:37 -0700 Subject: [PATCH] [BE][ET-VK] update full to use layout gen Pull Request resolved: https://github.com/pytorch/executorch/pull/9590 TSIA @pytorchbot label "topic: not user facing" Differential Revision: [D71825477](https://our.internmc.facebook.com/intern/diff/D71825477/) ghstack-source-id: 274222180 --- backends/vulkan/runtime/graph/ops/glsl/full.glsl | 14 ++++---------- backends/vulkan/runtime/graph/ops/glsl/full.yaml | 1 + 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/backends/vulkan/runtime/graph/ops/glsl/full.glsl b/backends/vulkan/runtime/graph/ops/glsl/full.glsl index 086de0fb5e4..81f1f182cdf 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/full.glsl +++ b/backends/vulkan/runtime/graph/ops/glsl/full.glsl @@ -18,15 +18,9 @@ layout(std430) buffer; -layout(set = 0, binding = 0, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out; - -layout(set = 0, binding = 1) uniform PRECISION restrict Sizes { - ivec4 sizes; -}; - -layout(set = 0, binding = 2) uniform PRECISION restrict FillVal { - float fill_value; -}; +${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)} +${layout_declare_ubo(B, "ivec4", "sizes")} +${layout_declare_ubo(B, "float", "fill_value")} layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; @@ -50,5 +44,5 @@ void main() { outtex = outtex * valid_idx; } - imageStore(image_out, POS, outtex); + imageStore(t_out, POS, outtex); } diff --git a/backends/vulkan/runtime/graph/ops/glsl/full.yaml b/backends/vulkan/runtime/graph/ops/glsl/full.yaml index a997b73de61..eff78a7938d 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/full.yaml +++ b/backends/vulkan/runtime/graph/ops/glsl/full.yaml @@ -9,6 +9,7 @@ full: NDIM: 3 DTYPE: float PACKING: C_packed + STORAGE: texture3d generate_variant_forall: DTYPE: - VALUE: half