| Message ID | 20251015012251.17508-4-bryan.odonoghue@linaro.org |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Bryan O'Donoghue (2025-10-15 02:22:15) > Encode the bayer shader files into a header as part of the build process. > Qcam already compiles the shader files down into a QT resource file which > it references internally. > > In order to share the debayering shader programs outside of qcam create a > generic header which both qcam and libcamera can operate from. > Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > include/libcamera/internal/meson.build | 10 ++++++++++ > include/libcamera/internal/shaders/meson.build | 10 ++++++++++ > utils/meson.build | 2 ++ > 3 files changed, 22 insertions(+) > create mode 100644 include/libcamera/internal/shaders/meson.build > > diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build > index 45c299f6..ecb7c9fa 100644 > --- a/include/libcamera/internal/meson.build > +++ b/include/libcamera/internal/meson.build > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: CC0-1.0 > > subdir('tracepoints') > +subdir('shaders') > > libcamera_internal_headers = files([ > 'bayer_format.h', > @@ -59,5 +60,14 @@ tracepoints_h = custom_target( > > libcamera_internal_headers += tracepoints_h > > +libcamera_shader_headers = custom_target( > + 'gen-shader-headers', > + input : [shader_files], > + output : 'glsl_shaders.h', > + command : [gen_shader_headers, meson.project_source_root(), meson.project_build_root(), '@OUTPUT@', '@INPUT@'], > +) > + > +libcamera_internal_headers += libcamera_shader_headers > + > subdir('converter') > subdir('software_isp') > diff --git a/include/libcamera/internal/shaders/meson.build b/include/libcamera/internal/shaders/meson.build > new file mode 100644 > index 00000000..386b342d > --- /dev/null > +++ b/include/libcamera/internal/shaders/meson.build > @@ -0,0 +1,10 @@ > +# SPDX-License-Identifier: CC0-1.0 > + > +# List of shader files to convert to header hex > +# for the purposes of inclusion in OpenGL debayering > +shader_files = files([ > + 'bayer_1x_packed.frag', > + 'bayer_8.frag', > + 'bayer_8.vert', > + 'identity.vert', > +]) > diff --git a/utils/meson.build b/utils/meson.build > index 95d657ac..3deed8ad 100644 > --- a/utils/meson.build > +++ b/utils/meson.build > @@ -3,5 +3,7 @@ > subdir('codegen') > subdir('ipu3') > > +gen_shader_headers = files('gen-shader-headers.sh') > + > ## Module signing > gen_ipa_priv_key = files('gen-ipa-priv-key.sh') > -- > 2.51.0 >
diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 45c299f6..ecb7c9fa 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -1,6 +1,7 @@ # SPDX-License-Identifier: CC0-1.0 subdir('tracepoints') +subdir('shaders') libcamera_internal_headers = files([ 'bayer_format.h', @@ -59,5 +60,14 @@ tracepoints_h = custom_target( libcamera_internal_headers += tracepoints_h +libcamera_shader_headers = custom_target( + 'gen-shader-headers', + input : [shader_files], + output : 'glsl_shaders.h', + command : [gen_shader_headers, meson.project_source_root(), meson.project_build_root(), '@OUTPUT@', '@INPUT@'], +) + +libcamera_internal_headers += libcamera_shader_headers + subdir('converter') subdir('software_isp') diff --git a/include/libcamera/internal/shaders/meson.build b/include/libcamera/internal/shaders/meson.build new file mode 100644 index 00000000..386b342d --- /dev/null +++ b/include/libcamera/internal/shaders/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 + +# List of shader files to convert to header hex +# for the purposes of inclusion in OpenGL debayering +shader_files = files([ + 'bayer_1x_packed.frag', + 'bayer_8.frag', + 'bayer_8.vert', + 'identity.vert', +]) diff --git a/utils/meson.build b/utils/meson.build index 95d657ac..3deed8ad 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -3,5 +3,7 @@ subdir('codegen') subdir('ipu3') +gen_shader_headers = files('gen-shader-headers.sh') + ## Module signing gen_ipa_priv_key = files('gen-ipa-priv-key.sh')
Encode the bayer shader files into a header as part of the build process. Qcam already compiles the shader files down into a QT resource file which it references internally. In order to share the debayering shader programs outside of qcam create a generic header which both qcam and libcamera can operate from. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- include/libcamera/internal/meson.build | 10 ++++++++++ include/libcamera/internal/shaders/meson.build | 10 ++++++++++ utils/meson.build | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 include/libcamera/internal/shaders/meson.build