Merge branch '7.8'
authorBrian Paul <brianp@vmware.com>
Mon, 22 Mar 2010 15:07:46 +0000 (09:07 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 22 Mar 2010 15:07:46 +0000 (09:07 -0600)
Conflicts:

src/gallium/drivers/cell/ppu/cell_screen.c
src/mesa/state_tracker/st_cb_drawpixels.c

1  2 
src/gallium/drivers/cell/ppu/cell_screen.c
src/mesa/state_tracker/st_cb_drawpixels.c

index f5528a7ec6b910838fdf5679579ac142db1eb7b8,7957e0149d7a5f7ca7e199f04111a67e7acf8988..42045744060a09f420f6b0e09c7f3286c87e2f8d
@@@ -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;
+    }
  }
  
  
index 07529ab6af79d9ab46afbcdc50d4d134bb3defea,b937288f8c0dd60d24aa11c19d939ae4f21866ef..c9d1e9c6c4b2b15796405e12a5342c2556b11ca1
@@@ -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);
  
                                         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 */
        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);
        }