[Mesa-dev] [PATCH] mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()
Brian Paul
brianp at vmware.com
Fri Sep 30 07:13:22 PDT 2011
On 09/30/2011 12:51 AM, Eric Anholt wrote:
> On Thu, 29 Sep 2011 20:44:14 -0600, Brian Paul<brian.e.paul at gmail.com> wrote:
>> From: Brian Paul<brianp at vmware.com>
>>
>> If color material mode is enabled, constant buffer entries related
>> to the material coefficients will depend on glColor. So add
>> _NEW_CURRENT_ATTRIB to the bitset returned for material-related
>> constants in _mesa_program_state_flags().
>>
>> This fixes a bug exercised by the new piglit draw-arrays-colormaterial
>> test.
>> ---
>> src/mesa/program/prog_statevars.c | 5 ++++-
>> 1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
>> index 6aa2409..504944c 100644
>> --- a/src/mesa/program/prog_statevars.c
>> +++ b/src/mesa/program/prog_statevars.c
>> @@ -664,10 +664,13 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
>> {
>> switch (state[0]) {
>> case STATE_MATERIAL:
>> + case STATE_LIGHTPROD:
>> + /* these can be effected by glColor when colormaterial mode is used */
>> + return _NEW_LIGHT | _NEW_CURRENT_ATTRIB;
>> +
>> case STATE_LIGHT:
>> case STATE_LIGHTMODEL_AMBIENT:
>> case STATE_LIGHTMODEL_SCENECOLOR:
>> - case STATE_LIGHTPROD:
>> return _NEW_LIGHT;
>
> Don't SCENECOLOR and AMBIENT, and PROD rely on it, since they also hit
> ctx->Light.Material.Attrib[]? I think STATE_LIGHT is the only
> exception.
Yes, SCENECOLOR depends on material coefficients, but
LIGHTMODEL_AMBIENT does not. I'll fix that and commit.
-Brian
More information about the mesa-dev
mailing list