* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
* it means that an environment is selected that the hardware cannot do. This
* is the way the Radeon and R200 drivers work.
*
* it means that an environment is selected that the hardware cannot do. This
* is the way the Radeon and R200 drivers work.
*
GLuint texel_op, GLuint * state, const GLfloat * factor)
{
const GLuint numColorArgs = combine->_NumArgsRGB;
GLuint texel_op, GLuint * state, const GLfloat * factor)
{
const GLuint numColorArgs = combine->_NumArgsRGB;
if (combine->ModeRGB == GL_DOT3_RGBA_EXT ||
combine->ModeRGB == GL_DOT3_RGBA) {
ablendop = TEXBLENDOP_DOT4;
if (combine->ModeRGB == GL_DOT3_RGBA_EXT ||
combine->ModeRGB == GL_DOT3_RGBA) {
ablendop = TEXBLENDOP_DOT4;
args_A[0] = TEXBLENDARG_FACTOR; /* the global factor */
args_A[1] = TEXBLENDARG_FACTOR;
args_A[2] = TEXBLENDARG_FACTOR;
args_A[0] = TEXBLENDARG_FACTOR; /* the global factor */
args_A[1] = TEXBLENDARG_FACTOR;
args_A[2] = TEXBLENDARG_FACTOR;
static void
emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit,
static void
emit_texblend(struct i830_context *i830, GLuint unit, GLuint blendUnit,
{
struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit];
GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz;
if (0)
{
struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit];
GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz;
if (0)
- fprintf(stderr, "%s unit %d\n", __FUNCTION__, unit);
+ fprintf(stderr, "%s unit %d\n", __func__, unit);
- GLcontext *ctx = &i830->intel.ctx;
- GLuint unit, last_stage = 0, blendunit = 0;
-
- I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, GL_FALSE);
+ struct gl_context *ctx = &i830->intel.ctx;
+ GLuint unit, blendunit = 0;
- if (ctx->Texture._EnabledUnits) {
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled)
- last_stage = unit;
+ I830_ACTIVESTATE(i830, I830_UPLOAD_TEXBLEND_ALL, false);
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++)
- if (ctx->Texture.Unit[unit]._ReallyEnabled)
- emit_texblend(i830, unit, blendunit++, last_stage == unit);
- }
- else {
+ if (ctx->Texture._MaxEnabledTexImageUnit != -1) {
+ for (unit = 0; unit <= ctx->Texture._MaxEnabledTexImageUnit; unit++)
+ if (ctx->Texture.Unit[unit]._Current)
+ emit_texblend(i830, unit, blendunit++,
+ unit == ctx->Texture._MaxEnabledTexImageUnit);
+ } else {