aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2018-03-28 14:59:26 +0200
committerAlejandro Piñeiro <[email protected]>2018-06-21 14:25:05 +0200
commitaa95f0bc5b05fdab4e258d02c1a69abd8317920e (patch)
treee85e93b3983eb68e032bd5532b1488fac354d502 /src/compiler/glsl
parentb995bda9bca0d368f1433b153b64e5200d39bc1d (diff)
compiler/link: add linker_util.h, move linker_error/warning to it
Linker utilities common to the GLSL IR and NIR linker (the latter to be used for ARB_gl_spirv). We need to move it to a new header as the NIR linker doesn't need to know about ir_variable, and others, included at linker.h. v2: move from src/compiler to src/compiler/glsl (Timothy Arceri) Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/link_uniform_block_active_visitor.cpp1
-rw-r--r--src/compiler/glsl/linker.h8
-rw-r--r--src/compiler/glsl/linker_util.h43
-rw-r--r--src/compiler/glsl/meson.build1
-rw-r--r--src/compiler/glsl/program.h8
5 files changed, 47 insertions, 14 deletions
diff --git a/src/compiler/glsl/link_uniform_block_active_visitor.cpp b/src/compiler/glsl/link_uniform_block_active_visitor.cpp
index cd1baf78e80..368981852c0 100644
--- a/src/compiler/glsl/link_uniform_block_active_visitor.cpp
+++ b/src/compiler/glsl/link_uniform_block_active_visitor.cpp
@@ -23,6 +23,7 @@
#include "link_uniform_block_active_visitor.h"
#include "program.h"
+#include "linker_util.h"
static link_uniform_block_active *
process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var)
diff --git a/src/compiler/glsl/linker.h b/src/compiler/glsl/linker.h
index 454b65aebdf..6e9b4861673 100644
--- a/src/compiler/glsl/linker.h
+++ b/src/compiler/glsl/linker.h
@@ -25,6 +25,8 @@
#ifndef GLSL_LINKER_H
#define GLSL_LINKER_H
+#include "linker_util.h"
+
struct gl_shader_program;
struct gl_shader;
struct gl_linked_shader;
@@ -192,12 +194,6 @@ private:
const glsl_struct_field *named_ifc_member);
};
-void
-linker_error(gl_shader_program *prog, const char *fmt, ...);
-
-void
-linker_warning(gl_shader_program *prog, const char *fmt, ...);
-
/**
* Sometimes there are empty slots left over in UniformRemapTable after we
* allocate slots to explicit locations. This struct represents a single
diff --git a/src/compiler/glsl/linker_util.h b/src/compiler/glsl/linker_util.h
new file mode 100644
index 00000000000..162db3e532f
--- /dev/null
+++ b/src/compiler/glsl/linker_util.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef GLSL_LINKER_UTIL_H
+#define GLSL_LINKER_UTIL_H
+
+struct gl_shader_program;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void
+linker_error(struct gl_shader_program *prog, const char *fmt, ...);
+
+void
+linker_warning(struct gl_shader_program *prog, const char *fmt, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GLSL_LINKER_UTIL_H */
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index 055a84714c1..686a5a4ac0b 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -112,6 +112,7 @@ files_libglsl = files(
'ir_visitor.h',
'linker.cpp',
'linker.h',
+ 'linker_util.h',
'link_atomics.cpp',
'link_functions.cpp',
'link_interface_blocks.cpp',
diff --git a/src/compiler/glsl/program.h b/src/compiler/glsl/program.h
index 480379b10b8..9df42ddc1c4 100644
--- a/src/compiler/glsl/program.h
+++ b/src/compiler/glsl/program.h
@@ -48,14 +48,6 @@ extern void
build_program_resource_list(struct gl_context *ctx,
struct gl_shader_program *shProg);
-extern void
-linker_error(struct gl_shader_program *prog, const char *fmt, ...)
- PRINTFLIKE(2, 3);
-
-extern void
-linker_warning(struct gl_shader_program *prog, const char *fmt, ...)
- PRINTFLIKE(2, 3);
-
extern long
parse_program_resource_name(const GLchar *name,
const GLchar **out_base_name_end);