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 <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Connor Abbott
2019-08-30 17:57:18 +02:00
parent 49503ae74e
commit 2af431cf7f
7 changed files with 20 additions and 1 deletions

View File

@@ -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.