diff options
author | Marek Olšák <[email protected]> | 2011-03-01 21:15:38 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-03-02 03:46:27 +0100 |
commit | c37e283423a33ce870e865e9adeca7f4eddf4b5b (patch) | |
tree | 93e6c8bf264a4c2c807037b51503eac1f1ce23b2 /src/mesa | |
parent | e118fdc9e256a2ebc18c29672d99103e135eab44 (diff) |
st/mesa: use RGTC for GL_COMPRESSED_RED/RG if possible
With proper fallback formats.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index c58ec9267dc..22a1450cfe7 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -674,8 +674,6 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, } return PIPE_FORMAT_NONE; - case GL_COMPRESSED_RED: - case GL_COMPRESSED_RG: case GL_COMPRESSED_RGB: /* can only sample from compressed formats */ if (bindings & ~PIPE_BIND_SAMPLER_VIEW) @@ -871,10 +869,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return PIPE_FORMAT_R16G16_UNORM; return PIPE_FORMAT_NONE; + case GL_COMPRESSED_RED: case GL_COMPRESSED_RED_RGTC1: if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_UNORM, target, sample_count, bindings, geom_flags)) return PIPE_FORMAT_RGTC1_UNORM; + if (screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R8_UNORM; return PIPE_FORMAT_NONE; case GL_COMPRESSED_SIGNED_RED_RGTC1: @@ -883,10 +885,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return PIPE_FORMAT_RGTC1_SNORM; return PIPE_FORMAT_NONE; + case GL_COMPRESSED_RG: case GL_COMPRESSED_RG_RGTC2: if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_UNORM, target, sample_count, bindings, geom_flags)) return PIPE_FORMAT_RGTC2_UNORM; + if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, target, + sample_count, bindings, geom_flags)) + return PIPE_FORMAT_R8G8_UNORM; return PIPE_FORMAT_NONE; case GL_COMPRESSED_SIGNED_RG_RGTC2: |