[Mesa-dev] [PATCH 10/14] mesa/main: Maintain compressed fog mode.
Marek Olšák
maraeo at gmail.com
Fri Apr 7 14:31:08 UTC 2017
On Thu, Mar 30, 2017 at 8:09 PM, Gustaw Smolarczyk <wielkiegie at gmail.com> wrote:
> Signed-off-by: Gustaw Smolarczyk <wielkiegie at gmail.com>
> ---
> src/mesa/main/enable.c | 1 +
> src/mesa/main/fog.c | 9 +++++++++
> src/mesa/main/mtypes.h | 14 ++++++++++++++
> 3 files changed, 24 insertions(+)
>
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> index d9d63a6b4b..ef278a318a 100644
> --- a/src/mesa/main/enable.c
> +++ b/src/mesa/main/enable.c
> @@ -385,6 +385,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
> return;
> FLUSH_VERTICES(ctx, _NEW_FOG);
> ctx->Fog.Enabled = state;
> + ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE;
> break;
> case GL_LIGHT0:
> case GL_LIGHT1:
> diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
> index 1ad939cfde..76e65080b7 100644
> --- a/src/mesa/main/fog.c
> +++ b/src/mesa/main/fog.c
> @@ -102,8 +102,13 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
> m = (GLenum) (GLint) *params;
> switch (m) {
> case GL_LINEAR:
> + ctx->Fog._PackedMode = FOG_LINEAR;
> + break;
> case GL_EXP:
> + ctx->Fog._PackedMode = FOG_EXP;
> + break;
> case GL_EXP2:
> + ctx->Fog._PackedMode = FOG_EXP2;
Perhaps these should be set before FLUSH_VERTICES?
Marek
More information about the mesa-dev
mailing list