summaryrefslogtreecommitdiff
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ace68499d7..21adcf3210 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -97,12 +97,9 @@
#include "fog.h"
#include "framebuffer.h"
#include "get.h"
-#include "glthread.h"
-#include "glapioffsets.h"
#include "histogram.h"
#include "hint.h"
#include "hash.h"
-#include "atifragshader.h"
#include "light.h"
#include "lines.h"
#include "macros.h"
@@ -110,9 +107,6 @@
#include "pixel.h"
#include "points.h"
#include "polygon.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "program.h"
-#endif
#include "queryobj.h"
#include "rastpos.h"
#include "simple_list.h"
@@ -126,13 +120,19 @@
#include "varray.h"
#include "version.h"
#include "vtxfmt.h"
+#include "glapi/glthread.h"
+#include "glapi/glapioffsets.h"
+#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#include "shader/program.h"
+#endif
+#include "shader/shader_api.h"
+#include "shader/atifragshader.h"
#if _HAVE_FULL_GL
#include "math/m_translate.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "math/mathmod.h"
#endif
-#include "shader_api.h"
#ifdef USE_SPARC_ASM
#include "sparc/sparc.h"
@@ -467,12 +467,22 @@ alloc_shared_state( GLcontext *ctx )
if (!ss->DefaultRect)
goto cleanup;
+ ss->Default1DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D_ARRAY_EXT);
+ if (!ss->Default1DArray)
+ goto cleanup;
+
+ ss->Default2DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D_ARRAY_EXT);
+ if (!ss->Default2DArray)
+ goto cleanup;
+
/* Effectively bind the default textures to all texture units */
ss->Default1D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
ss->Default2D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
ss->Default3D->RefCount += MAX_TEXTURE_IMAGE_UNITS;
ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS;
ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS;
+ ss->Default1DArray->RefCount += MAX_TEXTURE_IMAGE_UNITS;
+ ss->Default2DArray->RefCount += MAX_TEXTURE_IMAGE_UNITS;
_glthread_INIT_MUTEX(ss->TexMutex);
ss->TextureStateStamp = 0;
@@ -772,6 +782,7 @@ _mesa_init_constants(GLcontext *ctx)
ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
+ ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
@@ -967,7 +978,7 @@ init_attrib_groups(GLcontext *ctx)
static int
generic_nop(void)
{
- _mesa_problem(NULL, "User called no-op dispatch function (an unsupported extension function?)");
+ _mesa_warning(NULL, "User called no-op dispatch function (an unsupported extension function?)");
return 0;
}
@@ -1346,9 +1357,9 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask )
* Check if the given context can render into the given framebuffer
* by checking visual attributes.
*
- * XXX this may go away someday because we're moving toward more freedom
- * in binding contexts to drawables with different visual attributes.
- * The GL_EXT_f_b_o extension is prompting some of that.
+ * Most of these tests could go away because Mesa is now pretty flexible
+ * in terms of mixing rendering contexts with framebuffers. As long
+ * as RGB vs. CI mode agree, we're probably good.
*
* \return GL_TRUE if compatible, GL_FALSE otherwise.
*/
@@ -1382,8 +1393,11 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
return GL_FALSE;
if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
return GL_FALSE;
+#if 0
+ /* disabled (see bug 11161) */
if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
return GL_FALSE;
+#endif
if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
return GL_FALSE;