Skip to content

Commit 88e2cca

Browse files
committed
tools/cl2c: change to tools/source2c and allow non-OpenCL source files
1 parent 7cfd7e4 commit 88e2cca

17 files changed

+42
-36
lines changed

libavfilter/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,17 @@ TESTPROGS = drawutils filtfmts formats integral
651651
TOOLS-$(CONFIG_LIBZMQ) += zmqsend
652652

653653
clean::
654-
$(RM) $(CLEANSUFFIXES:%=libavfilter/dnn/%) $(CLEANSUFFIXES:%=libavfilter/opencl/%)
654+
$(RM) $(CLEANSUFFIXES:%=libavfilter/dnn/%) $(CLEANSUFFIXES:%=libavfilter/opencl/%) \
655+
$(CLEANSUFFIXES:%=libavfilter/vulkan/%)
655656

656657
OPENCL = $(subst $(SRC_PATH)/,,$(wildcard $(SRC_PATH)/libavfilter/opencl/*.cl))
657658
.SECONDARY: $(OPENCL:.cl=.c)
658659
libavfilter/opencl/%.c: TAG = OPENCL
659660
libavfilter/opencl/%.c: $(SRC_PATH)/libavfilter/opencl/%.cl
660-
$(M)$(SRC_PATH)/tools/cl2c $< $@
661+
$(M)$(SRC_PATH)/tools/source2c $< $@
662+
663+
VULKAN = $(subst $(SRC_PATH)/,,$(wildcard $(SRC_PATH)/libavfilter/vulkan/*.comp))
664+
.SECONDARY: $(VULKAN:.comp=.c)
665+
libavfilter/vulkan/%.c: TAG = OPENCL
666+
libavfilter/vulkan/%.c: $(SRC_PATH)/libavfilter/vulkan/%.comp
667+
$(M)$(SRC_PATH)/tools/source2c $< $@

libavfilter/opencl_source.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
#ifndef AVFILTER_OPENCL_SOURCE_H
2020
#define AVFILTER_OPENCL_SOURCE_H
2121

22-
extern const char *ff_opencl_source_avgblur;
23-
extern const char *ff_opencl_source_colorkey;
24-
extern const char *ff_opencl_source_colorspace_common;
25-
extern const char *ff_opencl_source_convolution;
26-
extern const char *ff_opencl_source_deshake;
27-
extern const char *ff_opencl_source_neighbor;
28-
extern const char *ff_opencl_source_nlmeans;
29-
extern const char *ff_opencl_source_overlay;
30-
extern const char *ff_opencl_source_pad;
31-
extern const char *ff_opencl_source_remap;
32-
extern const char *ff_opencl_source_tonemap;
33-
extern const char *ff_opencl_source_transpose;
34-
extern const char *ff_opencl_source_unsharp;
35-
extern const char *ff_opencl_source_xfade;
22+
extern const char *ff_source_avgblur_cl;
23+
extern const char *ff_source_colorkey_cl;
24+
extern const char *ff_source_colorspace_common_cl;
25+
extern const char *ff_source_convolution_cl;
26+
extern const char *ff_source_deshake_cl;
27+
extern const char *ff_source_neighbor_cl;
28+
extern const char *ff_source_nlmeans_cl;
29+
extern const char *ff_source_overlay_cl;
30+
extern const char *ff_source_pad_cl;
31+
extern const char *ff_source_remap_cl;
32+
extern const char *ff_source_tonemap_cl;
33+
extern const char *ff_source_transpose_cl;
34+
extern const char *ff_source_unsharp_cl;
35+
extern const char *ff_source_xfade_cl;
3636

3737
#endif /* AVFILTER_OPENCL_SOURCE_H */

libavfilter/vf_avgblur_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int avgblur_opencl_init(AVFilterContext *avctx)
5959
cl_int cle;
6060
int err;
6161

62-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_avgblur, 1);
62+
err = ff_opencl_filter_load_program(avctx, &ff_source_avgblur_cl, 1);
6363
if (err < 0)
6464
goto fail;
6565

libavfilter/vf_colorkey_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int colorkey_opencl_init(AVFilterContext *avctx)
5252
cl_int cle;
5353
int err;
5454

55-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_colorkey, 1);
55+
err = ff_opencl_filter_load_program(avctx, &ff_source_colorkey_cl, 1);
5656
if (err < 0)
5757
goto fail;
5858

libavfilter/vf_convolution_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int convolution_opencl_init(AVFilterContext *avctx)
6262
cl_int cle;
6363
int err;
6464

65-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_convolution, 1);
65+
err = ff_opencl_filter_load_program(avctx, &ff_source_convolution_cl, 1);
6666
if (err < 0)
6767
goto fail;
6868

libavfilter/vf_deshake_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ static int deshake_opencl_init(AVFilterContext *avctx)
12511251
}
12521252
ctx->sw_format = hw_frames_ctx->sw_format;
12531253

1254-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_deshake, 1);
1254+
err = ff_opencl_filter_load_program(avctx, &ff_source_deshake_cl, 1);
12551255
if (err < 0)
12561256
goto fail;
12571257

libavfilter/vf_neighbor_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int neighbor_opencl_init(AVFilterContext *avctx)
5555
cl_int cle;
5656
int err;
5757

58-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_neighbor, 1);
58+
err = ff_opencl_filter_load_program(avctx, &ff_source_neighbor_cl, 1);
5959
if (err < 0)
6060
goto fail;
6161

libavfilter/vf_nlmeans_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int nlmeans_opencl_init(AVFilterContext *avctx, int width, int height)
9898
if (!ctx->patch_size_uv)
9999
ctx->patch_size_uv = ctx->patch_size;
100100

101-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_nlmeans, 1);
101+
err = ff_opencl_filter_load_program(avctx, &ff_source_nlmeans_cl, 1);
102102
if (err < 0)
103103
goto fail;
104104

libavfilter/vf_overlay_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int overlay_opencl_load(AVFilterContext *avctx,
5151
{
5252
OverlayOpenCLContext *ctx = avctx->priv;
5353
cl_int cle;
54-
const char *source = ff_opencl_source_overlay;
54+
const char *source = ff_source_overlay_cl;
5555
const char *kernel;
5656
const AVPixFmtDescriptor *main_desc, *overlay_desc;
5757
int err, i, main_planes, overlay_planes;

libavfilter/vf_pad_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static int pad_opencl_init(AVFilterContext *avctx, AVFrame *input_frame)
9393
ctx->hsub = desc->log2_chroma_w;
9494
ctx->vsub = desc->log2_chroma_h;
9595

96-
err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_pad, 1);
96+
err = ff_opencl_filter_load_program(avctx, &ff_source_pad_cl, 1);
9797
if (err < 0)
9898
goto fail;
9999

0 commit comments

Comments
 (0)