From: Brian Paul Date: Mon, 22 Mar 2010 15:07:46 +0000 (-0600) Subject: Merge branch '7.8' X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=commitdiff_plain;h=182c42c8da6edfa66819eef02f4dea310c1f68d7 Merge branch '7.8' Conflicts: src/gallium/drivers/cell/ppu/cell_screen.c src/mesa/state_tracker/st_cb_drawpixels.c --- 182c42c8da6edfa66819eef02f4dea310c1f68d7 diff --cc src/gallium/drivers/cell/ppu/cell_screen.c index f5528a7ec6b,7957e0149d7..42045744060 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@@ -136,22 -136,16 +138,23 @@@ cell_is_format_supported( struct pipe_s unsigned tex_usage, unsigned geom_flags ) { - struct sw_winsys *winsys = cell_screen(screen)->winsys; - - if (format == PIPE_FORMAT_DXT5_RGBA || - format == PIPE_FORMAT_A8B8G8R8_SRGB) - return FALSE; - + if (tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { + if (!winsys->is_displaytarget_format_supported(winsys, tex_usage, format)) + return FALSE; + } + - /* This is often a lie. Pull in logic from llvmpipe to fix. - */ - return TRUE; + /* only a few formats are known to work at this time */ + switch (format) { + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_I8_UNORM: + return TRUE; + default: + return FALSE; + } } diff --cc src/mesa/state_tracker/st_cb_drawpixels.c index 07529ab6af7,b937288f8c0..c9d1e9c6c4b --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@@ -963,12 -934,12 +963,12 @@@ st_CopyPixels(GLcontext *ctx, GLint src struct st_renderbuffer *rbRead; void *driver_vp, *driver_fp; struct pipe_texture *pt; + struct pipe_sampler_view *sv; GLfloat *color; enum pipe_format srcFormat, texFormat; - int ptw, pth; GLboolean invertTex = GL_FALSE; GLint readX, readY, readW, readH; - struct gl_pixelstore_attrib unpack = ctx->DefaultPacking; + struct gl_pixelstore_attrib pack = ctx->DefaultPacking; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL); @@@ -1056,11 -1043,19 +1056,12 @@@ PIPE_BUFFER_USAGE_GPU_READ); struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE ); - if (pipe->surface_copy) { - pipe->surface_copy(pipe, - psTex, /* dest surf */ - pack.SkipPixels, pack.SkipRows, /* dest pos */ - psRead, /* src surf */ - readX, readY, readW, readH); /* src region */ - } else { - util_surface_copy(pipe, FALSE, - psTex, - pack.SkipPixels, pack.SkipRows, - psRead, - readX, readY, readW, readH); - } ++ + pipe->surface_copy(pipe, + psTex, /* dest surf */ - unpack.SkipPixels, unpack.SkipRows, /* dest pos */ ++ pack.SkipPixels, pack.SkipRows, /* dest pos */ + psRead, /* src surf */ + readX, readY, readW, readH); /* src region */ if (0) { /* debug */ @@@ -1095,17 -1090,17 +1096,17 @@@ if (type == GL_COLOR) { /* alternate path using get/put_tile() */ GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe_get_tile_rgba(ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_rgba(ptTex, pack.SkipPixels, pack.SkipRows, + pipe_get_tile_rgba(pipe, ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_rgba(pipe, ptTex, unpack.SkipPixels, unpack.SkipRows, ++ pipe_put_tile_rgba(pipe, ptTex, pack.SkipPixels, pack.SkipRows, readW, readH, buf); free(buf); } else { /* GL_DEPTH */ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); - pipe_get_tile_z(ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_z(ptTex, pack.SkipPixels, pack.SkipRows, - readW, readH, buf); + pipe_get_tile_z(pipe, ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_z(pipe, ptTex, unpack.SkipPixels, unpack.SkipRows, ++ pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows, + readW, readH, buf); free(buf); }