From ff6e3c025658a5fa1affd094f220b623e7e1b24b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 22:38:23 +0200 Subject: Adding upstream version 6.338.2. Signed-off-by: Daniel Baumann --- src/glsl/glslang.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/glsl/glslang.h (limited to 'src/glsl/glslang.h') diff --git a/src/glsl/glslang.h b/src/glsl/glslang.h new file mode 100644 index 0000000..a5965a5 --- /dev/null +++ b/src/glsl/glslang.h @@ -0,0 +1,57 @@ +/* + * This file is part of libplacebo. + * + * libplacebo is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * libplacebo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with libplacebo. If not, see . + */ + +#pragma once + +#include +#include + +typedef struct TLimits TLimits; +typedef struct TBuiltInResource TBuiltInResource; +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include "utils.h" + +bool pl_glslang_init(void); +void pl_glslang_uninit(void); + +struct pl_glslang_res { + // Compilation status + bool success; + const char *error_msg; + + // Compiled shader memory, or NULL + void *data; + size_t size; +}; + +// Compile GLSL into a SPIRV stream, if possible. The resulting +// pl_glslang_res can simply be freed with pl_free() when done. +struct pl_glslang_res *pl_glslang_compile(struct pl_glsl_version glsl_ver, + struct pl_spirv_version spirv_ver, + enum glsl_shader_stage stage, + const char *shader); + +extern const TBuiltInResource DefaultTBuiltInResource; + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3