diff options
author | Kenneth Graunke <[email protected]> | 2019-11-21 16:11:15 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-11-27 18:48:04 +0000 |
commit | 9b577f2a887968483b88b629673d3f9904a179ff (patch) | |
tree | 22e850fb65785eb90dd4f10b27b7ced3dffb97c3 /src/util | |
parent | 424d5e4e11d16c789cf4a724d6b8aa3d77223ec4 (diff) |
driconf, glsl: Add a vs_position_always_invariant option
Many applications use multi-pass rendering and require their vertex
shader position to be computed the same way each time. Optimizations
may consider, say, fusing a multiply-add based on global usage of an
expression in a shader. But a second shader with the same expression
may have different code, causing that optimization to make the other
choice the second time around.
The correct solution is for applications to mark their VS outputs
'invariant', indicating they need multiple shaders to compute that
output in the same manner. However, most applications fail to do so.
So, we add a new driconf option - vs_position_always_invariant - which
forces the gl_Position output in vertex shaders to be marked invariant.
Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.")
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/xmlpool/t_options.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h index 7a665bfd655..fe186c1fa79 100644 --- a/src/util/xmlpool/t_options.h +++ b/src/util/xmlpool/t_options.h @@ -279,6 +279,11 @@ DRI_CONF_OPT_BEGIN_B(glsl_zero_init, def) \ DRI_CONF_DESC(en,gettext("Force uninitialized variables to default to zero")) \ DRI_CONF_OPT_END +#define DRI_CONF_VS_POSITION_ALWAYS_INVARIANT(def) \ +DRI_CONF_OPT_BEGIN_B(vs_position_always_invariant, def) \ + DRI_CONF_DESC(en,gettext("Force the vertex shader's gl_Position output to be considered 'invariant'")) \ +DRI_CONF_OPT_END + #define DRI_CONF_ALLOW_RGB10_CONFIGS(def) \ DRI_CONF_OPT_BEGIN_B(allow_rgb10_configs, def) \ DRI_CONF_DESC(en,gettext("Allow exposure of visuals and fbconfigs with rgb10a2 formats")) \ |