diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources index f2051bf0f12..a71abe3bfa8 100644 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@ -377,6 +377,7 @@ SPIRV_FILES = \ spirv/GLSL.std.450.h \ spirv/gl_spirv.c \ spirv/nir_load_libclc.c \ + spirv/nir_lower_libclc.c \ spirv/nir_spirv.h \ spirv/OpenCL.std.h \ spirv/spirv.h \ diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 828b23527ae..28b372b65fe 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -252,6 +252,7 @@ files_libnir = files( '../spirv/GLSL.std.450.h', '../spirv/gl_spirv.c', '../spirv/nir_load_libclc.c', + '../spirv/nir_lower_libclc.c', '../spirv/nir_spirv.h', '../spirv/OpenCL.std.h', '../spirv/spirv.h', diff --git a/src/gallium/frontends/clover/nir/nir_lower_libclc.c b/src/compiler/spirv/nir_lower_libclc.c similarity index 99% rename from src/gallium/frontends/clover/nir/nir_lower_libclc.c rename to src/compiler/spirv/nir_lower_libclc.c index 9d177567f78..ebaa54c1ad9 100644 --- a/src/gallium/frontends/clover/nir/nir_lower_libclc.c +++ b/src/compiler/spirv/nir_lower_libclc.c @@ -29,7 +29,7 @@ */ #include "nir.h" #include "nir_builder.h" -#include "nir_lower_libclc.h" +#include "nir_spirv.h" static bool lower_clc_call_instr(nir_instr *instr, nir_builder *b, diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h index 49921fa7e40..5964184338b 100644 --- a/src/compiler/spirv/nir_spirv.h +++ b/src/compiler/spirv/nir_spirv.h @@ -111,6 +111,8 @@ nir_load_libclc_shader(unsigned ptr_bit_size, const struct spirv_to_nir_options *spirv_options, const nir_shader_compiler_options *nir_options); +bool nir_lower_libclc(nir_shader *shader, const nir_shader *clc_shader); + #ifdef __cplusplus } #endif diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build index 41706ac65a8..ad5f152416d 100644 --- a/src/gallium/frontends/clover/meson.build +++ b/src/gallium/frontends/clover/meson.build @@ -85,7 +85,7 @@ libclspirv = static_library( libclnir = static_library( 'clnir', - files('nir/invocation.cpp', 'nir/invocation.hpp', 'nir/nir_lower_libclc.c', 'nir/nir_lower_libclc.h'), + files('nir/invocation.cpp', 'nir/invocation.hpp'), include_directories : [clover_incs, inc_mesa], dependencies : idep_nir, cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args], diff --git a/src/gallium/frontends/clover/nir/invocation.cpp b/src/gallium/frontends/clover/nir/invocation.cpp index a5c3f99ad93..4e7b88d5dec 100644 --- a/src/gallium/frontends/clover/nir/invocation.cpp +++ b/src/gallium/frontends/clover/nir/invocation.cpp @@ -37,10 +37,6 @@ #include #include -extern "C" { -#include "nir_lower_libclc.h" -} - using namespace clover; #ifdef HAVE_CLOVER_SPIRV diff --git a/src/gallium/frontends/clover/nir/nir_lower_libclc.h b/src/gallium/frontends/clover/nir/nir_lower_libclc.h deleted file mode 100644 index 8db8d0aac76..00000000000 --- a/src/gallium/frontends/clover/nir/nir_lower_libclc.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright © 2019 Red Hat - * - * 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 NIR_LOWER_LIBCLC_H -#define NIR_LOWER_LIBCLC_H - -bool -nir_lower_libclc(nir_shader *shader, - const nir_shader *clc_shader); - -#endif