summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_context.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2007-10-28 17:19:39 +0000
committerMichal Krol <[email protected]>2007-10-28 17:34:39 +0000
commit3c8121967224f91bfcd5431b4069d66eecbc5952 (patch)
tree0f02118d163e144074dc4e5cafd21fdfbcb2f7ee /src/mesa/pipe/softpipe/sp_context.c
parentb85cd7b70096cf7c922aed56ae8255fb4b8f0709 (diff)
Replace supported_formats with is_format_supported interface.
The old supported_formats interface returned a list of formats supported by a pipe/winsys implementation. This was reasonable when gallium had a fixed list of predefined format. Now things has changed and the definition of PIPE_FORMAT is more flexible. The new shiny is_format_supported interface gets PIPE_FORMAT as an argument and returns a boolean whether this particular format is supported.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_context.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 3a1861cb62f..f67588783be 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -46,14 +46,16 @@
/**
- * Return list of supported surface/texture formats.
+ * Query format support.
* If we find texture and drawable support differs, add a selector
* parameter or another function.
*/
-static const unsigned *
-softpipe_supported_formats(struct pipe_context *pipe, unsigned *numFormats)
+static boolean
+softpipe_is_format_supported( struct pipe_context *pipe,
+ uint format )
{
#if 0
+ /* XXX: This is broken -- rewrite if still needed. */
static const unsigned supported[] = {
PIPE_FORMAT_U_R8_G8_B8_A8,
PIPE_FORMAT_U_A8_R8_G8_B8,
@@ -76,7 +78,7 @@ softpipe_supported_formats(struct pipe_context *pipe, unsigned *numFormats)
return supported;
#else
struct softpipe_context *softpipe = softpipe_context( pipe );
- return softpipe->winsys->supported_formats( softpipe->winsys, numFormats );
+ return softpipe->winsys->is_format_supported( softpipe->winsys, format );
#endif
}
@@ -298,7 +300,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
softpipe->pipe.destroy = softpipe_destroy;
/* queries */
- softpipe->pipe.supported_formats = softpipe_supported_formats;
+ softpipe->pipe.is_format_supported = softpipe_is_format_supported;
softpipe->pipe.max_texture_size = softpipe_max_texture_size;
softpipe->pipe.get_param = softpipe_get_param;