diff options
author | Ian Romanick <[email protected]> | 2016-08-18 10:57:44 +0100 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-26 15:03:14 -0700 |
commit | a7d92c3c0b0df1a5e8be3f8208868828043ab630 (patch) | |
tree | e4089893486bf8982c105c723e1cc98af4e02fdc /src/mesa/main/uniform_query.cpp | |
parent | f926cf5bd0ade3273b320ca4483d826fcfe20bbb (diff) |
nouveau: Fix non-1x post-scale factor with DOT3 combiner
Fixes long standing bug on NV10 and NV20 where using a non-1x RGB or A
post-scale with GL_DOT3_RGB or GL_DOT3_RGBA texture environment would
not work.
The old combiner math uses HALF_BIAS_NORMAL and HALF_BIAS_NEGATE. The
GL_NV_register_combiners defines these as
HALF_BIAS_NORMAL_NV max(0.0, e) - 0.5
HALF_BIAS_NEGATE_NV -max(0.0, e) + 0.5
In order to get the correct result from the dot-product, the
intermediate dot-product must be multiplied by 4. This is a literal
implementation of the GL_ARB_texture_env_dot3 spec. It also requires
using the register combiner post-scale. As a result, the post-scale
cannot be used for the post-scale set by the application.
The new combiner math uses EXPAND_NORMAL and EXPAND_NEGATE. The
GL_NV_register_combiners defines these as
EXPAND_NORMAL_NV 2.0 * max(0.0, e) - 1.0
EXPAND_NEGATE_NV -2.0 * max(0.0, e) + 1.0
Since this fully expands the value to [-1, 1] range, the intermediate
dot-product result is the desired value. This leaves the register
combiner post-scale available for application use.
NOTE: I have not actually tested this.
Signed-off-by: Ian Romanick <[email protected]>
Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
0 files changed, 0 insertions, 0 deletions