diff options
author | Fabian Bieler <[email protected]> | 2017-11-23 13:48:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-12-03 21:13:46 -0700 |
commit | c3ee464d7aa170225b5ec23b53a7f8d07663d428 (patch) | |
tree | 04f0396b8b6f0d6ee8e136c8e4fffda6f6133d1e /src/mesa/program/prog_statevars.c | |
parent | 27888977c1f1104d52caac8f023eeeaad7fabbec (diff) |
glsl: Fix gl_NormalScale.
GLSL shaders can access the normal scale factor with the built-in
gl_NormalScale. Mesa's modelspace lighting optimization uses a different
normal scale factor than defined in the spec. We have to take care not
to use this factor for gl_NormalScale.
Mesa already defines two seperate states: state.normalScale and
state.internal.normalScale. The first is used by the glsl compiler
while the later is used by the fixed function T&L pipeline. Previously
the only difference was some component swizzling. With this commit
state.normalScale always uses the normal scale factor for eyespace
lighting.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_statevars.c')
-rw-r--r-- | src/mesa/program/prog_statevars.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 91178e395cb..b69895c47fc 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -422,7 +422,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], return; case STATE_NORMAL_SCALE: - ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1); + ASSIGN_4V(value, ctx->_ModelViewInvScaleEyespace, 0, 0, 1); return; case STATE_INTERNAL: |