summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/failover/fo_context.c2
-rw-r--r--src/mesa/pipe/i915simple/i915_context.c24
-rw-r--r--src/mesa/pipe/p_context.h4
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c12
-rw-r--r--src/mesa/pipe/softpipe/sp_winsys.h4
5 files changed, 24 insertions, 22 deletions
diff --git a/src/mesa/pipe/failover/fo_context.c b/src/mesa/pipe/failover/fo_context.c
index 7e02b751bb..aa5d0885e6 100644
--- a/src/mesa/pipe/failover/fo_context.c
+++ b/src/mesa/pipe/failover/fo_context.c
@@ -116,7 +116,7 @@ struct pipe_context *failover_create( struct pipe_context *hw,
failover->pipe.winsys = hw->winsys;
failover->pipe.destroy = failover_destroy;
- failover->pipe.supported_formats = hw->supported_formats;
+ failover->pipe.is_format_supported = hw->is_format_supported;
failover->pipe.max_texture_size = hw->max_texture_size;
failover->pipe.get_name = hw->get_name;
failover->pipe.get_vendor = hw->get_vendor;
diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/mesa/pipe/i915simple/i915_context.c
index 161f8ce697..6541f0e848 100644
--- a/src/mesa/pipe/i915simple/i915_context.c
+++ b/src/mesa/pipe/i915simple/i915_context.c
@@ -40,16 +40,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 *
-i915_supported_formats(struct pipe_context *pipe,
-// unsigned type,
- unsigned *numFormats)
+static boolean
+i915_is_format_supported( struct pipe_context *pipe,
+ uint format )
{
#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,
@@ -97,13 +97,13 @@ i915_supported_formats(struct pipe_context *pipe,
return NULL;
}
#else
- static const unsigned render_supported[] = {
- PIPE_FORMAT_U_A8_R8_G8_B8,
- PIPE_FORMAT_U_R5_G6_B5,
- PIPE_FORMAT_S8_Z24,
+ switch( format ) {
+ case PIPE_FORMAT_U_A8_R8_G8_B8:
+ case PIPE_FORMAT_U_R5_G6_B5:
+ case PIPE_FORMAT_S8_Z24:
+ return TRUE;
};
- *numFormats = 3;
- return render_supported;
+ return FALSE;
#endif
}
@@ -303,7 +303,7 @@ struct pipe_context *i915_create( struct pipe_winsys *pipe_winsys,
i915->pipe.winsys = pipe_winsys;
i915->pipe.destroy = i915_destroy;
- i915->pipe.supported_formats = i915_supported_formats;
+ i915->pipe.is_format_supported = i915_is_format_supported;
i915->pipe.max_texture_size = i915_max_texture_size;
i915->pipe.get_param = i915_get_param;
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index dbbf48c576..a1441a7e43 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -44,8 +44,8 @@ struct pipe_context {
/*
* Queries
*/
- const unsigned *(*supported_formats)(struct pipe_context *pipe,
- unsigned *numFormats);
+ boolean (*is_format_supported)( struct pipe_context *pipe,
+ uint format );
void (*max_texture_size)(struct pipe_context *pipe,
unsigned textureType, /* PIPE_TEXTURE_x */
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 3a1861cb62..f67588783b 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;
diff --git a/src/mesa/pipe/softpipe/sp_winsys.h b/src/mesa/pipe/softpipe/sp_winsys.h
index 726e4c8bb6..d8ae971188 100644
--- a/src/mesa/pipe/softpipe/sp_winsys.h
+++ b/src/mesa/pipe/softpipe/sp_winsys.h
@@ -35,8 +35,8 @@
*/
struct softpipe_winsys {
- const unsigned *(*supported_formats)(struct softpipe_winsys *sws,
- unsigned *numFormats);
+ boolean (*is_format_supported)( struct softpipe_winsys *sws,
+ uint format );
};