summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-07-05 11:10:10 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-07-05 11:10:10 +0000
commit6396b8e5c46eec5f60e75a9780c165c9f778bcca (patch)
tree265c2be1155b5d495a612fd00000971f87645911
parent0f2144cd0c4d27603afcdfe8d3b6a64f8c7f5637 (diff)
fix more problems with getting window/buffer dimensions wrong after binding a new drawable
-rw-r--r--src/mesa/drivers/dri/i915/i915_vtbl.c10
-rw-r--r--src/mesa/main/buffers.c14
-rw-r--r--src/mesa/main/buffers.h2
-rw-r--r--src/mesa/main/context.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index b48566b6157..bfab87f4f35 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -138,7 +138,7 @@ static void i915_emit_invarient_state( struct intel_context *intel )
{
BATCH_LOCALS;
- BEGIN_BATCH( 200, 0 );
+ BEGIN_BATCH( 20, 0 );
OUT_BATCH(_3DSTATE_AA_CMD |
AA_LINE_ECAAR_WIDTH_ENABLE |
@@ -183,14 +183,6 @@ static void i915_emit_invarient_state( struct intel_context *intel )
(1));
OUT_BATCH(0);
- /* XXX: Use this */
- OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD |
- DISABLE_SCISSOR_RECT);
-
- OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD);
- OUT_BATCH(0);
- OUT_BATCH(0);
-
OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE);
OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index f2ef0eab33b..2f63125f0d8 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -590,11 +590,9 @@ _mesa_ReadBuffer(GLenum buffer)
* \note This function should only be called through the GL API, not
* from device drivers (as was done in the past).
*/
-void GLAPIENTRY
-_mesa_ResizeBuffersMESA( void )
-{
- GET_CURRENT_CONTEXT(ctx);
+void _mesa_resizebuffers( GLcontext *ctx )
+{
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
if (MESA_VERBOSE & VERBOSE_API)
@@ -636,6 +634,14 @@ _mesa_ResizeBuffersMESA( void )
ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
}
+void GLAPIENTRY
+_mesa_ResizeBuffersMESA( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_resizebuffers( ctx );
+}
+
/*
* XXX move somewhere else someday?
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 547fb28886e..2bb8b6aa3b7 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -78,4 +78,6 @@ extern void _mesa_set_scissor( GLcontext *ctx,
GLint x, GLint y, GLsizei width, GLsizei height );
+extern void _mesa_resizebuffers( GLcontext *ctx );
+
#endif
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index bbefc32804b..1efb7a681cb 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1635,6 +1635,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
if (readBuffer != drawBuffer && !readBuffer->Initialized) {
initialize_framebuffer_size(newCtx, readBuffer);
}
+
+ _mesa_resizebuffers(newCtx);
#endif
if (newCtx->FirstTimeCurrent) {
/* set initial viewport and scissor size now */