diff options
author | Brian <[email protected]> | 2008-02-27 13:58:06 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-02-27 13:58:06 -0700 |
commit | 364f8cad0f8f02fd39d9c51ea0774d349121b58d (patch) | |
tree | 1e1d2e81a3093b1b59a7b9ecc9567d547015a019 /src/gallium/drivers/softpipe/sp_screen.c | |
parent | 8383f798b41df9a305e0a33afe8afa028d5d5dfb (diff) |
gallium: move is_format_supported() to pipe_screen struct
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_screen.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_screen.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index cc3b9625805..1850a1ced33 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -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); |