[1/4] libcamera: shaders: Move header generation to shaders directory
diff mbox series

Message ID 20260630083031.3197714-2-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • libcamera: Improve shader header generation
Related show

Commit Message

Laurent Pinchart June 30, 2026, 8:30 a.m. UTC
The src/libcamera/shaders/ directory contains all libcamera shaders for
the software ISP. Move the related build logic to convert shaders to
headers to the same directory to make shaders self-contained.

This changes the location of the glsl_shaders.h header, update
debayer_egl.cpp accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/meson.build                  | 10 ----------
 src/libcamera/shaders/meson.build          | 10 ++++++++++
 src/libcamera/software_isp/debayer_egl.cpp |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

Comments

Milan Zamazal June 30, 2026, 10:04 a.m. UTC | #1
Hi Laurent,

thank you for the cleanup.

Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> The src/libcamera/shaders/ directory contains all libcamera shaders for
> the software ISP. Move the related build logic to convert shaders to
> headers to the same directory to make shaders self-contained.
>
> This changes the location of the glsl_shaders.h header, update
> debayer_egl.cpp accordingly.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>

> ---
>  src/libcamera/meson.build                  | 10 ----------
>  src/libcamera/shaders/meson.build          | 10 ++++++++++
>  src/libcamera/software_isp/debayer_egl.cpp |  2 +-
>  3 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 6aedacbdb04d..17c1b2cb3479 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -184,16 +184,6 @@ libcamera_deps += [
>      libyaml,
>  ]
>  
> -# Generate headers from shaders
> -libcamera_shader_headers = custom_target(
> -    'gen-shader-headers',
> -    input : [shader_files],
> -    output : 'glsl_shaders.h',
> -    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
> -)
> -
> -libcamera_internal_headers += libcamera_shader_headers
> -
>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
>  # The build_rpath is stripped at install time by meson, so we determine at
>  # runtime if the library is running from an installed location by checking
> diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build
> index dd441a577670..adac77327a3b 100644
> --- a/src/libcamera/shaders/meson.build
> +++ b/src/libcamera/shaders/meson.build
> @@ -8,3 +8,13 @@ shader_files = files([
>      'bayer_unpacked.vert',
>      'identity.vert',
>  ])
> +
> +# Generate headers from shaders
> +libcamera_shader_headers = custom_target(
> +    'gen-shader-headers',
> +    input : [shader_files],
> +    output : 'glsl_shaders.h',
> +    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
> +)
> +
> +libcamera_internal_headers += libcamera_shader_headers
> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
> index 0ec2a98cfafb..af9b9d426920 100644
> --- a/src/libcamera/software_isp/debayer_egl.cpp
> +++ b/src/libcamera/software_isp/debayer_egl.cpp
> @@ -24,7 +24,7 @@
>  #include "libcamera/internal/formats.h"
>  #include "libcamera/internal/framebuffer.h"
>  
> -#include "../glsl_shaders.h"
> +#include "../shaders/glsl_shaders.h"
>  
>  namespace libcamera {
Barnabás Pőcze June 30, 2026, 10:47 a.m. UTC | #2
2026. 06. 30. 10:30 keltezéssel, Laurent Pinchart írta:
> The src/libcamera/shaders/ directory contains all libcamera shaders for
> the software ISP. Move the related build logic to convert shaders to
> headers to the same directory to make shaders self-contained.
> 
> This changes the location of the glsl_shaders.h header, update
> debayer_egl.cpp accordingly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   src/libcamera/meson.build                  | 10 ----------
>   src/libcamera/shaders/meson.build          | 10 ++++++++++
>   src/libcamera/software_isp/debayer_egl.cpp |  2 +-
>   3 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 6aedacbdb04d..17c1b2cb3479 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -184,16 +184,6 @@ libcamera_deps += [
>       libyaml,
>   ]
>   
> -# Generate headers from shaders
> -libcamera_shader_headers = custom_target(
> -    'gen-shader-headers',
> -    input : [shader_files],
> -    output : 'glsl_shaders.h',
> -    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
> -)
> -
> -libcamera_internal_headers += libcamera_shader_headers
> -
>   # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
>   # The build_rpath is stripped at install time by meson, so we determine at
>   # runtime if the library is running from an installed location by checking
> diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build
> index dd441a577670..adac77327a3b 100644
> --- a/src/libcamera/shaders/meson.build
> +++ b/src/libcamera/shaders/meson.build
> @@ -8,3 +8,13 @@ shader_files = files([
>       'bayer_unpacked.vert',
>       'identity.vert',
>   ])
> +
> +# Generate headers from shaders
> +libcamera_shader_headers = custom_target(
> +    'gen-shader-headers',
> +    input : [shader_files],
> +    output : 'glsl_shaders.h',
> +    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
> +)
> +
> +libcamera_internal_headers += libcamera_shader_headers
> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
> index 0ec2a98cfafb..af9b9d426920 100644
> --- a/src/libcamera/software_isp/debayer_egl.cpp
> +++ b/src/libcamera/software_isp/debayer_egl.cpp
> @@ -24,7 +24,7 @@
>   #include "libcamera/internal/formats.h"
>   #include "libcamera/internal/framebuffer.h"
>   
> -#include "../glsl_shaders.h"
> +#include "../shaders/glsl_shaders.h"
>   
>   namespace libcamera {
>

Patch
diff mbox series

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 6aedacbdb04d..17c1b2cb3479 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -184,16 +184,6 @@  libcamera_deps += [
     libyaml,
 ]
 
-# Generate headers from shaders
-libcamera_shader_headers = custom_target(
-    'gen-shader-headers',
-    input : [shader_files],
-    output : 'glsl_shaders.h',
-    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
-)
-
-libcamera_internal_headers += libcamera_shader_headers
-
 # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
 # The build_rpath is stripped at install time by meson, so we determine at
 # runtime if the library is running from an installed location by checking
diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build
index dd441a577670..adac77327a3b 100644
--- a/src/libcamera/shaders/meson.build
+++ b/src/libcamera/shaders/meson.build
@@ -8,3 +8,13 @@  shader_files = files([
     'bayer_unpacked.vert',
     'identity.vert',
 ])
+
+# Generate headers from shaders
+libcamera_shader_headers = custom_target(
+    'gen-shader-headers',
+    input : [shader_files],
+    output : 'glsl_shaders.h',
+    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],
+)
+
+libcamera_internal_headers += libcamera_shader_headers
diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index 0ec2a98cfafb..af9b9d426920 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -24,7 +24,7 @@ 
 #include "libcamera/internal/formats.h"
 #include "libcamera/internal/framebuffer.h"
 
-#include "../glsl_shaders.h"
+#include "../shaders/glsl_shaders.h"
 
 namespace libcamera {