diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-12-23 16:01:59 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-12-23 16:01:59 +1100 |
commit | 6c14cf58343135491068e96575bf4e61a6d34c87 (patch) | |
tree | 0b826725f867a706d558492ac9abf881ab06e7a5 /src/mesa/pipe/xlib | |
parent | bf2410ca73d1eabc7134e51855d0b603897229e4 (diff) | |
parent | 4fa7afabc966a3d37324f2f9b03e1cc466db7773 (diff) |
Merge branch 'upstream-gallium-0.1' into darktama-gallium-0.1
Diffstat (limited to 'src/mesa/pipe/xlib')
-rw-r--r-- | src/mesa/pipe/xlib/brw_aub.c | 2 | ||||
-rw-r--r-- | src/mesa/pipe/xlib/xm_api.c | 12 | ||||
-rw-r--r-- | src/mesa/pipe/xlib/xm_winsys_aub.c | 24 |
3 files changed, 28 insertions, 10 deletions
diff --git a/src/mesa/pipe/xlib/brw_aub.c b/src/mesa/pipe/xlib/brw_aub.c index 1b7fc3c20e..541d50c6e4 100644 --- a/src/mesa/pipe/xlib/brw_aub.c +++ b/src/mesa/pipe/xlib/brw_aub.c @@ -331,7 +331,7 @@ void brw_aub_dump_bmp( struct brw_aubfile *aubfile, db.format = format; db.bpp = surface->cpp * 8; db.pitch = surface->pitch; - db.xsize = surface->pitch; + db.xsize = surface->width; db.ysize = surface->height; db.addr = gtt_offset; db.unknown = /* surface->tiled ? 0x4 : */ 0x0; diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/mesa/pipe/xlib/xm_api.c index 142074bc65..ebf4c21eaf 100644 --- a/src/mesa/pipe/xlib/xm_api.c +++ b/src/mesa/pipe/xlib/xm_api.c @@ -207,7 +207,7 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win ) } static Status -get_drawable_size( XMesaDisplay *dpy, Drawable d, GLuint *width, GLuint *height ) +get_drawable_size( XMesaDisplay *dpy, Drawable d, uint *width, uint *height ) { Window root; Status stat; @@ -323,6 +323,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, XMesaBuffer b; GLframebuffer *fb; enum pipe_format colorFormat, depthFormat, stencilFormat; + uint width, height; ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER); @@ -359,11 +360,14 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, } + get_drawable_size(vis->display, d, &width, &height); + /* * Create framebuffer, but we'll plug in our own renderbuffers below. */ - b->stfb = st_create_framebuffer(&vis->mesa_visual, GL_TRUE, + b->stfb = st_create_framebuffer(&vis->mesa_visual, colorFormat, depthFormat, stencilFormat, + width, height, (void *) b); fb = &b->stfb->Base; @@ -1067,12 +1071,12 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, */ _glapi_check_multithread(); + st_make_current(c->st, drawBuffer->stfb, readBuffer->stfb); + xmesa_check_and_update_buffer_size(c, drawBuffer); if (readBuffer != drawBuffer) xmesa_check_and_update_buffer_size(c, readBuffer); - st_make_current(c->st, drawBuffer->stfb, readBuffer->stfb); - /* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */ drawBuffer->wasCurrent = GL_TRUE; } diff --git a/src/mesa/pipe/xlib/xm_winsys_aub.c b/src/mesa/pipe/xlib/xm_winsys_aub.c index ef3d975afb..b207638390 100644 --- a/src/mesa/pipe/xlib/xm_winsys_aub.c +++ b/src/mesa/pipe/xlib/xm_winsys_aub.c @@ -35,9 +35,9 @@ #include "glxheader.h" #include "xmesaP.h" -#include "main/macros.h" #include "pipe/p_winsys.h" +#include "pipe/p_util.h" #include "pipe/i965simple/brw_winsys.h" #include "brw_aub.h" #include "xm_winsys_aub.h" @@ -159,13 +159,13 @@ static int aub_buffer_data(struct pipe_winsys *winsys, assert(iws->used + size < iws->size); sbo->data = iws->pool + iws->used; sbo->offset = AUB_BUF_START + iws->used; - iws->used += size; + iws->used += align(size, 4096); } sbo->size = size; if (data != NULL) { - memcpy(iws->pool, data, size); + memcpy(sbo->data, data, size); brw_aub_gtt_data( iws->aubfile, sbo->offset, @@ -226,10 +226,16 @@ void xmesa_commands_aub(struct pipe_winsys *winsys, unsigned nr_dwords) { struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys); + unsigned size = nr_dwords * 4; + + assert(iws->used + size < iws->size); + brw_aub_gtt_cmds( iws->aubfile, - 0, /* ?? */ + AUB_BUF_START + iws->used, cmds, nr_dwords * sizeof(int) ); + + iws->used += align(size, 4096); } @@ -253,7 +259,7 @@ static int aub_buffer_get_subdata(struct pipe_winsys *winsys, void *data) { struct aub_buffer *sbo = aub_bo(buf); - assert(sbo->size > offset + size); + assert(sbo->size >= offset + size); memcpy(data, sbo->data + offset, size); return 0; } @@ -590,6 +596,14 @@ static void aub_i965_buffer_subdata_typed(struct brw_winsys *winsys, aub_type = DW_SURFACE_STATE; aub_sub_type = DWSS_BINDING_TABLE_STATE; break; + case BRW_CONSTANT_BUFFER: + aub_type = DW_CONSTANT_URB_ENTRY; + aub_sub_type = 0; + break; + + default: + assert(0); + break; } xmesa_buffer_subdata_aub( iws->pipe_winsys, |