summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/nir')
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp28
-rw-r--r--src/glsl/nir/glsl_to_nir.h4
2 files changed, 4 insertions, 28 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index b82e5c7ac18..7e40ef485a1 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -124,34 +124,10 @@ private:
}; /* end of anonymous namespace */
-static const nir_shader_compiler_options default_options = {
-};
-
nir_shader *
-glsl_to_nir(exec_list *ir, _mesa_glsl_parse_state *state,
- bool native_integers)
+glsl_to_nir(exec_list *ir, bool native_integers,
+ const nir_shader_compiler_options *options)
{
- const nir_shader_compiler_options *options;
-
- if (state) {
- struct gl_context *ctx = state->ctx;
- struct gl_shader_compiler_options *gl_options =
- &ctx->Const.ShaderCompilerOptions[state->stage];
-
- if (!gl_options->NirOptions) {
- nir_shader_compiler_options *new_options =
- rzalloc(ctx, nir_shader_compiler_options);
- options = gl_options->NirOptions = new_options;
-
- if (gl_options->EmitNoPow)
- new_options->lower_fpow = true;
- } else {
- options = gl_options->NirOptions;
- }
- } else {
- options = &default_options;
- }
-
nir_shader *shader = nir_shader_create(NULL, options);
nir_visitor v1(shader, native_integers);
diff --git a/src/glsl/nir/glsl_to_nir.h b/src/glsl/nir/glsl_to_nir.h
index 58b2cee6a48..730094552ce 100644
--- a/src/glsl/nir/glsl_to_nir.h
+++ b/src/glsl/nir/glsl_to_nir.h
@@ -32,8 +32,8 @@
extern "C" {
#endif
-nir_shader *glsl_to_nir(exec_list * ir, _mesa_glsl_parse_state *state,
- bool native_integers);
+nir_shader *glsl_to_nir(exec_list *ir, bool native_integers,
+ const nir_shader_compiler_options *options);
#ifdef __cplusplus
}