aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2008-02-26 17:57:41 -0500
committerKristian Høgsberg <[email protected]>2008-02-26 18:01:13 -0500
commit20b8bff49cba3e8246e29004c5ff38f231d589ff (patch)
tree5a09f5f8d4e4fbae726eabd97b03ea4ebd695451 /src/mesa/drivers/dri/i965
parent451bd1941e9791882f7931c8613643f152871e79 (diff)
i965: Setup framebuffer texture in meta_draw_region.
With DRI2 we there is no screen region until a drawable is bound to the context. Set up the framebuffer texture in meta_draw_region instead which should also handle the case where the draw region changes as a result of resizing a redirected window or resizing the screen.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_metaops.c5
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex.c9
4 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index de0b74a8cbb..2d32f1d6147 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -194,8 +194,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
brw_ProgramCacheInit( ctx );
- brw_FrameBufferTexInit( brw );
-
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index a6c60aa4593..49e739b0ad8 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -653,7 +653,8 @@ void brw_debug_batch(struct intel_context *intel);
* brw_tex.c
*/
void brwUpdateTextureState( struct intel_context *intel );
-void brw_FrameBufferTexInit( struct brw_context *brw );
+void brw_FrameBufferTexInit( struct brw_context *brw,
+ struct intel_region *region );
void brw_FrameBufferTexDestroy( struct brw_context *brw );
void brw_validate_textures( struct brw_context *brw );
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
index 525748408d6..3f5df27b887 100644
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ b/src/mesa/drivers/dri/i965/brw_metaops.c
@@ -369,6 +369,11 @@ static void meta_draw_region( struct intel_context *intel,
brw->state.draw_region = draw_region;
brw->state.depth_region = depth_region;
+ if (intel->frame_buffer_texobj != NULL)
+ brw_FrameBufferTexDestroy(brw);
+
+ brw_FrameBufferTexInit(brw, draw_region);
+
brw->state.dirty.mesa |= _NEW_BUFFERS;
}
diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c
index 05f724cc234..ef14b8e89f8 100644
--- a/src/mesa/drivers/dri/i965/brw_tex.c
+++ b/src/mesa/drivers/dri/i965/brw_tex.c
@@ -49,11 +49,11 @@
#include "brw_defines.h"
-void brw_FrameBufferTexInit( struct brw_context *brw )
+void brw_FrameBufferTexInit( struct brw_context *brw,
+ struct intel_region *region )
{
struct intel_context *intel = &brw->intel;
GLcontext *ctx = &intel->ctx;
- struct intel_region *region = intel->front_region;
struct gl_texture_object *obj;
struct gl_texture_image *img;
@@ -74,8 +74,9 @@ void brw_FrameBufferTexInit( struct brw_context *brw )
void brw_FrameBufferTexDestroy( struct brw_context *brw )
{
- brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx,
- brw->intel.frame_buffer_texobj );
+ if (brw->intel.frame_buffer_texobj != NULL)
+ brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx,
+ brw->intel.frame_buffer_texobj );
}
/**