[Mesa-dev] GL_NV_texture_env_combine4, Mesa and TNT2

Francisco Jerez currojerez at riseup.net
Wed Sep 8 13:29:28 PDT 2010


Ian Romanick <idr at freedesktop.org> writes:

> [...]
>
> At some point it may be worth adding a dri-conf option to enable fake
> ARB_texture_env_combine support.  There are a few apps that check for
> that but not for the EXT.  I'd swear that NV drivers used to support the
> ARB extension on TNT2 hardware.  They did some hack that let them do
> some cases of GL_SUBTRACT using the combine4 hardware.  I may just be
> misremembering, though.
>
Yup, we can hack up GL_SUBTRACT support as long as the user leaves the
constant color untouched, not sure it's worth the work though, nvidia
doesn't seem to claim ARB support in this old extension list I had
laying around [1]. Maybe it was someone else?

>>> diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
>>> index d7c86d4..d95ac97 100644
>>> --- a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
>>> +++ b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
>>> @@ -89,13 +89,13 @@ get_input_source(struct combiner_state *rc, int source)
>>>  	case GL_TEXTURE1:
>>>  		return COMBINER_SOURCE(TEXTURE1);
>>>
>>> -	case GL_CONSTANT:
>>> +	case GL_CONSTANT_EXT:
>>>  		return COMBINER_SOURCE(CONSTANT);
>>>
>>> -	case GL_PRIMARY_COLOR:
>>> +	case GL_PRIMARY_COLOR_EXT:
>>>  		return COMBINER_SOURCE(PRIMARY_COLOR);
>>>
>>> -	case GL_PREVIOUS:
>>> +	case GL_PREVIOUS_EXT:
>>>  		return rc->unit ? COMBINER_SOURCE(PREVIOUS) :
>>>  			COMBINER_SOURCE(PRIMARY_COLOR);
>>>
>>> @@ -202,7 +202,7 @@ setup_combiner(struct combiner_state *rc)
>>>  		UNSIGNED_OP(rc);
>>>  		break;
>>>
>>> -	case GL_INTERPOLATE:
>>> +	case GL_INTERPOLATE_EXT:
>>>  		INPUT_ARG(rc, 0, 0, 0);
>>>  		INPUT_ARG(rc, 1, 2, 0);
>>>  		INPUT_ARG(rc, 2, 1, 0);
>>> @@ -210,7 +210,7 @@ setup_combiner(struct combiner_state *rc)
>>>  		UNSIGNED_OP(rc);
>>>  		break;
>>>
>>> -	case GL_ADD_SIGNED:
>>> +	case GL_ADD_SIGNED_EXT:
>>>  		INPUT_ARG(rc, 0, 0, 0);
>>>  		INPUT_SRC(rc, 1, ZERO, INVERT);
>>>  		INPUT_ARG(rc, 2, 1, 0);
>>
>> That's pointless, the _EXT definitions match the core ones, they're just
>> uglier.
>
> Agreed.  The convention in Mesa has been:
>
>  - Use the most recent names available for enums.
>
>  - Don't change the enums used unless there is good reason.
>
> This particular patch fails both.

[1] http://annarchy.freedesktop.org/~currojerez/glxinfo-nvidia-nv05.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100908/776a241e/attachment-0001.pgp>


More information about the mesa-dev mailing list