Skip to content

Commit a1a7dea

Browse files
authored
[BE][ET-VK] update clone to use layout gen
Differential Revision: D71825480 Pull Request resolved: #9589
1 parent 81ed71b commit a1a7dea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88

99
#version 450 core
1010

11+
#include "indexing_utils.h"
12+
1113
#define PRECISION ${PRECISION}
1214

1315
layout(std430) buffer;
1416

15-
layout(set = 0, binding = 0, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out;
16-
layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in;
17-
18-
layout(set = 0, binding = 2) uniform PRECISION restrict OutLimits {
19-
ivec3 out_limits;
20-
};
17+
${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)}
18+
${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
19+
${layout_declare_ubo(B, "ivec3", "out_limits")}
2120

2221
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
2322

@@ -26,5 +25,5 @@ void main() {
2625
if (any(greaterThanEqual(pos, out_limits))) {
2726
return;
2827
}
29-
imageStore(image_out, pos, texelFetch(image_in, pos, 0));
28+
imageStore(t_out, pos, load_texel(t_in, pos));
3029
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ clone:
22
parameter_names_with_default_values:
33
DTYPE: float
44
NDIM: 3
5+
STORAGE: texture3d
56
generate_variant_forall:
67
DTYPE:
78
- VALUE: half

0 commit comments

Comments
 (0)