From: Keith W. <ke...@va...> - 2001-05-10 14:35:28
|
Gareth Hughes wrote: > > Keith Whitwell wrote: > > > > Looking at the tdfx driver I see this: > > > > /* FIXME: Combine this into one call... > > */ > > FALLBACK( tmesa, TDFX_FALLBACK_BLEND_EQ, mode != GL_FUNC_ADD_EXT ); > > FALLBACK( tmesa, TDFX_FALLBACK_BLEND_EQ, > > ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY ); > > > > This is broken because the two conditions attempt to use a single bit. > > Imagine the case where (mode == GL_FUNC_ADD_EXT) but (ctx->Color.ColorLogicOp > > == GL_COPY): The first call will install a fallback, but the second will > > immediately clear the fallback... > > > > The solution is to associate a single logical condition for each bit in the > > fallback mask. In this case you could combine the two conditions with a > > disjunctive, or alternatively use different bits in the mask for the two > > conditions. > > That's me hacking away and being lazy (hence the comment). Fair enough. The use of that macro seems to confuse people (they think that they can use the same bit with different expressions in different places). The fact that the texture state code does this and gets away with it probably adds to the confusion. Keith |