diff options
author | Kenneth Graunke <[email protected]> | 2015-03-06 01:17:22 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-03-08 20:03:57 -0700 |
commit | b200cbb0a41aaebb007668f870a483f0b9ecd898 (patch) | |
tree | 7270b41cca62b1cf0827fa66b17ce5346e6f10f3 /src/glsl/nir/glsl_to_nir.cpp | |
parent | a55da73be46b4576015417b2dff71a719bc8b797 (diff) |
nir: Add native_integers to nir_shader_compiler_options.
glsl_to_nir, tgsi_to_nir, and prog_to_nir all want to know whether the
driver supports native integers. Presumably other passes may as well.
Adding this to nir_shader_compiler_options is an easy way to provide
that information, as it's accessible via nir_shader::options.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/glsl_to_nir.cpp')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 7e40ef485a1..0d96e0383f7 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -43,7 +43,7 @@ namespace { class nir_visitor : public ir_visitor { public: - nir_visitor(nir_shader *shader, bool supports_ints); + nir_visitor(nir_shader *shader); ~nir_visitor(); virtual void visit(ir_variable *); @@ -125,12 +125,11 @@ private: }; /* end of anonymous namespace */ nir_shader * -glsl_to_nir(exec_list *ir, bool native_integers, - const nir_shader_compiler_options *options) +glsl_to_nir(exec_list *ir, const nir_shader_compiler_options *options) { nir_shader *shader = nir_shader_create(NULL, options); - nir_visitor v1(shader, native_integers); + nir_visitor v1(shader); nir_function_visitor v2(&v1); v2.run(ir); visit_exec_list(ir, &v1); @@ -138,9 +137,9 @@ glsl_to_nir(exec_list *ir, bool native_integers, return shader; } -nir_visitor::nir_visitor(nir_shader *shader, bool supports_ints) +nir_visitor::nir_visitor(nir_shader *shader) { - this->supports_ints = supports_ints; + this->supports_ints = shader->options->native_integers; this->shader = shader; this->is_global = true; this->var_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer, |