gallium: move is_format_supported() to pipe_screen struct
authorBrian <brian@i915.localnet.net>
Wed, 27 Feb 2008 20:58:06 +0000 (13:58 -0700)
committerBrian <brian@i915.localnet.net>
Wed, 27 Feb 2008 20:58:06 +0000 (13:58 -0700)
13 files changed:
src/gallium/drivers/cell/ppu/cell_context.c
src/gallium/drivers/cell/ppu/cell_screen.c
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/i915simple/i915_context.c
src/gallium/drivers/i915simple/i915_screen.c
src/gallium/drivers/i965simple/brw_context.c
src/gallium/drivers/i965simple/brw_screen.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_context.h
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_gen_mipmap.c

index 351601473d2c1bea4c9b291a6d821c0bd41b2876..2301df5ba5253f90d2b015e388c023a5adc4de6c 100644 (file)
 
 
 
-static boolean
-cell_is_format_supported( struct pipe_context *pipe,
-                          enum pipe_format format, uint type )
-{
-   /*struct cell_context *cell = cell_context( pipe );*/
-
-   switch (type) {
-   case PIPE_TEXTURE:
-      /* cell supports all texture formats, XXX for now anyway */
-      return TRUE;
-   case PIPE_SURFACE:
-      /* cell supports all (off-screen) surface formats, XXX for now */
-      return TRUE;
-   default:
-      assert(0);
-      return FALSE;
-   }
-}
-
-
 static void
 cell_destroy_context( struct pipe_context *pipe )
 {
@@ -122,9 +102,6 @@ cell_create_context(struct pipe_screen *screen,
    cell->pipe.screen = screen;
    cell->pipe.destroy = cell_destroy_context;
 
-   /* queries */
-   cell->pipe.is_format_supported = cell_is_format_supported;
-
    /* state setters */
    cell->pipe.set_vertex_buffer = cell_set_vertex_buffer;
    cell->pipe.set_vertex_element = cell_set_vertex_element;
index 75255c0466a2e99455509854f7bb011d2e5df06d..124670df255d03177cb033193d4b44e623aca226 100644 (file)
@@ -112,6 +112,24 @@ cell_get_paramf(struct pipe_screen *screen, int param)
 }
 
 
+static boolean
+cell_is_format_supported( struct pipe_screen *screen,
+                          enum pipe_format format, uint type )
+{
+   switch (type) {
+   case PIPE_TEXTURE:
+      /* cell supports all texture formats, XXX for now anyway */
+      return TRUE;
+   case PIPE_SURFACE:
+      /* cell supports all (off-screen) surface formats, XXX for now */
+      return TRUE;
+   default:
+      assert(0);
+      return FALSE;
+   }
+}
+
+
 static void
 cell_destroy_screen( struct pipe_screen *screen )
 {
@@ -140,6 +158,7 @@ cell_create_screen(struct pipe_winsys *winsys)
    screen->get_vendor = cell_get_vendor;
    screen->get_param = cell_get_param;
    screen->get_paramf = cell_get_paramf;
+   screen->is_format_supported = cell_is_format_supported;
 
    cell_init_screen_texture_funcs(screen);
 
index d5e54f5d61a36ca91329af7149e82426d63f8d6e..f559cc0d479cf08f389a7f5c9294688d6ed1a5da 100644 (file)
@@ -119,8 +119,8 @@ struct pipe_context *failover_create( struct pipe_context *hw,
    failover->pipe.winsys = hw->winsys;
    failover->pipe.screen = hw->screen;
    failover->pipe.destroy = failover_destroy;
-   failover->pipe.is_format_supported = hw->is_format_supported;
 #if 0
+   failover->pipe.is_format_supported = hw->is_format_supported;
    failover->pipe.get_name = hw->get_name;
    failover->pipe.get_vendor = hw->get_vendor;
    failover->pipe.get_param = hw->get_param;
index 42355552de13212c9ba0ee28acaf3239764b4a16..15ff2360b74ce24969299d208e998f0a704e81d3 100644 (file)
 #include "pipe/p_screen.h"
 
 
-/**
- * Query format support for creating a texture, drawing surface, etc.
- * \param format  the format to test
- * \param type  one of PIPE_TEXTURE, PIPE_SURFACE
- */
-static boolean
-i915_is_format_supported( struct pipe_context *pipe,
-                          enum pipe_format format, uint type )
-{
-   static const enum pipe_format tex_supported[] = {
-      PIPE_FORMAT_R8G8B8A8_UNORM,
-      PIPE_FORMAT_A8R8G8B8_UNORM,
-      PIPE_FORMAT_R5G6B5_UNORM,
-      PIPE_FORMAT_U_L8,
-      PIPE_FORMAT_U_A8,
-      PIPE_FORMAT_U_I8,
-      PIPE_FORMAT_U_A8_L8,
-      PIPE_FORMAT_YCBCR,
-      PIPE_FORMAT_YCBCR_REV,
-      PIPE_FORMAT_S8Z24_UNORM,
-      PIPE_FORMAT_NONE  /* list terminator */
-   };
-   static const enum pipe_format surface_supported[] = {
-      PIPE_FORMAT_A8R8G8B8_UNORM,
-      PIPE_FORMAT_R5G6B5_UNORM,
-      PIPE_FORMAT_S8Z24_UNORM,
-      /*PIPE_FORMAT_R16G16B16A16_SNORM,*/
-      PIPE_FORMAT_NONE  /* list terminator */
-   };
-   const enum pipe_format *list;
-   uint i;
-
-   switch (type) {
-   case PIPE_TEXTURE:
-      list = tex_supported;
-      break;
-   case PIPE_SURFACE:
-      list = surface_supported;
-      break;
-   default:
-      assert(0);
-   }
-
-   for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) {
-      if (list[i] == format)
-         return TRUE;
-   }
-
-   return FALSE;
-}
-
-
 static void i915_destroy( struct pipe_context *pipe )
 {
    struct i915_context *i915 = i915_context( pipe );
@@ -101,8 +49,6 @@ static void i915_destroy( struct pipe_context *pipe )
 }
 
 
-
-
 static boolean
 i915_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
@@ -188,7 +134,6 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
    i915->pipe.screen = screen;
 
    i915->pipe.destroy = i915_destroy;
-   i915->pipe.is_format_supported = i915_is_format_supported;
 
    i915->pipe.clear = i915_clear;
 
index b9b4d6b6facc2b62e93486d21c9383c66374a172..8d7bf0b33e0d4f1957efab06ca8d9c4b2fd6f1e5 100644 (file)
@@ -145,6 +145,53 @@ i915_get_paramf(struct pipe_screen *screen, int param)
 }
 
 
+static boolean
+i915_is_format_supported( struct pipe_screen *screen,
+                          enum pipe_format format, uint type )
+{
+   static const enum pipe_format tex_supported[] = {
+      PIPE_FORMAT_R8G8B8A8_UNORM,
+      PIPE_FORMAT_A8R8G8B8_UNORM,
+      PIPE_FORMAT_R5G6B5_UNORM,
+      PIPE_FORMAT_U_L8,
+      PIPE_FORMAT_U_A8,
+      PIPE_FORMAT_U_I8,
+      PIPE_FORMAT_U_A8_L8,
+      PIPE_FORMAT_YCBCR,
+      PIPE_FORMAT_YCBCR_REV,
+      PIPE_FORMAT_S8Z24_UNORM,
+      PIPE_FORMAT_NONE  /* list terminator */
+   };
+   static const enum pipe_format surface_supported[] = {
+      PIPE_FORMAT_A8R8G8B8_UNORM,
+      PIPE_FORMAT_R5G6B5_UNORM,
+      PIPE_FORMAT_S8Z24_UNORM,
+      /*PIPE_FORMAT_R16G16B16A16_SNORM,*/
+      PIPE_FORMAT_NONE  /* list terminator */
+   };
+   const enum pipe_format *list;
+   uint i;
+
+   switch (type) {
+   case PIPE_TEXTURE:
+      list = tex_supported;
+      break;
+   case PIPE_SURFACE:
+      list = surface_supported;
+      break;
+   default:
+      assert(0);
+   }
+
+   for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) {
+      if (list[i] == format)
+         return TRUE;
+   }
+
+   return FALSE;
+}
+
+
 static void
 i915_destroy_screen( struct pipe_screen *screen )
 {
@@ -195,6 +242,7 @@ i915_create_screen(struct pipe_winsys *winsys, uint pci_id)
    i915screen->screen.get_vendor = i915_get_vendor;
    i915screen->screen.get_param = i915_get_param;
    i915screen->screen.get_paramf = i915_get_paramf;
+   i915screen->screen.is_format_supported = i915_is_format_supported;
 
    i915_init_screen_texture_functions(&i915screen->screen);
 
index e0a40372867a46933b97c5d65ab883476b755810..7c908da67262fabbbb9a1aabf69159721c714123 100644 (file)
@@ -71,74 +71,6 @@ static void brw_clear(struct pipe_context *pipe, struct pipe_surface *ps,
 }
 
 
-static boolean
-brw_is_format_supported( struct pipe_context *pipe,
-                          enum pipe_format format, uint type )
-{
-#if 0
-   /* XXX: This is broken -- rewrite if still needed. */
-   static const unsigned tex_supported[] = {
-      PIPE_FORMAT_U_R8_G8_B8_A8,
-      PIPE_FORMAT_U_A8_R8_G8_B8,
-      PIPE_FORMAT_U_R5_G6_B5,
-      PIPE_FORMAT_U_L8,
-      PIPE_FORMAT_U_A8,
-      PIPE_FORMAT_U_I8,
-      PIPE_FORMAT_U_L8_A8,
-      PIPE_FORMAT_YCBCR,
-      PIPE_FORMAT_YCBCR_REV,
-      PIPE_FORMAT_S8_Z24,
-   };
-
-
-   /* Actually a lot more than this - add later:
-    */
-   static const unsigned render_supported[] = {
-      PIPE_FORMAT_U_A8_R8_G8_B8,
-      PIPE_FORMAT_U_R5_G6_B5,
-   };
-
-   /*
-    */
-   static const unsigned z_stencil_supported[] = {
-      PIPE_FORMAT_U_Z16,
-      PIPE_FORMAT_U_Z32,
-      PIPE_FORMAT_S8_Z24,
-   };
-
-   switch (type) {
-   case PIPE_RENDER_FORMAT:
-      *numFormats = Elements(render_supported);
-      return render_supported;
-
-   case PIPE_TEX_FORMAT:
-      *numFormats = Elements(tex_supported);
-      return render_supported;
-
-   case PIPE_Z_STENCIL_FORMAT:
-      *numFormats = Elements(render_supported);
-      return render_supported;
-
-   default:
-      *numFormats = 0;
-      return NULL;
-   }
-#else
-   switch (format) {
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
-   case PIPE_FORMAT_R5G6B5_UNORM:
-   case PIPE_FORMAT_S8Z24_UNORM:
-      return TRUE;
-   default:
-      return FALSE;
-   };
-   return FALSE;
-#endif
-}
-
-
-
-
 struct pipe_context *brw_create(struct pipe_screen *screen,
                                 struct brw_winsys *brw_winsys,
                                 unsigned pci_id)
@@ -158,7 +90,6 @@ struct pipe_context *brw_create(struct pipe_screen *screen,
    brw->pipe.screen = screen;
 
    brw->pipe.destroy = brw_destroy;
-   brw->pipe.is_format_supported = brw_is_format_supported;
    brw->pipe.clear = brw_clear;
 
    brw_init_surface_functions(brw);
index 7afe070bd8fec3f9222f7e2892c1e8dc0a9712e6..5be369fe5215e030a7eb6c9bf9c79d66c8c8bff7 100644 (file)
@@ -133,6 +133,72 @@ brw_get_paramf(struct pipe_screen *screen, int param)
 }
 
 
+static boolean
+brw_is_format_supported( struct pipe_screen *screen,
+                         enum pipe_format format, uint type )
+{
+#if 0
+   /* XXX: This is broken -- rewrite if still needed. */
+   static const unsigned tex_supported[] = {
+      PIPE_FORMAT_U_R8_G8_B8_A8,
+      PIPE_FORMAT_U_A8_R8_G8_B8,
+      PIPE_FORMAT_U_R5_G6_B5,
+      PIPE_FORMAT_U_L8,
+      PIPE_FORMAT_U_A8,
+      PIPE_FORMAT_U_I8,
+      PIPE_FORMAT_U_L8_A8,
+      PIPE_FORMAT_YCBCR,
+      PIPE_FORMAT_YCBCR_REV,
+      PIPE_FORMAT_S8_Z24,
+   };
+
+
+   /* Actually a lot more than this - add later:
+    */
+   static const unsigned render_supported[] = {
+      PIPE_FORMAT_U_A8_R8_G8_B8,
+      PIPE_FORMAT_U_R5_G6_B5,
+   };
+
+   /*
+    */
+   static const unsigned z_stencil_supported[] = {
+      PIPE_FORMAT_U_Z16,
+      PIPE_FORMAT_U_Z32,
+      PIPE_FORMAT_S8_Z24,
+   };
+
+   switch (type) {
+   case PIPE_RENDER_FORMAT:
+      *numFormats = Elements(render_supported);
+      return render_supported;
+
+   case PIPE_TEX_FORMAT:
+      *numFormats = Elements(tex_supported);
+      return render_supported;
+
+   case PIPE_Z_STENCIL_FORMAT:
+      *numFormats = Elements(render_supported);
+      return render_supported;
+
+   default:
+      *numFormats = 0;
+      return NULL;
+   }
+#else
+   switch (format) {
+   case PIPE_FORMAT_A8R8G8B8_UNORM:
+   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
+      return TRUE;
+   default:
+      return FALSE;
+   };
+   return FALSE;
+#endif
+}
+
+
 static void
 brw_destroy_screen( struct pipe_screen *screen )
 {
@@ -161,6 +227,7 @@ brw_create_screen(struct pipe_winsys *winsys, uint pci_id)
    brwscreen->screen.get_vendor = brw_get_vendor;
    brwscreen->screen.get_param = brw_get_param;
    brwscreen->screen.get_paramf = brw_get_paramf;
+   brwscreen->screen.is_format_supported = brw_is_format_supported;
 
    brw_init_screen_texture_funcs(&brwscreen->screen);
 
index 6a88c277aa63b460450c6c3c7e9917a1673ee42e..fa16ed94e8d74d34dbe9e880f037089a8369d3a6 100644 (file)
 
 
 
-/**
- * Query format support for creating a texture, drawing surface, etc.
- * \param format  the format to test
- * \param type  one of PIPE_TEXTURE, PIPE_SURFACE
- */
-static boolean
-softpipe_is_format_supported( struct pipe_context *pipe,
-                              enum pipe_format format, uint type )
-{
-   switch (type) {
-   case PIPE_TEXTURE:
-      /* softpipe supports all texture formats */
-      return TRUE;
-   case PIPE_SURFACE:
-      /* softpipe supports all (off-screen) surface formats */
-      return TRUE;
-   default:
-      assert(0);
-      return FALSE;
-   }
-}
-
-
 /**
  * Map any drawing surfaces which aren't already mapped
  */
@@ -163,9 +140,6 @@ softpipe_create( struct pipe_screen *screen,
    softpipe->pipe.screen = screen;
    softpipe->pipe.destroy = softpipe_destroy;
 
-   /* queries */
-   softpipe->pipe.is_format_supported = softpipe_is_format_supported;
-
    /* state setters */
    softpipe->pipe.create_blend_state = softpipe_create_blend_state;
    softpipe->pipe.bind_blend_state   = softpipe_bind_blend_state;
index cc3b9625805f5b981589a708319766f282ffbfbf..1850a1ced3379163153880d6da3825ad0650d972 100644 (file)
@@ -107,6 +107,29 @@ softpipe_get_paramf(struct pipe_screen *screen, int param)
 }
 
 
+/**
+ * Query format support for creating a texture, drawing surface, etc.
+ * \param format  the format to test
+ * \param type  one of PIPE_TEXTURE, PIPE_SURFACE
+ */
+static boolean
+softpipe_is_format_supported( struct pipe_screen *screen,
+                              enum pipe_format format, uint type )
+{
+   switch (type) {
+   case PIPE_TEXTURE:
+      /* softpipe supports all texture formats */
+      return TRUE;
+   case PIPE_SURFACE:
+      /* softpipe supports all (off-screen) surface formats */
+      return TRUE;
+   default:
+      assert(0);
+      return FALSE;
+   }
+}
+
+
 static void
 softpipe_destroy_screen( struct pipe_screen *screen )
 {
@@ -134,6 +157,7 @@ softpipe_create_screen(struct pipe_winsys *winsys)
    screen->get_vendor = softpipe_get_vendor;
    screen->get_param = softpipe_get_param;
    screen->get_paramf = softpipe_get_paramf;
+   screen->is_format_supported = softpipe_is_format_supported;
 
    softpipe_init_screen_texture_funcs(screen);
 
index 38ee95bdaddba6d5df1f1ea2231ab6fc56270fc6..bb345df153ba4202059f257cf1d4f6e70c894a8d 100644 (file)
@@ -59,24 +59,6 @@ struct pipe_context {
 
    void (*destroy)( struct pipe_context * );
 
-   /*
-    * Queries
-    */
-   /** type is one of PIPE_SURFACE, PIPE_TEXTURE, etc. */
-   boolean (*is_format_supported)( struct pipe_context *pipe,
-                                   enum pipe_format format, uint type );
-
-#if 0
-   /* XXX obsolete, moved into pipe_screen */
-   const char *(*get_name)( struct pipe_context *pipe );
-
-   const char *(*get_vendor)( struct pipe_context *pipe );
-
-   int (*get_param)( struct pipe_context *pipe, int param );
-   float (*get_paramf)( struct pipe_context *pipe, int param );
-#endif
-
-
    /*
     * Drawing.  
     * Return false on fallbacks (temporary??)
@@ -210,6 +192,7 @@ struct pipe_context {
 
    /*
     * Texture functions
+    * XXX these are moving to pipe_screen...
     */
    struct pipe_texture * (*texture_create)(struct pipe_context *pipe,
                                            const struct pipe_texture *templat);
index 6245ce057f9d95c2c0132c0687e5bd03e7526b68..0f2c6307dd41e0135849de404037b91d4098e320 100644 (file)
@@ -993,6 +993,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
                     const GLubyte *bitmap)
 {
    struct pipe_context *pipe = ctx->st->pipe;
+   struct pipe_screen *screen = pipe->screen;
    struct pipe_surface *surface;
    uint format = 0, cpp, comp;
    ubyte *dest;
@@ -1000,12 +1001,12 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
    int row, col;
 
    /* find a texture format we know */
-   if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8, PIPE_TEXTURE )) {
+   if (screen->is_format_supported( screen, PIPE_FORMAT_U_I8, PIPE_TEXTURE )) {
       format = PIPE_FORMAT_U_I8;
       cpp = 1;
       comp = 0;
    }
-   else if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_TEXTURE )) {
+   else if (screen->is_format_supported( screen, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_TEXTURE )) {
       format = PIPE_FORMAT_A8R8G8B8_UNORM;
       cpp = 4;
       comp = 3; /* alpha channel */ /*XXX little-endian dependency */
index 2a23445ca2be431c1ac8273fb373827efcda4763..9aeda65a5c8cc36d0f59ad3fe5e60388dd3ae203 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
+#include "pipe/p_screen.h"
 #include "st_context.h"
 #include "st_format.h"
 
@@ -288,9 +289,10 @@ default_rgba_format(struct pipe_context *pipe, uint type)
       PIPE_FORMAT_R8G8B8A8_UNORM,
       PIPE_FORMAT_R5G6B5_UNORM
    };
+   struct pipe_screen *screen = pipe->screen;
    uint i;
    for (i = 0; i < Elements(colorFormats); i++) {
-      if (pipe->is_format_supported( pipe, colorFormats[i], type )) {
+      if (screen->is_format_supported( screen, colorFormats[i], type )) {
          return colorFormats[i];
       }
    }
@@ -304,7 +306,8 @@ default_rgba_format(struct pipe_context *pipe, uint type)
 static GLuint
 default_deep_rgba_format(struct pipe_context *pipe, uint type)
 {
-   if (pipe->is_format_supported(pipe, PIPE_FORMAT_R16G16B16A16_SNORM, type)) {
+   struct pipe_screen *screen = pipe->screen;
+   if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM, type)) {
       return PIPE_FORMAT_R16G16B16A16_SNORM;
    }
    return PIPE_FORMAT_NONE;
@@ -323,9 +326,10 @@ default_depth_format(struct pipe_context *pipe, uint type)
       PIPE_FORMAT_S8Z24_UNORM,
       PIPE_FORMAT_Z24S8_UNORM
    };
+   struct pipe_screen *screen = pipe->screen;
    uint i;
    for (i = 0; i < Elements(zFormats); i++) {
-      if (pipe->is_format_supported( pipe, zFormats[i], type )) {
+      if (screen->is_format_supported( screen, zFormats[i], type )) {
          return zFormats[i];
       }
    }
@@ -341,6 +345,7 @@ default_depth_format(struct pipe_context *pipe, uint type)
 enum pipe_format
 st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
 {
+   struct pipe_screen *screen = pipe->screen;
    uint surfType = PIPE_SURFACE;
 
    switch (internalFormat) {
@@ -359,12 +364,12 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
 
    case GL_RGBA4:
    case GL_RGBA2:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_A4R4G4B4_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_A4R4G4B4_UNORM, surfType ))
          return PIPE_FORMAT_A4R4G4B4_UNORM;
       return default_rgba_format( pipe, surfType );
 
    case GL_RGB5_A1:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
          return PIPE_FORMAT_A1R5G5B5_UNORM;
       return default_rgba_format( pipe, surfType );
 
@@ -377,9 +382,9 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_RGB5:
    case GL_RGB4:
    case GL_R3_G3_B2:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
          return PIPE_FORMAT_A1R5G5B5_UNORM;
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_R5G6B5_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_R5G6B5_UNORM, surfType ))
          return PIPE_FORMAT_R5G6B5_UNORM;
       return default_rgba_format( pipe, surfType );
 
@@ -389,7 +394,7 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_ALPHA12:
    case GL_ALPHA16:
    case GL_COMPRESSED_ALPHA:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_U_A8, surfType ))
          return PIPE_FORMAT_U_A8;
       return default_rgba_format( pipe, surfType );
 
