Artur Wyszynski wrote: > Hey, > when porting Gallium3D to Haiku, i came across a problem, which i cannot > trace. > On this screenshot http://hitomi.pl/haiku/gallium/haiku_gallium_problem.png > you can see our example application, which renders HAIKU string from > static meshes. > The problem is that only part of that is being rendered. > On plain mesa without gallium, everything is ok. > > Haiku bitmap size(used for display and == window size) and pipe_surface > from my flush_buffer, both have that same dimension 640x480 (set earlier > by st_framebuffer_resize). > To test that it can be a haiku problem when displaying, i set > glClearColor to white for that application, bitmap is set to gray, so > that black background and white fragment which you can see came from > gallium. > I even dumped every bitmap from code bellow(imported texture data), > which gaves that same picture as seen in window (don't count that red > rect, it's there for test if is it displayed correctly, drawed after > bitmap). > > Here is flush frontbuffer code: > > void > haiku_softpipe_flush_frontbuffer(struct pipe_screen *screen, > struct pipe_surface *surface, Bitmap* bitmap) > { > struct softpipe_texture *texture; > struct haiku_softpipe_buffer *buffer; > void *data; > > texture = softpipe_texture(surface->texture); > buffer = haiku_softpipe_buffer(texture->buffer); > int32 bitsLength = get_bitmap_bits_length(bitmap); > int32 width, height; > get_bitmap_size(bitmap, &width, &height); > > fprintf(stderr, "surface offset : %d\n", surface->offset); > fprintf(stderr, "surface width : %d\n", surface->width); > fprintf(stderr, "surface height : %d\n", surface->height); > fprintf(stderr, "surface bytes per line : %d\n", > texture->stride[surface->level]); > fprintf(stderr, "bitmap width : %d\n", width); > fprintf(stderr, "bitmap height : %d\n", height); > fprintf(stderr, "bitmap bits length : %d\n", bitsLength); > fprintf(stderr, "bitmap bytes per line : %d\n", bitsLength / height); > > if (width < 1 || height < 1) > return; > > data = screen->buffer_map(screen, texture->buffer, 0); > > copy_bitmap_bits(bitmap, data + surface->offset, bitsLength); > > screen->buffer_unmap(screen, texture->buffer); > > // dump_bitmap(bitmap); > } > > glScissor and glViewport are set correctly, and reports (0, 0, 640, 480). > > Other application, GLTeapot, works ok when displayed, but resizing a > window makes similar bug like this one. > > Any ideas what could be wrong ?
My first guess is the softpipe's tile cache is not getting flushed. Try adding a glFlush() call after your drawing code. If that fixes it, a flush is missing somewhere else. -Brian ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev