struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
if (texObj == unit->Current1D) {
_mesa_reference_texobj(&unit->Current1D, ctx->Shared->Default1D);
+ ASSERT(unit->Current1D);
}
else if (texObj == unit->Current2D) {
_mesa_reference_texobj(&unit->Current2D, ctx->Shared->Default2D);
+ ASSERT(unit->Current2D);
}
else if (texObj == unit->Current3D) {
_mesa_reference_texobj(&unit->Current3D, ctx->Shared->Default3D);
+ ASSERT(unit->Current3D);
}
else if (texObj == unit->CurrentCubeMap) {
_mesa_reference_texobj(&unit->CurrentCubeMap, ctx->Shared->DefaultCubeMap);
+ ASSERT(unit->CurrentCubeMap);
}
else if (texObj == unit->CurrentRect) {
_mesa_reference_texobj(&unit->CurrentRect, ctx->Shared->DefaultRect);
+ ASSERT(unit->CurrentRect);
}
else if (texObj == unit->Current1DArray) {
_mesa_reference_texobj(&unit->Current1DArray, ctx->Shared->Default1DArray);
+ ASSERT(unit->Current1DArray);
}
else if (texObj == unit->Current2DArray) {
_mesa_reference_texobj(&unit->Current2DArray, ctx->Shared->Default2DArray);
+ ASSERT(unit->Current2DArray);
}
}
}
switch (target) {
case GL_TEXTURE_1D:
_mesa_reference_texobj(&texUnit->Current1D, newTexObj);
+ ASSERT(texUnit->Current1D);
break;
case GL_TEXTURE_2D:
_mesa_reference_texobj(&texUnit->Current2D, newTexObj);
+ ASSERT(texUnit->Current2D);
break;
case GL_TEXTURE_3D:
_mesa_reference_texobj(&texUnit->Current3D, newTexObj);
+ ASSERT(texUnit->Current3D);
break;
case GL_TEXTURE_CUBE_MAP_ARB:
_mesa_reference_texobj(&texUnit->CurrentCubeMap, newTexObj);
+ ASSERT(texUnit->CurrentCubeMap);
break;
case GL_TEXTURE_RECTANGLE_NV:
_mesa_reference_texobj(&texUnit->CurrentRect, newTexObj);
+ ASSERT(texUnit->CurrentRect);
break;
case GL_TEXTURE_1D_ARRAY_EXT:
texUnit->Current1DArray = newTexObj;
+ ASSERT(texUnit->Current1DArray);
break;
case GL_TEXTURE_2D_ARRAY_EXT:
texUnit->Current2DArray = newTexObj;
+ ASSERT(texUnit->Current2DArray);
break;
default:
/* Bad target should be caught above */
enableBits = texUnit->Enabled;
}
+ ASSERT(texUnit->Current1D);
+ ASSERT(texUnit->Current2D);
+ ASSERT(texUnit->Current3D);
+ ASSERT(texUnit->CurrentCubeMap);
+ ASSERT(texUnit->CurrentRect);
+ ASSERT(texUnit->Current1DArray);
+ ASSERT(texUnit->Current2DArray);
+
/* Look for the highest-priority texture target that's enabled and
* complete. That's the one we'll use for texturing. If we're using
* a fragment program we're guaranteed that bitcount(enabledBits) <= 1.