summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2019-08-30 17:57:18 +0200
committerConnor Abbott <[email protected]>2019-09-05 12:38:46 +0200
commit2af431cf7fe9303bbfbd719e4612f00043583f40 (patch)
tree47b24510d420f4fa65984147b7959e9fbcc1c15d /src/mesa/main
parent49503ae74e2634ebd2e0d3caa36c25ed99e19b9c (diff)
gallium: Plumb through a way to disable GLSL const lowering
For radeonsi, we will prefer the NIR pass as it'll generate better code (some index calculation and a single load vs. a load, then index calculation, then another load) and oftentimes NIR optimization can kick in and make all the access indices constant. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/mtypes.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index c68be8d01e5..d77647ccda9 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -633,6 +633,8 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
consts->GLSLVersion = api == API_OPENGL_CORE ? 130 : 120;
consts->GLSLVersionCompat = consts->GLSLVersion;
+ consts->GLSLLowerConstArrays = true;
+
/* Assume that if GLSL 1.30+ (or GLSL ES 3.00+) is supported that
* gl_VertexID is implemented using a native hardware register with OpenGL
* semantics.
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b740671559b..f035287ac7e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3929,6 +3929,11 @@ struct gl_constants
bool GLSLOptimizeConservatively;
/**
+ * Whether to call lower_const_arrays_to_uniforms() during linking.
+ */
+ bool GLSLLowerConstArrays;
+
+ /**
* True if gl_TessLevelInner/Outer[] in the TES should be inputs
* (otherwise, they're system values).
*/