diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2009-06-26 20:37:06 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2009-06-26 21:25:41 -0700 |
commit | aac6648cd8b27cb6653ac4a9722a49868b221447 (patch) | |
tree | 86b3235b21d8259b7ed04bbd286f618c43856645 /src/gallium/drivers/r300/r300_texture.h | |
parent | 7a3224c334a9a159f16e37672e4d8d833bc9bb52 (diff) | |
download | external_mesa3d-aac6648cd8b27cb6653ac4a9722a49868b221447.zip external_mesa3d-aac6648cd8b27cb6653ac4a9722a49868b221447.tar.gz external_mesa3d-aac6648cd8b27cb6653ac4a9722a49868b221447.tar.bz2 |
r300g: Use real texture formats.
What bugs me is that the YUV444 format somehow worked properly. :3
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.h')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 98fb5c9..e2429c0 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -32,6 +32,27 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen); +/* Note the signature of R300_EASY_TX_FORMAT(A, R, G, B, FORMAT)... */ +static INLINE uint32_t r300_translate_texformat(enum pipe_format format) +{ + switch (format) { + /* X8 */ + case PIPE_FORMAT_I8_UNORM: + return R300_EASY_TX_FORMAT(X, X, X, X, X8); + /* W8Z8Y8X8 */ + case PIPE_FORMAT_A8R8G8B8_UNORM: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); + case PIPE_FORMAT_R8G8B8A8_UNORM: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8); + default: + debug_printf("r300: Implementation error: " + "Got unsupported texture format %s in %s\n", + pf_name(format), __FUNCTION__); + break; + } + return 0; +} + #ifndef R300_WINSYS_H boolean r300_get_texture_buffer(struct pipe_texture* texture, |