[Mesa-dev] [PATCH 2/9] mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it

Ian Romanick idr at freedesktop.org
Tue Apr 19 16:14:27 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/16/2011 06:48 AM, Brian Paul wrote:
> On Sat, Apr 16, 2011 at 12:10 AM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> ---
>>  src/mesa/swrast/s_context.c |   15 ++++-----------
>>  src/mesa/tnl/t_context.c    |   12 ++++--------
>>  2 files changed, 8 insertions(+), 19 deletions(-)
>>
>> diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
>> index 491fcfc..b3e3968 100644
>> --- a/src/mesa/swrast/s_context.c
>> +++ b/src/mesa/swrast/s_context.c
>> @@ -248,18 +248,11 @@ _swrast_update_fog_state( struct gl_context *ctx )
>>    SWcontext *swrast = SWRAST_CONTEXT(ctx);
>>    const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
>>
>> +   assert((fp == NULL) || (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB));
>> +
>>    /* determine if fog is needed, and if so, which fog mode */
>> -   swrast->_FogEnabled = GL_FALSE;
>> -   if (fp && fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB) {
>> -      if (fp->FogOption != GL_NONE) {
>> -         swrast->_FogEnabled = GL_TRUE;
>> -         swrast->_FogMode = fp->FogOption;
>> -      }
>> -   }
>> -   else if (ctx->Fog.Enabled) {
>> -      swrast->_FogEnabled = GL_TRUE;
>> -      swrast->_FogMode = ctx->Fog.Mode;
>> -   }
>> +   swrast->_FogEnabled = (fp == NULL && ctx->Fog.Enabled);
>> +   swrast->_FogMode = ctx->Fog.Mode;
> 
> We might as well get rid of swrast->_FogMode and just use
> ctx->Fog.Mode everywhere.

Yeah, that would probably work.  I'll send that as a follow-on patch.
Can I call this a Reviewed-by on the patches that are here?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2uF1MACgkQX1gOwKyEAw8TqgCgnoC8rHdAeBJRPInR7xMqXPoe
EHkAn2s5UGSQVEmdcYqbb3joJzBB7RSc
=CUjP
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list