[Mesa-dev] [PATCH 4/4] st/mesa: add LATC and 3DC support

Brian Paul brianp at vmware.com
Mon Mar 7 14:10:27 PST 2011


Looks good.  Though, if we someday get a compressed format that 
encodes normalized values as ushorts or uints this would fail.

-Brian

On 03/07/2011 12:40 PM, Marek Olšák wrote:
> A follow-up patch is attached.
>
> Marek
>
> On Mon, Mar 7, 2011 at 4:45 PM, Brian Paul <brianp at vmware.com
> <mailto:brianp at vmware.com>> wrote:
>
>     On 03/06/2011 08:28 PM, Marek Olšák wrote:
>
>         softpipe passes all tests.
>         ---
>           src/mesa/state_tracker/st_extensions.c |   21 ++++++++++++
>           src/mesa/state_tracker/st_format.c     |   54
>         ++++++++++++++++++++++++++++++-
>           src/mesa/state_tracker/st_gen_mipmap.c |    4 ++-
>           3 files changed, 76 insertions(+), 3 deletions(-)
>
>     [...]
>
>         diff --git a/src/mesa/state_tracker/st_gen_mipmap.c
>         b/src/mesa/state_tracker/st_gen_mipmap.c
>         index a12a32e..f8b23d1 100644
>         --- a/src/mesa/state_tracker/st_gen_mipmap.c
>         +++ b/src/mesa/state_tracker/st_gen_mipmap.c
>         @@ -205,7 +205,9 @@ fallback_generate_mipmap(struct gl_context
>         *ctx, GLenum target,
>
>              if (compressed) {
>                 if (texObj->Image[face][baseLevel]->TexFormat ==
>         MESA_FORMAT_SIGNED_RED_RGTC1 ||
>         -         texObj->Image[face][baseLevel]->TexFormat ==
>         MESA_FORMAT_SIGNED_RG_RGTC2)
>         +          texObj->Image[face][baseLevel]->TexFormat ==
>         MESA_FORMAT_SIGNED_RG_RGTC2 ||
>         +          texObj->Image[face][baseLevel]->TexFormat ==
>         MESA_FORMAT_SIGNED_L_LATC1 ||
>         +          texObj->Image[face][baseLevel]->TexFormat ==
>         MESA_FORMAT_SIGNED_LA_LATC2)
>                    datatype = GL_FLOAT;
>                 else
>                    datatype = GL_UNSIGNED_BYTE;
>
>
>     When I see a bunch of comparisons like this I suspect that a helper
>     function such as get_datatype_for_compressed_format(gl_format) would
>     be cleaner.
>
>     -Brian
>
>



More information about the mesa-dev mailing list