@@ -400,7 +405,7 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_LUMINANCE12:
    case GL_LUMINANCE16:
    case GL_COMPRESSED_LUMINANCE:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_L8, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_U_L8, surfType ))
          return PIPE_FORMAT_U_A8;
       return default_rgba_format( pipe, surfType );
 
@@ -413,7 +418,7 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_LUMINANCE12_ALPHA12:
    case GL_LUMINANCE16_ALPHA16:
    case GL_COMPRESSED_LUMINANCE_ALPHA:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8_L8, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_U_A8_L8, surfType ))
          return PIPE_FORMAT_U_A8_L8;
       return default_rgba_format( pipe, surfType );
 
@@ -423,7 +428,7 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_INTENSITY12:
    case GL_INTENSITY16:
    case GL_COMPRESSED_INTENSITY:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_U_I8, surfType ))
          return PIPE_FORMAT_U_I8;
       return default_rgba_format( pipe, surfType );
 
@@ -454,17 +459,17 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
 #endif
 
    case GL_DEPTH_COMPONENT16:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z16_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_Z16_UNORM, surfType ))
          return PIPE_FORMAT_Z16_UNORM;
       /* fall-through */
    case GL_DEPTH_COMPONENT24:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, surfType ))
          return PIPE_FORMAT_S8Z24_UNORM;
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, surfType ))
          return PIPE_FORMAT_Z24S8_UNORM;
       /* fall-through */
    case GL_DEPTH_COMPONENT32:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z32_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_Z32_UNORM, surfType ))
          return PIPE_FORMAT_Z32_UNORM;
       /* fall-through */
    case GL_DEPTH_COMPONENT:
