diff options
author | Xavier Chantry <[email protected]> | 2010-05-05 14:39:59 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-05-05 14:39:59 +0200 |
commit | 6ddd6403652231bacfe66f84d0ec7be38953b785 (patch) | |
tree | 53aa220bd9ec18c19affb4cf94508783ac50176f /src/gallium/drivers/nv50 | |
parent | 8ddf93e84ce280c742be905ce779db59df90d154 (diff) |
nouveau: only advertise PIPE_FORMAT_DXT* if s3tc available
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_screen.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 2dd10424245..bf46cebb590 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -20,6 +20,7 @@ * SOFTWARE. */ +#include "util/u_format_s3tc.h" #include "pipe/p_screen.h" #include "nv50_context.h" @@ -60,6 +61,17 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, break; } } else { + if (tex_usage & PIPE_BIND_SAMPLER_VIEW) { + switch (format) { + case PIPE_FORMAT_DXT1_RGB: + case PIPE_FORMAT_DXT1_RGBA: + case PIPE_FORMAT_DXT3_RGBA: + case PIPE_FORMAT_DXT5_RGBA: + return util_format_s3tc_enabled; + default: + break; + } + } switch (format) { case PIPE_FORMAT_B8G8R8A8_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: @@ -72,10 +84,6 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_I8_UNORM: case PIPE_FORMAT_L8A8_UNORM: - case PIPE_FORMAT_DXT1_RGB: - case PIPE_FORMAT_DXT1_RGBA: - case PIPE_FORMAT_DXT3_RGBA: - case PIPE_FORMAT_DXT5_RGBA: case PIPE_FORMAT_S8_USCALED_Z24_UNORM: case PIPE_FORMAT_Z24_UNORM_S8_USCALED: case PIPE_FORMAT_Z32_FLOAT: |