summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-04-30 20:39:43 +1000
committerTimothy Arceri <[email protected]>2018-05-01 12:39:33 +1000
commit6487e7a30c9e4c2a417ddfe632d5f68e065e21eb (patch)
tree561df9b47ea4efa99c89dd80dfd22a1a1e122ae8 /src/mesa
parentf56e22e49673e8234a7fe0c241b4c3eae4752f34 (diff)
nir: move GL specific passes to src/compiler/glsl
With this we should have no passes in src/compiler/nir with any dependencies on headers from core GL Mesa. Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp5
-rw-r--r--src/mesa/main/glspirv.h1
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp7
3 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 7841626dc33..39fa94c0f8d 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -24,6 +24,7 @@
#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"
@@ -299,8 +300,8 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
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);
diff --git a/src/mesa/main/glspirv.h b/src/mesa/main/glspirv.h
index cbcd3c0bcbc..8025c17c099 100644
--- a/src/mesa/main/glspirv.h
+++ b/src/mesa/main/glspirv.h
@@ -30,6 +30,7 @@
extern "C" {
#endif
+struct gl_shader_program;
struct gl_context;
struct gl_shader;
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index bcf6a7ceb6a..8d80c8cae22 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -43,6 +43,7 @@
#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"
@@ -467,7 +468,7 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog,
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");
@@ -813,9 +814,9 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
}
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" */