diff options
author | Benjamin Franzke <[email protected]> | 2011-01-21 14:29:06 +0100 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2011-01-24 16:41:29 -0500 |
commit | c5c1dc8b3fb9495cc4dc54fd80a801c9e826b227 (patch) | |
tree | 56fda78be31f7486698cc884ebf7cafab86ca948 /src/mesa | |
parent | 8bfbcba2b7f01691a64c74639b3f3ca0284eb214 (diff) |
st/mesa: support internalFormat=GL_BGRA in TexImage2D
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 2e0a664dd01..a532e089c0a 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -511,6 +511,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, sample_count, bindings, geom_flags ); + case GL_BGRA: + if (screen->is_format_supported( screen, PIPE_FORMAT_B8G8R8A8_UNORM, + target, sample_count, bindings, + geom_flags )) + return PIPE_FORMAT_B8G8R8A8_UNORM; + return default_rgba_format( screen, target, sample_count, bindings, + geom_flags ); + case 3: case GL_RGB: case GL_RGB8: @@ -1032,7 +1040,8 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLint internalFormat, boolean want_renderable = internalFormat == 3 || internalFormat == 4 || internalFormat == GL_RGB || internalFormat == GL_RGBA || - internalFormat == GL_RGB8 || internalFormat == GL_RGBA8; + internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 || + internalFormat == GL_BGRA; return st_ChooseTextureFormat_renderable(ctx, internalFormat, format, type, want_renderable); |