diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2008-04-04 20:30:29 +1000 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-04-04 20:30:29 +1000 |
commit | e902d9091c048531cf76b1d9d034fb865b1a0f6e (patch) | |
tree | 6594c42173c215b9b17ac904a7d05a1568d53d31 /src/mesa/state_tracker/st_format.c | |
parent | bc67533f29abe578e2306be2a24db392a0c62fc4 (diff) | |
parent | 7a7bce7b24ea4f63faa1d5bfe3f71d09b412c838 (diff) |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_format.c')
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index cb6fa9a573..761645c105 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -189,15 +189,14 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) pinfo->base_format = GL_RGBA; } } + else if (pf_layout(format) == PIPE_FORMAT_LAYOUT_YCBCR) { + pinfo->base_format = GL_YCBCR_MESA; + pinfo->datatype = GL_UNSIGNED_SHORT; + pinfo->size = 2; /* two bytes per "texel" */ + } else { - pipe_format_ycbcr_t info; - - assert( pf_layout(format) == PIPE_FORMAT_LAYOUT_YCBCR ); - - info = format; - - /* TODO */ - assert( 0 ); + /* compressed format? */ + assert(0); } #if 0 @@ -275,6 +274,8 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat) return PIPE_FORMAT_Z32_UNORM; case MESA_FORMAT_Z24_S8: return PIPE_FORMAT_Z24S8_UNORM; + case MESA_FORMAT_YCBCR: + return PIPE_FORMAT_YCBCR; default: assert(0); return 0; @@ -435,6 +436,14 @@ choose_format(struct pipe_context *pipe, GLint internalFormat, uint surfType) return default_rgba_format( screen, surfType ); case GL_YCBCR_MESA: + if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR, + PIPE_TEXTURE)) { + return PIPE_FORMAT_YCBCR; + } + if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR_REV, + PIPE_TEXTURE)) { + return PIPE_FORMAT_YCBCR_REV; + } return PIPE_FORMAT_NONE; case GL_RGB_S3TC: |