[Mesa-dev] [RFC 04/10] glsl: add function to create unique string from shader program

Eric Engestrom eric.engestrom at imgtec.com
Tue Jan 9 14:30:00 UTC 2018


On Tuesday, 2018-01-09 09:48:16 +0200, Tapani Pälli wrote:
> Patch moves existing functionality from shader_cache_read_program_metadata
> to a helper function.
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/compiler/Makefile.sources      |  1 +
>  src/compiler/glsl/meson.build      |  1 +
>  src/compiler/glsl/program.cpp      | 88 ++++++++++++++++++++++++++++++++++++++
>  src/compiler/glsl/program.h        | 12 ++++--
>  src/compiler/glsl/shader_cache.cpp | 55 +-----------------------
>  5 files changed, 100 insertions(+), 57 deletions(-)
>  create mode 100644 src/compiler/glsl/program.cpp
> 
[snip]
> diff --git a/src/compiler/glsl/program.h b/src/compiler/glsl/program.h
> index 480379b10b..ae349113e0 100644
> --- a/src/compiler/glsl/program.h
> +++ b/src/compiler/glsl/program.h
> @@ -25,18 +25,22 @@
>  #ifndef GLSL_PROGRAM_H
>  #define GLSL_PROGRAM_H
>  
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
>  struct gl_context;
>  struct gl_shader;
>  struct gl_shader_program;
>  
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +

Unrelated hunk, but also I'm not convinced this is right. Either C++
does mangle struct names and this needs to be inside the `extern "C"`,
or it doesn't and moving it outside won't change anything, right?


More information about the mesa-dev mailing list