Skip to content

Commit 2f4050d

Browse files
Di Xu (AR)facebook-github-bot
authored andcommitted
Migrate upsample op to new layout declare using the gen_vulkan_spv.py
Summary: Migrate upsample op to new layout declare using the gen_vulkan_spv.py - layout_declare_tensor: https://www.internalfb.com/code/fbsource/[0ba7858aa186]/fbcode/executorch/backends/vulkan/runtime/api/gen_vulkan_spv.py?lines=219 - layout_declare_ubo, ubo: Uniform Buffer Object, OpenGL data structure Differential Revision: D57781160
1 parent 1343224 commit 2f4050d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

backends/vulkan/runtime/graph/ops/glsl/upsample.glsl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,15 @@
1313

1414
#define PRECISION ${PRECISION}
1515

16-
#define VEC4_T ${texel_type(DTYPE)}
16+
#define VEC4_T ${texel_load_type(DTYPE, STORAGE)}
17+
${define_active_storage_type(STORAGE)}
1718

1819
layout(std430) buffer;
1920

20-
layout(set = 0, binding = 0, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out;
21-
22-
layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in;
23-
24-
layout(set = 0, binding = 2) uniform PRECISION restrict OutLimits {
25-
ivec3 out_limits;
26-
};
27-
28-
layout(set = 0, binding = 3) uniform PRECISION restrict Sizes {
29-
ivec4 sizes;
30-
};
21+
${layout_declare_tensor(0, "w", "image_out", DTYPE, STORAGE)}
22+
${layout_declare_tensor(1, "r", "image_in", DTYPE, STORAGE)}
23+
${layout_declare_ubo(2, "ivec3", "out_limits")}
24+
${layout_declare_ubo(3, "ivec4", "sizes")}
3125

3226
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
3327

backends/vulkan/runtime/graph/ops/glsl/upsample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ upsample:
99
NDIM: 3
1010
DTYPE: float
1111
PACKING: C_packed
12+
STORAGE: texture3d
1213
generate_variant_forall:
1314
DTYPE:
1415
- VALUE: half

0 commit comments

Comments
 (0)