summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-06-24 08:54:37 -0600
committerBrian Paul <brianp@vmware.com>2009-06-24 08:54:37 -0600
commita04af335a42ce3b28e59ff9b85b2bd433a9d7b12 (patch)
tree768262f4e8e4a9f49c64b76882c48f1ede445dd5 /src/mesa
parentd60b2c68552a2729dfdb33c2bac4822453cf8ae2 (diff)
parentc25534f30d326c15dff845775d9bd55ba6064049 (diff)
Merge branch 'mesa_7_5_branch'
Conflicts: src/mesa/drivers/dri/i915/i915_tex_layout.c src/mesa/drivers/dri/i965/brw_wm_glsl.c src/mesa/drivers/dri/intel/intel_buffer_objects.c src/mesa/drivers/dri/intel/intel_pixel_bitmap.c src/mesa/drivers/dri/intel/intel_pixel_draw.c src/mesa/main/enums.c src/mesa/main/texstate.c src/mesa/vbo/vbo_exec_array.c
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c15
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c2
-rw-r--r--src/mesa/drivers/x11/fakeglx.c2
-rw-r--r--src/mesa/main/compiler.h4
-rw-r--r--src/mesa/main/context.c41
-rw-r--r--src/mesa/main/context.h3
-rw-r--r--src/mesa/main/enums.c4
-rw-r--r--src/mesa/main/mipmap.c3
-rw-r--r--src/mesa/main/mtypes.h2
-rw-r--r--src/mesa/main/teximage.c2
-rw-r--r--src/mesa/state_tracker/st_context.c15
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c11
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c3
14 files changed, 66 insertions, 45 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 010000309b..ff8acc5c58 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -300,19 +300,34 @@ intel_bufferobj_buffer(struct intel_context *intel,
}
if (intel_obj->buffer == NULL) {
+<<<<<<< HEAD:src/mesa/drivers/dri/intel/intel_buffer_objects.c
void *sys_buffer = intel_obj->sys_buffer;
/* only one of buffer and sys_buffer could be non-NULL */
+=======
+>>>>>>> mesa_7_5_branch:src/mesa/drivers/dri/intel/intel_buffer_objects.c
intel_bufferobj_alloc_buffer(intel, intel_obj);
+<<<<<<< HEAD:src/mesa/drivers/dri/intel/intel_buffer_objects.c
intel_obj->sys_buffer = NULL;
+=======
+>>>>>>> mesa_7_5_branch:src/mesa/drivers/dri/intel/intel_buffer_objects.c
intel_bufferobj_subdata(&intel->ctx,
GL_ARRAY_BUFFER_ARB,
0,
intel_obj->Base.Size,
+<<<<<<< HEAD:src/mesa/drivers/dri/intel/intel_buffer_objects.c
sys_buffer,
+=======
+ intel_obj->sys_buffer,
+>>>>>>> mesa_7_5_branch:src/mesa/drivers/dri/intel/intel_buffer_objects.c
&intel_obj->Base);
+<<<<<<< HEAD:src/mesa/drivers/dri/intel/intel_buffer_objects.c
_mesa_free(sys_buffer);
+=======
+ _mesa_free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+>>>>>>> mesa_7_5_branch:src/mesa/drivers/dri/intel/intel_buffer_objects.c
}
return intel_obj->buffer;
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index d79d625f77..b8825dbaef 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -359,8 +359,12 @@ intel_stencil_drawpixels(GLcontext * ctx,
_mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices);
_mesa_Enable(GL_VERTEX_ARRAY);
+<<<<<<< HEAD:src/mesa/drivers/dri/intel/intel_pixel_draw.c
intel_meta_set_default_texrect(intel);
+=======
+ _mesa_Enable(GL_TEXTURE_COORD_ARRAY);
+>>>>>>> mesa_7_5_branch:src/mesa/drivers/dri/intel/intel_pixel_draw.c
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
intel_meta_restore_texcoords(intel);
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 7aa8075aa7..14a11ea1fb 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -412,6 +412,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+ _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(ctx);
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 3b004a3ee2..34e0b8bc8d 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -2218,7 +2218,7 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
if (!dpy || !config || !pixmap)
return 0;
- for (attr = attribList; *attr; attr++) {
+ for (attr = attribList; attr && *attr; attr++) {
switch (*attr) {
case GLX_TEXTURE_FORMAT_EXT:
attr++;
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 93103fe878..e79bbc2ac5 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -468,9 +468,9 @@ do { \
#endif
-
+#ifndef Elements
#define Elements(x) (sizeof(x)/sizeof(*(x)))
-
+#endif
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index eafe292a1f..a0681c8414 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1259,6 +1259,24 @@ initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
/**
+ * Check if the viewport/scissor size has not yet been initialized.
+ * Initialize the size if the given width and height are non-zero.
+ */
+void
+_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height)
+{
+ if (!ctx->ViewportInitialized && width > 0 && height > 0) {
+ /* Note: set flag here, before calling _mesa_set_viewport(), to prevent
+ * potential infinite recursion.
+ */
+ ctx->ViewportInitialized = GL_TRUE;
+ _mesa_set_viewport(ctx, 0, 0, width, height);
+ _mesa_set_scissor(ctx, 0, 0, width, height);
+ }
+}
+
+
+/**
* Bind the given context to the given drawBuffer and readBuffer and
* make it the current context for the calling thread.
* We'll render into the drawBuffer and read pixels from the
@@ -1375,25 +1393,24 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
ASSERT(drawBuffer->Height > 0);
#endif
- if (newCtx->FirstTimeCurrent) {
- /* set initial viewport and scissor size now */
- _mesa_set_viewport(newCtx, 0, 0,
- drawBuffer->Width, drawBuffer->Height);
- _mesa_set_scissor(newCtx, 0, 0,
- drawBuffer->Width, drawBuffer->Height );
- check_context_limits(newCtx);
+ if (drawBuffer) {
+ _mesa_check_init_viewport(newCtx,
+ drawBuffer->Width, drawBuffer->Height);
}
}
- /* We can use this to help debug user's problems. Tell them to set
- * the MESA_INFO env variable before running their app. Then the
- * first time each context is made current we'll print some useful
- * information.
- */
if (newCtx->FirstTimeCurrent) {
+ check_context_limits(newCtx);
+
+ /* We can use this to help debug user's problems. Tell them to set
+ * the MESA_INFO env variable before running their app. Then the
+ * first time each context is made current we'll print some useful
+ * information.
+ */
if (_mesa_getenv("MESA_INFO")) {
_mesa_print_info();
}
+
newCtx->FirstTimeCurrent = GL_FALSE;
}
}
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 6b3e1b2b97..0531ae8ee8 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -130,6 +130,9 @@ extern void
_mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
+extern void
+_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height);
+
extern GLboolean
_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer );
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index 2745fb3d66..87ff67dd11 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -958,8 +958,8 @@ LONGSTRING static const char enum_string_table[] =
"GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
"GL_MAX_VARYING_FLOATS\0"
"GL_MAX_VARYING_FLOATS_ARB\0"
- "GL_MAX_VERTEX_ATTRIBS\0"
- "GL_MAX_VERTEX_ATTRIBS_ARB\0"
+ "GL_MAX_VERTEX_GENERIC_ATTRIBS\0"
+ "GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB\0"
"GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
"GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
"GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 872982fa43..3dca09d9f2 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1601,9 +1601,6 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
return;
}
- if (dstImage->ImageOffsets)
- _mesa_free(dstImage->ImageOffsets);
-
/* Free old image data */
if (dstImage->Data)
ctx->Driver.FreeTexImageData(ctx, dstImage);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0c071ee19a..d1614af736 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2979,6 +2979,8 @@ struct __GLcontextRec
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
+ GLboolean ViewportInitialized; /**< has viewport size been initialized? */
+
GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */
/** \name Derived state */
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 76b46d700b..6e21066537 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1250,6 +1250,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
* We allocate the array for 1D/2D textures too in order to avoid special-
* case code in the texstore routines.
*/
+ if (img->ImageOffsets)
+ _mesa_free(img->ImageOffsets);
img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint));
for (i = 0; i < depth; i++) {
img->ImageOffsets[i] = i * width * height;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 92ddffc014..8514b6b375 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -274,20 +274,11 @@ st_make_current(struct st_context *st,
_glapi_check_multithread();
if (st) {
- GLboolean firstTime = st->ctx->FirstTimeCurrent;
- if(!_mesa_make_current(st->ctx, &draw->Base, &read->Base))
+ if (!_mesa_make_current(st->ctx, &draw->Base, &read->Base))
return GL_FALSE;
- /* Need to initialize viewport here since draw->Base->Width/Height
- * will still be zero at this point.
- * This could be improved, but would require rather extensive work
- * elsewhere (allocate rb surface storage sooner)
- */
- if (firstTime) {
- GLuint w = draw->InitWidth, h = draw->InitHeight;
- _mesa_set_viewport(st->ctx, 0, 0, w, h);
- _mesa_set_scissor(st->ctx, 0, 0, w, h);
- }
+ _mesa_check_init_viewport(st->ctx, draw->InitWidth, draw->InitHeight);
+
return GL_TRUE;
}
else {
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 7072cbe62c..13589151ba 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -134,16 +134,7 @@ void st_resize_framebuffer( struct st_framebuffer *stfb,
if (stfb->Base.Width != width || stfb->Base.Height != height) {
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
- if (stfb->InitWidth == 0 && stfb->InitHeight == 0) {
- /* didn't have a valid size until now */
- stfb->InitWidth = width;
- stfb->InitHeight = height;
- if (ctx->Viewport.Width <= 1) {
- /* set context's initial viewport/scissor size */
- _mesa_set_viewport(ctx, 0, 0, width, height);
- _mesa_set_scissor(ctx, 0, 0, width, height);
- }
- }
+ _mesa_check_init_viewport(ctx, width, height);
_mesa_resize_framebuffer(ctx, &stfb->Base, width, height);
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index dc6d77825f..58f6933652 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -198,9 +198,6 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
return;
}
- if (dstImage->ImageOffsets)
- _mesa_free(dstImage->ImageOffsets);
-
/* Free old image data */
if (dstImage->Data)
ctx->Driver.FreeTexImageData(ctx, dstImage);