From b200cbb0a41aaebb007668f870a483f0b9ecd898 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 6 Mar 2015 01:17:22 -0800 Subject: 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 Reviewed-by: Jason Ekstrand --- src/mesa/drivers/dri/i965/brw_context.c | 4 +++- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8141b45f735..0881e489fe2 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -551,7 +551,9 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 128; } - static const nir_shader_compiler_options nir_options = {}; + static const nir_shader_compiler_options nir_options = { + .native_integers = true, + }; /* We want the GLSL compiler to emit code that uses condition codes */ for (int i = 0; i < MESA_SHADER_STAGES; i++) { diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index e24bf92eef5..ccb5cea674b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -87,7 +87,7 @@ fs_visitor::emit_nir_code() /* first, lower the GLSL IR shader to NIR */ lower_output_reads(shader->base.ir); - nir_shader *nir = glsl_to_nir(shader->base.ir, true, options); + nir_shader *nir = glsl_to_nir(shader->base.ir, options); nir_validate_shader(nir); nir_lower_global_vars_to_local(nir); -- cgit v1.2.3