@@ -475,19 +480,19 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
    case GL_STENCIL_INDEX4_EXT:
    case GL_STENCIL_INDEX8_EXT:
    case GL_STENCIL_INDEX16_EXT:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_S8, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_U_S8, surfType ))
          return PIPE_FORMAT_U_S8;
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, surfType ))
          return PIPE_FORMAT_S8Z24_UNORM;
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, surfType ))
          return PIPE_FORMAT_Z24S8_UNORM;
       return PIPE_FORMAT_NONE;
 
    case GL_DEPTH_STENCIL_EXT:
    case GL_DEPTH24_STENCIL8_EXT:
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, surfType ))
          return PIPE_FORMAT_S8Z24_UNORM;
-      if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
+      if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, surfType ))
          return PIPE_FORMAT_Z24S8_UNORM;
       return PIPE_FORMAT_NONE;
 
index c9765b20036ac993abd99fbdabce05d643ed2940..2b163106028a6333f46ef69b9d28655a95c689a9 100644 (file)
@@ -227,6 +227,7 @@ st_render_mipmap(struct st_context *st,
                  uint baseLevel, uint lastLevel)
 {
    struct pipe_context *pipe = st->pipe;
+   struct pipe_screen *screen = pipe->screen;
    struct pipe_framebuffer_state fb;
    struct pipe_sampler_state sampler;
    void *sampler_cso;
@@ -237,7 +238,7 @@ st_render_mipmap(struct st_context *st,
    assert(target != GL_TEXTURE_3D); /* not done yet */
 
    /* check if we can render in the texture's format */
-   if (!pipe->is_format_supported(pipe, pt->format, PIPE_SURFACE)) {
+   if (!screen->is_format_supported(screen, pt->format, PIPE_SURFACE)) {
       return FALSE;
    }