[Mesa-dev] [PATCH 18/23] i965: Add a brw->scalar_gs flag controlled by INTEL_SCALAR_GS=1.
Kenneth Graunke
kenneth at whitecape.org
Wed Sep 30 00:58:22 PDT 2015
This patch introduces a brw->scalar_gs flag, similar to brw->scalar_vs,
which controls whether or not to use SIMD8 geometry shaders.
For now, we control it via a new environment variable, INTEL_SCALAR_GS.
This provides a convenient way to try it out.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_shader.cpp | 8 ++++++++
src/mesa/drivers/dri/i965/brw_shader.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 60300bc..dd83a60 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -87,6 +87,9 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
if (devinfo->gen >= 8 && !(INTEL_DEBUG & DEBUG_VEC4VS))
compiler->scalar_vs = true;
+ if (devinfo->gen >= 8 && brw_env_var_as_boolean("INTEL_SCALAR_GS", false))
+ compiler->scalar_gs = true;
+
nir_shader_compiler_options *nir_options =
rzalloc(compiler, nir_shader_compiler_options);
nir_options->native_integers = true;
@@ -127,6 +130,9 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
case MESA_SHADER_VERTEX:
is_scalar = compiler->scalar_vs;
break;
+ case MESA_SHADER_GEOMETRY:
+ is_scalar = compiler->scalar_gs;
+ break;
default:
is_scalar = false;
break;
@@ -199,6 +205,8 @@ is_scalar_shader_stage(struct brw_context *brw, int stage)
case MESA_SHADER_FRAGMENT:
case MESA_SHADER_COMPUTE:
return true;
+ case MESA_SHADER_GEOMETRY:
+ return brw->intelScreen->compiler->scalar_gs;
case MESA_SHADER_VERTEX:
return brw->intelScreen->compiler->scalar_vs;
default:
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index ccccf4d..fd087dd 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -92,6 +92,7 @@ struct brw_compiler {
void (*shader_perf_log)(void *, const char *str, ...) PRINTFLIKE(2, 3);
bool scalar_vs;
+ bool scalar_gs;
struct gl_shader_compiler_options glsl_compiler_options[MESA_SHADER_STAGES];
};
--
2.5.3
More information about the mesa-dev
mailing list