/* GL_ARB_multitexture */
void GLAPIENTRY
-_mesa_ActiveTextureARB(GLenum texture)
+_mesa_ActiveTexture(GLenum texture)
{
const GLuint texUnit = texture - GL_TEXTURE0;
GLuint k;
/* GL_ARB_multitexture */
void GLAPIENTRY
-_mesa_ClientActiveTextureARB(GLenum texture)
+_mesa_ClientActiveTexture(GLenum texture)
{
GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = texture - GL_TEXTURE0;
{
struct gl_tex_env_combine_state *combine;
+ /* No combiners will apply to this. */
+ if (texUnit->_Current->Target == GL_TEXTURE_BUFFER)
+ return;
+
/* Set the texUnit->_CurrentCombine field to point to the user's combiner
* state, or the combiner state which is derived from traditional texenv
* mode.
GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
- format = texObj->Sampler.DepthMode;
+ format = texObj->DepthMode;
}
calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
texUnit->_CurrentCombine = & texUnit->_EnvMode;
texTarget = (gl_texture_index) (ffs(enabledTargets) - 1);
texObj = _mesa_get_fallback_texture(ctx, texTarget);
+
+ assert(texObj);
+ if (!texObj) {
+ /* invalid fallback texture: don't enable the texture unit */
+ continue;
+ }
+
_mesa_reference_texobj(&texUnit->_Current, texObj);
texUnit->_ReallyEnabled = 1 << texTarget;
}
* values!
*/
static const GLenum targets[] = {
+ GL_TEXTURE_CUBE_MAP_ARRAY,
GL_TEXTURE_BUFFER,
GL_TEXTURE_2D_ARRAY_EXT,
GL_TEXTURE_1D_ARRAY_EXT,
/* GL_ARB_texture_buffer_object */
_mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL);
-#if FEATURE_sampler_objects
for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
_mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL);
}
-#endif
}