Commit 4912e344 authored by Philip Langdale's avatar Philip Langdale

spirv: Prefix spirv compiler function struct names

These structs are included via extern declarations, so they can
silently conflict with equivalently named declarations in an
application if libplacebo is included statically.

And this happens with mpv, which also declares a `spirv_shaderc`
struct.

So, prefix the struct names with `pl_` to avoid this.
parent 4214a660
......@@ -17,15 +17,15 @@
#include "spirv.h"
extern const struct spirv_compiler_fns spirv_shaderc;
extern const struct spirv_compiler_fns spirv_glslang;
extern const struct spirv_compiler_fns pl_spirv_shaderc;
extern const struct spirv_compiler_fns pl_spirv_glslang;
static const struct spirv_compiler_fns *compilers[] = {
#if PL_HAVE_SHADERC
&spirv_shaderc,
&pl_spirv_shaderc,
#endif
#if PL_HAVE_GLSLANG
&spirv_glslang,
&pl_spirv_glslang,
#endif
};
......
......@@ -61,7 +61,7 @@ static bool glslang_compile(struct spirv_compiler *spirv, void *tactx,
return true;
}
const struct spirv_compiler_fns spirv_glslang = {
const struct spirv_compiler_fns pl_spirv_glslang = {
.name = "glslang",
.compile_glsl = glslang_compile,
.init = glslang_init,
......
......@@ -140,7 +140,7 @@ static bool shaderc_compile(struct spirv_compiler *spirv, void *tactx,
return success;
}
const struct spirv_compiler_fns spirv_shaderc = {
const struct spirv_compiler_fns pl_spirv_shaderc = {
.name = "shaderc",
.compile_glsl = shaderc_compile,
.init = shaderc_init,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment