{
struct gl_fixedfunc_texture_unit *texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ if (!texUnit)
+ return GL_FALSE;
const GLbitfield newenabled = state
? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
const struct gl_fixedfunc_texture_unit *const texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ if (!texUnit)
+ return GL_FALSE;
+
return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE;
}
struct gl_fixedfunc_texture_unit *texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ /* The GL spec says that we should report an error if the unit is greater
+ * than GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, but in practice, only
+ * fixed-function units are usable. This is probably a spec bug.
+ * Ignore glTexEnv(GL_TEXTURE_ENV) calls for non-fixed-func units,
+ * because we don't want to process calls that have no effect.
+ */
+ if (!texUnit)
+ return;
+
switch (pname) {
case GL_TEXTURE_ENV_MODE:
set_env_mode(ctx, texUnit, (GLenum) iparam0);
struct gl_fixedfunc_texture_unit *texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ /* The GL spec says that we should report an error if the unit is greater
+ * than GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, but in practice, only
+ * fixed-function units are usable. This is probably a spec bug.
+ * Ignore calls for non-fixed-func units, because we don't process
+ * glTexEnv for them either.
+ */
+ if (!texUnit)
+ return;
+
if (pname == GL_TEXTURE_ENV_COLOR) {
if(ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
_mesa_update_state(ctx);
struct gl_fixedfunc_texture_unit *texUnit =
_mesa_get_current_fixedfunc_tex_unit(ctx);
+ /* The GL spec says that we should report an error if the unit is greater
+ * than GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, but in practice, only
+ * fixed-function units are usable. This is probably a spec bug.
+ * Ignore calls for non-fixed-func units, because we don't process
+ * glTexEnv for them either.
+ */
+ if (!texUnit)
+ return;
+
if (pname == GL_TEXTURE_ENV_COLOR) {
params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] );
params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] );
}
}
- for (u = 0; u < src->Const.MaxCombinedTextureImageUnits; u++) {
+ for (u = 0; u < src->Const.MaxTextureCoordUnits; u++) {
dst->Texture.FixedFuncUnit[u].Enabled = src->Texture.FixedFuncUnit[u].Enabled;
dst->Texture.FixedFuncUnit[u].EnvMode = src->Texture.FixedFuncUnit[u].EnvMode;
COPY_4V(dst->Texture.FixedFuncUnit[u].EnvColor, src->Texture.FixedFuncUnit[u].EnvColor);