glsl/builtin_types.cpp \
glsl/builtin_variables.cpp \
glsl/generate_ir.cpp \
+ glsl/gl_nir_lower_atomics.c \
+ glsl/gl_nir_lower_samplers.c \
+ glsl/gl_nir_lower_samplers_as_deref.c \
+ glsl/gl_nir.h \
glsl/glsl_parser_extras.cpp \
glsl/glsl_parser_extras.h \
glsl/glsl_symbol_table.cpp \
nir/nir_lower_64bit_packing.c \
nir/nir_lower_alpha_test.c \
nir/nir_lower_alu_to_scalar.c \
- nir/nir_lower_atomics.c \
nir/nir_lower_atomics_to_ssbo.c \
nir/nir_lower_bitmap.c \
nir/nir_lower_clamp_color_outputs.c \
nir/nir_lower_phis_to_scalar.c \
nir/nir_lower_regs_to_ssa.c \
nir/nir_lower_returns.c \
- nir/nir_lower_samplers.c \
- nir/nir_lower_samplers_as_deref.c \
nir/nir_lower_subgroups.c \
nir/nir_lower_system_values.c \
nir/nir_lower_tex.c \
--- /dev/null
+/*
+ * Copyright © 2018 Timothy Arceri
+ *
+ * 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 GL_NIR_H
+#define GL_NIR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct nir_shader;
+struct gl_shader_program;
+
+bool gl_nir_lower_atomics(nir_shader *shader,
+ const struct gl_shader_program *shader_program,
+ bool use_binding_as_idx);
+
+bool gl_nir_lower_samplers(nir_shader *shader,
+ const struct gl_shader_program *shader_program);
+bool gl_nir_lower_samplers_as_deref(nir_shader *shader,
+ const struct gl_shader_program *shader_program);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GL_NIR_H */
*
*/
-#include "compiler/glsl/ir_uniform.h"
-#include "nir.h"
+#include "compiler/nir/nir.h"
+#include "gl_nir.h"
+#include "ir_uniform.h"
+
#include "main/config.h"
#include "main/mtypes.h"
#include <assert.h>
}
bool
-nir_lower_atomics(nir_shader *shader,
- const struct gl_shader_program *shader_program,
- bool use_binding_as_idx)
+gl_nir_lower_atomics(nir_shader *shader,
+ const struct gl_shader_program *shader_program,
+ bool use_binding_as_idx)
{
bool progress = false;
* DEALINGS IN THE SOFTWARE.
*/
-#include "nir.h"
-#include "nir_builder.h"
-#include "compiler/glsl/ir_uniform.h"
+#include "compiler/nir/nir.h"
+#include "compiler/nir/nir_builder.h"
+#include "gl_nir.h"
+#include "ir_uniform.h"
#include "main/compiler.h"
#include "main/mtypes.h"
}
bool
-nir_lower_samplers(nir_shader *shader,
- const struct gl_shader_program *shader_program)
+gl_nir_lower_samplers(nir_shader *shader,
+ const struct gl_shader_program *shader_program)
{
bool progress = false;
* the opaque uniform mapping.
*/
-#include "nir.h"
-#include "nir_builder.h"
-#include "compiler/glsl/ir_uniform.h"
+#include "compiler/nir/nir.h"
+#include "compiler/nir/nir_builder.h"
+#include "gl_nir.h"
+#include "ir_uniform.h"
#include "main/compiler.h"
#include "main/mtypes.h"
}
bool
-nir_lower_samplers_as_deref(nir_shader *shader,
- const struct gl_shader_program *shader_program)
+gl_nir_lower_samplers_as_deref(nir_shader *shader,
+ const struct gl_shader_program *shader_program)
{
bool progress = false;
struct lower_samplers_as_deref_state state;
'builtin_types.cpp',
'builtin_variables.cpp',
'generate_ir.cpp',
+ 'gl_nir_lower_atomics.c',
+ 'gl_nir_lower_samplers.c',
+ 'gl_nir_lower_samplers_as_deref.c',
+ 'gl_nir.h',
'glsl_parser_extras.cpp',
'glsl_parser_extras.h',
'glsl_symbol_table.cpp',
'nir_lower_64bit_packing.c',
'nir_lower_alu_to_scalar.c',
'nir_lower_alpha_test.c',
- 'nir_lower_atomics.c',
'nir_lower_atomics_to_ssbo.c',
'nir_lower_bitmap.c',
'nir_lower_clamp_color_outputs.c',
'nir_lower_phis_to_scalar.c',
'nir_lower_regs_to_ssa.c',
'nir_lower_returns.c',
- 'nir_lower_samplers.c',
- 'nir_lower_samplers_as_deref.c',
'nir_lower_subgroups.c',
'nir_lower_system_values.c',
'nir_lower_tex.c',
extern "C" {
#endif
-struct gl_program;
-struct gl_shader_program;
-
#define NIR_FALSE 0u
#define NIR_TRUE (~0u)
void nir_lower_io_to_scalar(nir_shader *shader, nir_variable_mode mask);
void nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask);
-bool nir_lower_samplers(nir_shader *shader,
- const struct gl_shader_program *shader_program);
-bool nir_lower_samplers_as_deref(nir_shader *shader,
- const struct gl_shader_program *shader_program);
-
typedef struct nir_lower_subgroups_options {
uint8_t subgroup_size;
uint8_t ballot_bit_size;
void nir_lower_bitmap(nir_shader *shader, const nir_lower_bitmap_options *options);
-bool nir_lower_atomics(nir_shader *shader,
- const struct gl_shader_program *shader_program,
- bool use_binding_as_idx);
bool nir_lower_atomics_to_ssbo(nir_shader *shader, unsigned ssbo_offset);
bool nir_lower_to_source_mods(nir_shader *shader);
NIR_PASS_V(nir, nir_lower_system_values);
NIR_PASS_V(nir, nir_lower_io, nir_var_all, ir3_glsl_type_size, 0);
- NIR_PASS_V(nir, nir_lower_samplers, prog);
+ NIR_PASS_V(nir, gl_nir_lower_samplers, prog);
return nir;
}
#include "brw_context.h"
#include "compiler/brw_nir.h"
#include "brw_program.h"
+#include "compiler/glsl/gl_nir.h"
#include "compiler/glsl/ir.h"
#include "compiler/glsl/ir_optimization.h"
#include "compiler/glsl/program.h"
struct gl_program *prog = shader->Program;
brw_shader_gather_info(prog->nir, prog);
- NIR_PASS_V(prog->nir, nir_lower_samplers, shProg);
- NIR_PASS_V(prog->nir, nir_lower_atomics, shProg, false);
+ NIR_PASS_V(prog->nir, gl_nir_lower_samplers, shProg);
+ NIR_PASS_V(prog->nir, gl_nir_lower_atomics, shProg, false);
NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo,
prog->nir->info.num_abos);
extern "C" {
#endif
+struct gl_shader_program;
struct gl_context;
struct gl_shader;
#include "compiler/nir/nir.h"
#include "compiler/glsl_types.h"
#include "compiler/glsl/glsl_to_nir.h"
+#include "compiler/glsl/gl_nir.h"
#include "compiler/glsl/ir.h"
#include "compiler/glsl/string_to_uint_map.h"
st_set_prog_affected_state_flags(prog);
NIR_PASS_V(nir, st_nir_lower_builtin);
- NIR_PASS_V(nir, nir_lower_atomics, shader_program, true);
+ NIR_PASS_V(nir, gl_nir_lower_atomics, shader_program, true);
if (st->ctx->_Shader->Flags & GLSL_DUMP) {
_mesa_log("\n");
}
if (screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF))
- NIR_PASS_V(nir, nir_lower_samplers_as_deref, shader_program);
+ NIR_PASS_V(nir, gl_nir_lower_samplers_as_deref, shader_program);
else
- NIR_PASS_V(nir, nir_lower_samplers, shader_program);
+ NIR_PASS_V(nir, gl_nir_lower_samplers, shader_program);
}
} /* extern "C" */