diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index dda88149d15..0d4f54a80ef 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -1125,7 +1125,7 @@ bool vir_init_reg_sets(struct v3d_compiler *compiler); int v3d_shaderdb_dump(struct v3d_compile *c, char **shaderdb_str); -bool v3d_gl_format_is_return_32(GLenum format); +bool v3d_gl_format_is_return_32(enum pipe_format format); uint32_t v3d_get_op_for_atomic_add(nir_intrinsic_instr *instr, unsigned src); diff --git a/src/compiler/glsl/gl_nir_link_atomics.c b/src/compiler/glsl/gl_nir_link_atomics.c index 38846c7f4d7..e590e0fa4f4 100644 --- a/src/compiler/glsl/gl_nir_link_atomics.c +++ b/src/compiler/glsl/gl_nir_link_atomics.c @@ -22,6 +22,7 @@ */ #include "nir.h" +#include "GL/gl.h" #include "linker_util.h" #include "gl_nir_linker.h" #include "compiler/glsl/ir_uniform.h" /* for gl_uniform_storage */ diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 839a38ad8e1..65bb42c3ddb 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -22,6 +22,7 @@ */ #include "nir.h" +#include "nir_gl_types.h" #include "nir_deref.h" #include "gl_nir_linker.h" #include "compiler/glsl/ir_uniform.h" /* for gl_uniform_storage */ diff --git a/src/compiler/glsl/gl_nir_link_xfb.c b/src/compiler/glsl/gl_nir_link_xfb.c index cd7c3c09f30..7ec1a85eced 100644 --- a/src/compiler/glsl/gl_nir_link_xfb.c +++ b/src/compiler/glsl/gl_nir_link_xfb.c @@ -22,6 +22,7 @@ */ #include "nir.h" +#include "nir_gl_types.h" #include "nir_xfb_info.h" #include "gl_nir_linker.h" #include "linker_util.h" diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index b282547876d..e4242161653 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -22,6 +22,7 @@ */ #include "nir.h" +#include "GL/gl.h" #include "gl_nir.h" #include "gl_nir_linker.h" #include "linker_util.h" diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 910a0e9c81e..0c5b82cfd3c 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -30,7 +30,6 @@ #include "util/hash_table.h" #include "compiler/glsl/list.h" -#include "GL/gl.h" /* GLenum */ #include "util/list.h" #include "util/log.h" #include "util/ralloc.h" diff --git a/src/compiler/nir_gl_types.h b/src/compiler/nir_gl_types.h new file mode 100644 index 00000000000..161d5a2306b --- /dev/null +++ b/src/compiler/nir_gl_types.h @@ -0,0 +1,43 @@ +/* + * Copyright © 2017 Igalia + * + * 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. + * + * Authors: + * Neil Roberts. + * + */ + +#ifndef NIR_GL_TYPES_H +#define NIR_GL_TYPES_H + +#include "GL/gl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +GLenum glsl_get_gl_type(const struct glsl_type *type); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index b069e92c40e..9d471480bbe 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -26,6 +26,7 @@ */ #include "nir_types.h" +#include "nir_gl_types.h" #include "compiler/glsl/ir.h" const char * diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index 70347995579..8360d9892de 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -84,8 +84,6 @@ glsl_texture_type_to_sampler(const struct glsl_type *type, bool is_shadow); const struct glsl_type * glsl_sampler_type_to_texture(const struct glsl_type *type); -GLenum glsl_get_gl_type(const struct glsl_type *type); - enum glsl_base_type glsl_get_base_type(const struct glsl_type *type); unsigned glsl_get_vector_elements(const struct glsl_type *type); diff --git a/src/mesa/main/glspirv.h b/src/mesa/main/glspirv.h index 8ed6af3338a..e9ef562584d 100644 --- a/src/mesa/main/glspirv.h +++ b/src/mesa/main/glspirv.h @@ -25,6 +25,7 @@ #define GLSPIRV_H #include "compiler/nir/nir.h" +#include "main/glheader.h" #ifdef __cplusplus extern "C" {