Mesa (master): mesa: fix indentation in attrib.c
Module: Mesa Branch: master Commit: 478f0d228be1c184adabd1df4dd76a01061b9e24 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=478f0d228be1c184adabd1df4dd76a01061b9e24 Author: Brian Paul bri...@vmware.com Date: Wed Nov 30 20:35:02 2011 -0700 mesa: fix indentation in attrib.c --- src/mesa/main/attrib.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 6f4a91b..1c1ee5d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1068,7 +1068,7 @@ _mesa_PopAttrib(void) p[0] = l-QuadraticAttenuation; _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p); } -} + } /* light model */ _mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT, light-Model.Ambient); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: fix unpack_ARGB1555_REV()
Module: Mesa Branch: master Commit: e10942c8e966f7ea45f6b0d3782bbe38593796ae URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e10942c8e966f7ea45f6b0d3782bbe38593796ae Author: Brian Paul bri...@vmware.com Date: Wed Nov 30 20:35:02 2011 -0700 mesa: fix unpack_ARGB1555_REV() We weren't doing the necessary byte swap. v2: use same arithmetic as unpack_ARGB1555() to be consistent. Reviewed-by: Michel Dänzer mic...@daenzer.net --- src/mesa/main/format_unpack.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index 0411f5f..b4e4ac4 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -275,10 +275,11 @@ unpack_ARGB1555_REV(const void *src, GLfloat dst[][4], GLuint n) const GLushort *s = ((const GLushort *) src); GLuint i; for (i = 0; i n; i++) { - dst[i][RCOMP] = UBYTE_TO_FLOAT( ((s[i] 7) 0xf8) | ((s[i] 12) 0x7) ); - dst[i][GCOMP] = UBYTE_TO_FLOAT( ((s[i] 2) 0xf8) | ((s[i] 7) 0x7) ); - dst[i][BCOMP] = UBYTE_TO_FLOAT( ((s[i] 3) 0xf8) | ((s[i] 2) 0x7) ); - dst[i][ACOMP] = UBYTE_TO_FLOAT( ((s[i] 15) 0x01) * 255 ); + GLushort tmp = (s[i] 8) | (s[i] 8); /* byteswap */ + dst[i][RCOMP] = ((tmp 10) 0x1f) * (1.0F / 31.0F); + dst[i][GCOMP] = ((tmp 5) 0x1f) * (1.0F / 31.0F); + dst[i][BCOMP] = ((tmp 0) 0x1f) * (1.0F / 31.0F); + dst[i][ACOMP] = ((tmp 15) 0x01) * 1.0F; } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r600g: add some new pci ids
Module: Mesa Branch: master Commit: 5df2d18f7015d00bc34454551fb60d55efe101a2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5df2d18f7015d00bc34454551fb60d55efe101a2 Author: Alex Deucher alexander.deuc...@amd.com Date: Wed Nov 30 19:34:15 2011 -0500 r600g: add some new pci ids Note: this is a candidate for the stable branches. Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- include/pci_ids/r600_pci_ids.h |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/include/pci_ids/r600_pci_ids.h b/include/pci_ids/r600_pci_ids.h index e9defc3..0ffb741 100644 --- a/include/pci_ids/r600_pci_ids.h +++ b/include/pci_ids/r600_pci_ids.h @@ -248,6 +248,14 @@ CHIPSET(0x6750, TURKS_6750, TURKS) CHIPSET(0x6758, TURKS_6758, TURKS) CHIPSET(0x6759, TURKS_6759, TURKS) CHIPSET(0x675F, TURKS_675F, TURKS) +CHIPSET(0x6840, TURKS_6840, TURKS) +CHIPSET(0x6841, TURKS_6841, TURKS) +CHIPSET(0x6842, TURKS_6842, TURKS) +CHIPSET(0x6843, TURKS_6843, TURKS) +CHIPSET(0x6849, TURKS_6849, TURKS) +CHIPSET(0x6850, TURKS_6850, TURKS) +CHIPSET(0x6858, TURKS_6858, TURKS) +CHIPSET(0x6859, TURKS_6859, TURKS) CHIPSET(0x6760, CAICOS_6760, CAICOS) CHIPSET(0x6761, CAICOS_6761, CAICOS) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): u_vbuf: Silence uninitialized variable warnings.
Module: Mesa Branch: master Commit: de93347d482a96f88c898622c9620f03e677e386 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=de93347d482a96f88c898622c9620f03e677e386 Author: Vinson Lee v...@vmware.com Date: Wed Nov 30 15:32:16 2011 -0800 u_vbuf: Silence uninitialized variable warnings. Fixes these GCC warnings. u_vbuf.c: In function ‘u_vbuf_draw_begin’: u_vbuf.c:839:20: warning: ‘max_index’ may be used uninitialized in this function [-Wuninitialized] u_vbuf.c:838:20: warning: ‘min_index’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Vinson Lee v...@vmware.com Reviewed-by: Brian Paul bri...@vmware.com --- src/gallium/auxiliary/util/u_vbuf.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index f6da912..5b0e26e 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -808,6 +808,8 @@ static void u_vbuf_get_minmax_index(struct pipe_context *pipe, } default: assert(0); + *out_min_index = 0; + *out_max_index = 0; } if (transfer) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): swrast: Fix signed/unsigned problems with negative strides.
Module: Mesa Branch: master Commit: a4c952f36f0c6b55f1410bc678b21f75de253a74 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4c952f36f0c6b55f1410bc678b21f75de253a74 Author: Mathias Fröhlich mathias.froehl...@web.de Date: Thu Dec 1 20:48:10 2011 +0100 swrast: Fix signed/unsigned problems with negative strides. In swrast_map_renderbuffer negative strides lead to render buffer map pointers that are off by 2^32. Make sure that intermediate negative values are not converted to an unsigned. Signed-off-by: Mathias Froehlich mathias.froehl...@web.de Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/drivers/dri/swrast/swrast.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index bc115e8..6297604 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -419,8 +419,8 @@ swrast_map_renderbuffer(struct gl_context *ctx, stride = -stride; } - map += y * stride; - map += x * cpp; + map += (GLsizei)y * stride; + map += (GLsizei)x * cpp; *out_map = map; *out_stride = stride; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: add GL_OES_compressed_ETC1_RGB8_texture for GLES
Module: Mesa Branch: master Commit: 35b506148e65f27f0393c7a145e802a08f1307b7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=35b506148e65f27f0393c7a145e802a08f1307b7 Author: Chia-I Wu o...@lunarg.com Date: Mon Nov 28 16:40:52 2011 +0800 glapi: add GL_OES_compressed_ETC1_RGB8_texture for GLES Reviewed-by: Brian Paul bri...@vmware.com --- src/mapi/glapi/gen/es_EXT.xml |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index bc98aee..c7e7d07 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -48,6 +48,10 @@ enum name=BYTE value=0x1400/ /category +category name=GL_OES_compressed_ETC1_RGB8_texture number=5 +enum name=ETC1_RGB8_OESvalue=0x8D64/ +/category + category name=GL_OES_compressed_paletted_texture number=6 enum name=PALETTE4_RGB8_OESvalue=0x8B90/ enum name=PALETTE4_RGBA8_OES value=0x8B91/ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_texture
Module: Mesa Branch: master Commit: 4eae2b37a85e05b3229877c0c2b2bdec37890005 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4eae2b37a85e05b3229877c0c2b2bdec37890005 Author: Chia-I Wu o...@lunarg.com Date: Mon Nov 28 16:41:10 2011 +0800 glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_texture Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/main/enums.c | 6073 + 1 files changed, 3038 insertions(+), 3035 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=4eae2b37a85e05b3229877c0c2b2bdec37890005 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: add ETC1 decoding routines
Module: Mesa Branch: master Commit: 51f4d2725417088c75d512b69a31a26ae5cb3ef2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=51f4d2725417088c75d512b69a31a26ae5cb3ef2 Author: Chia-I Wu o...@lunarg.com Date: Mon Nov 28 23:55:31 2011 +0800 mesa: add ETC1 decoding routines The format is defined by GL_OES_compressed_ETC1_RGB8_texture. These routines will be used in the following commit. Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/SConscript |1 + src/mesa/main/texcompress_etc.c | 71 ++ src/mesa/main/texcompress_etc.h | 40 ++ src/mesa/main/texcompress_etc_tmp.h | 136 +++ src/mesa/sources.mak|1 + 5 files changed, 249 insertions(+), 0 deletions(-) diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 8076086..bcb6a24 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -116,6 +116,7 @@ main_sources = [ 'main/texcompress_rgtc.c', 'main/texcompress_s3tc.c', 'main/texcompress_fxt1.c', +'main/texcompress_etc.c', 'main/texenv.c', 'main/texformat.c', 'main/texgen.c', diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c new file mode 100644 index 000..4d3b857 --- /dev/null +++ b/src/mesa/main/texcompress_etc.c @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2011 LunarG, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file texcompress_etc.c + * GL_OES_compressed_ETC1_RGB8_texture support. + */ + + +#include mfeatures.h +#include texcompress.h +#include texcompress_etc.h +#include texstore.h +#include macros.h +#include swrast/s_context.h + +GLboolean +_mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS) +{ + /* GL_ETC1_RGB8_OES is only valid in glCompressedTexImage2D */ + ASSERT(0); + + return GL_FALSE; +} + +/* define etc1_parse_block and etc. */ +#define UINT8_TYPE GLubyte +#define TAG(x) x +#include texcompress_etc_tmp.h +#undef TAG +#undef UINT8_TYPE + +void +_mesa_fetch_texel_2d_f_etc1_rgb8(const struct swrast_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) +{ + struct etc1_block block; + GLubyte dst[3]; + const GLubyte *src; + + src = (const GLubyte *) texImage-Data + + (((texImage-RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8; + + etc1_parse_block(block, src); + etc1_fetch_texel(block, i % 4, j % 4, dst); + + texel[RCOMP] = UBYTE_TO_FLOAT(dst[0]); + texel[GCOMP] = UBYTE_TO_FLOAT(dst[1]); + texel[BCOMP] = UBYTE_TO_FLOAT(dst[2]); + texel[ACOMP] = 1.0f; +} diff --git a/src/mesa/main/texcompress_etc.h b/src/mesa/main/texcompress_etc.h new file mode 100644 index 000..4e166b2 --- /dev/null +++ b/src/mesa/main/texcompress_etc.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 LunarG, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Mesa (master): mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Module: Mesa Branch: master Commit: d4a38e86d4b4d66cca20ee63222f940cb73fa709 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4a38e86d4b4d66cca20ee63222f940cb73fa709 Author: Chia-I Wu o...@lunarg.com Date: Mon Nov 28 16:57:02 2011 +0800 mesa: add support for GL_OES_compressed_ETC1_RGB8_texture Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa. There is no driver support yet. Unlike desktop GL compressed texture formats, GLES compressed texture formats usually can only be used with glCompressedTexImage2D. All other gl*Tex*Image* functions are updated to check for that. Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/main/APIspec.xml |2 + src/mesa/main/extensions.c|1 + src/mesa/main/format_unpack.c |8 ++ src/mesa/main/formats.c | 16 + src/mesa/main/formats.h |2 + src/mesa/main/glheader.h |4 +++ src/mesa/main/image.c |3 ++ src/mesa/main/mtypes.h|1 + src/mesa/main/texcompress.c | 22 + src/mesa/main/texformat.c | 10 src/mesa/main/teximage.c | 51 + src/mesa/main/texstore.c |2 + src/mesa/swrast/s_texfetch.c |8 ++ 13 files changed, 130 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 99c726c..eeae599 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -3806,6 +3806,7 @@ category name=OES_matrix_get/ category name=OES_read_format/ category name=OES_compressed_paletted_texture/ + category name=OES_compressed_ETC1_RGB8_texture/ category name=OES_point_size_array/ category name=OES_point_sprite/ category name=OES_query_matrix/ @@ -4105,6 +4106,7 @@ category name=GLES2.0/ category name=OES_compressed_paletted_texture/ + category name=OES_compressed_ETC1_RGB8_texture/ category name=OES_depth24/ category name=OES_depth32/ category name=OES_fbo_render_mipmap/ diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 8ebc051..b02a49d 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -219,6 +219,7 @@ static const struct extension extension_table[] = { { GL_OES_blend_func_separate, o(EXT_blend_func_separate), ES1, 2009 }, { GL_OES_blend_subtract, o(dummy_true), ES1, 2009 }, { GL_OES_byte_coordinates,o(dummy_true), ES1, 2002 }, + { GL_OES_compressed_ETC1_RGB8_texture, o(OES_compressed_ETC1_RGB8_texture), ES1 | ES2, 2005 }, { GL_OES_compressed_paletted_texture, o(dummy_true), ES1, 2003 }, { GL_OES_depth24, o(EXT_framebuffer_object), ES1 | ES2, 2005 }, { GL_OES_depth32, o(dummy_false), DISABLE,2005 }, diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index b4e4ac4..7da9546 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -1290,6 +1290,12 @@ unpack_SIGNED_LA_LATC2(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_ETC1_RGB8(const void *src, GLfloat dst[][4], GLuint n) +{ + /* XXX to do */ +} + +static void unpack_SIGNED_A8(const void *src, GLfloat dst[][4], GLuint n) { const GLbyte *s = ((const GLbyte *) src); @@ -1536,6 +1542,8 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_LA_LATC2] = unpack_LA_LATC2; table[MESA_FORMAT_SIGNED_LA_LATC2] = unpack_SIGNED_LA_LATC2; + table[MESA_FORMAT_ETC1_RGB8] = unpack_ETC1_RGB8; + table[MESA_FORMAT_SIGNED_A8] = unpack_SIGNED_A8; table[MESA_FORMAT_SIGNED_L8] = unpack_SIGNED_L8; table[MESA_FORMAT_SIGNED_AL88] = unpack_SIGNED_AL88; diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 873fedc..4b163d1 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1386,6 +1386,16 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 4, 4, 16 /* 16 bytes per 4x4 block */ }, + { + MESA_FORMAT_ETC1_RGB8, + MESA_FORMAT_ETC1_RGB8, + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + /* Signed formats from EXT_texture_snorm that are not in GL3.1 */ { MESA_FORMAT_SIGNED_A8, @@ -1790,6 +1800,8 @@ _mesa_get_uncompressed_format(gl_format format) return MESA_FORMAT_AL88; case MESA_FORMAT_SIGNED_LA_LATC2: return MESA_FORMAT_SIGNED_AL88; + case MESA_FORMAT_ETC1_RGB8: + return MESA_FORMAT_RGB888; default: #ifdef
Mesa (master): gallium: add PIPE_FORMAT_ETC1_RGB8
Module: Mesa Branch: master Commit: 5c31eb78e5fa4c4cfcc82df3c9a2c34fcd4b402c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c31eb78e5fa4c4cfcc82df3c9a2c34fcd4b402c Author: Chia-I Wu o...@lunarg.com Date: Tue Nov 29 00:10:37 2011 +0800 gallium: add PIPE_FORMAT_ETC1_RGB8 The format is defined by GL_OES_compressed_ETC1_RGB8_texture. Reviewed-by: Brian Paul bri...@vmware.com Reviewed-by: Jose Fonseca jfons...@vmware.com --- src/gallium/auxiliary/Makefile.sources |1 + src/gallium/auxiliary/util/u_format.csv |3 + src/gallium/auxiliary/util/u_format.h|7 ++- src/gallium/auxiliary/util/u_format_etc.c| 104 ++ src/gallium/auxiliary/util/u_format_etc.h| 46 +++ src/gallium/auxiliary/util/u_format_pack.py |2 +- src/gallium/auxiliary/util/u_format_table.py |1 + src/gallium/include/pipe/p_format.h |3 + 8 files changed, 165 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 5c65533..d40b954 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -103,6 +103,7 @@ C_SOURCES := \ util/u_format_latc.c \ util/u_format_s3tc.c \ util/u_format_rgtc.c \ + util/u_format_etc.c \ util/u_format_tests.c \ util/u_format_yuv.c \ util/u_format_zs.c \ diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 4b6fc75..345cc9d 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -158,6 +158,7 @@ PIPE_FORMAT_R8G8Bx_SNORM , other, 1, 1, sn8 , sn8 , , , x # - http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt # - http://www.opengl.org/registry/specs/ARB/texture_compression_rgtc.txt # - http://www.opengl.org/registry/specs/EXT/texture_compression_latc.txt +# - http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt # - http://msdn.microsoft.com/en-us/library/bb694531.aspx PIPE_FORMAT_DXT1_RGB , s3tc, 4, 4, x64 , , , , xyz1, rgb PIPE_FORMAT_DXT1_RGBA , s3tc, 4, 4, x64 , , , , xyzw, rgb @@ -178,6 +179,8 @@ PIPE_FORMAT_LATC1_SNORM , rgtc, 4, 4, x64, , , , xxx1, rg PIPE_FORMAT_LATC2_UNORM , rgtc, 4, 4, x128, , , , xxxy, rgb PIPE_FORMAT_LATC2_SNORM , rgtc, 4, 4, x128, , , , xxxy, rgb +PIPE_FORMAT_ETC1_RGB8 , etc, 4, 4, x64, , , , xyz1, rgb + # Straightforward D3D10-like formats (also used for # vertex buffer element description) # diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 99ee676..9694c90 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -70,9 +70,14 @@ enum util_format_layout { UTIL_FORMAT_LAYOUT_RGTC = 5, /** +* Ericsson Texture Compression +*/ + UTIL_FORMAT_LAYOUT_ETC = 6, + + /** * Everything else that doesn't fit in any of the above layouts. */ - UTIL_FORMAT_LAYOUT_OTHER = 6 + UTIL_FORMAT_LAYOUT_OTHER = 7 }; diff --git a/src/gallium/auxiliary/util/u_format_etc.c b/src/gallium/auxiliary/util/u_format_etc.c new file mode 100644 index 000..7500e1e --- /dev/null +++ b/src/gallium/auxiliary/util/u_format_etc.c @@ -0,0 +1,104 @@ +#include pipe/p_compiler.h +#include util/u_debug.h +#include util/u_math.h +#include u_format_etc.h + +/* define etc1_parse_block and etc. */ +#define UINT8_TYPE uint8_t +#define TAG(x) x +#include ../../../mesa/main/texcompress_etc_tmp.h +#undef TAG +#undef UINT8_TYPE + +void +util_format_etc1_rgb8_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height) +{ + const unsigned bw = 4, bh = 4, bs = 8, comps = 4; + struct etc1_block block; + unsigned x, y, i, j; + + for (y = 0; y height; y += bh) { + const uint8_t *src = src_row; + + for (x = 0; x width; x+= bw) { + etc1_parse_block(block, src); + + for (j = 0; j bh; j++) { +uint8_t *dst = dst_row + (y + j) * dst_stride + x * comps; +for (i = 0; i bw; i++) { + etc1_fetch_texel(block, i, j, dst); + dst[3] = 255; + dst += comps; +} + } + + src += bs; + } + + src_row += src_stride; + } +} + +void +util_format_etc1_rgb8_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height) +{ + assert(0); +} + +void +util_format_etc1_rgb8_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height) +{ + const unsigned bw = 4, bh = 4, bs = 8, comps = 4;
Mesa (master): st/mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Module: Mesa Branch: master Commit: cde6c91fd52ab52a2989ab402239d9d10cedf16f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cde6c91fd52ab52a2989ab402239d9d10cedf16f Author: Chia-I Wu o...@lunarg.com Date: Tue Nov 29 12:49:36 2011 +0800 st/mesa: add support for GL_OES_compressed_ETC1_RGB8_texture Have st/mesa recognize MESA_FORMAT_ETC1_RGB8 then we are good to advertise the extension. Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/state_tracker/st_extensions.c |8 src/mesa/state_tracker/st_format.c | 12 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index cef2088..37fb3e7 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -475,6 +475,14 @@ void st_init_extensions(struct st_context *st) ctx-Extensions.ATI_texture_compression_3dc = GL_TRUE; } + if (ctx-API != API_OPENGL) { + if (screen-is_format_supported(screen, PIPE_FORMAT_ETC1_RGB8, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW)) { + ctx-Extensions.OES_compressed_ETC1_RGB8_texture = GL_TRUE; + } + } + if (screen-is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW)) { diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index bc414f4..4b34acf 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -420,6 +420,9 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) case MESA_FORMAT_SIGNED_LA_LATC2: return PIPE_FORMAT_LATC2_SNORM; + case MESA_FORMAT_ETC1_RGB8: + return PIPE_FORMAT_ETC1_RGB8; + /* signed normalized formats */ case MESA_FORMAT_SIGNED_R8: return PIPE_FORMAT_R8_SNORM; @@ -745,6 +748,9 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_LATC2_SNORM: return MESA_FORMAT_SIGNED_LA_LATC2; + case PIPE_FORMAT_ETC1_RGB8: + return MESA_FORMAT_ETC1_RGB8; + /* signed normalized formats */ case PIPE_FORMAT_R8_SNORM: return MESA_FORMAT_SIGNED_R8; @@ -1189,6 +1195,12 @@ static const struct format_mapping format_map[] = { { PIPE_FORMAT_LATC2_SNORM, 0 } }, + /* ETC1 */ + { + { GL_ETC1_RGB8_OES, 0 }, + { PIPE_FORMAT_ETC1_RGB8, 0 } + }, + /* signed/unsigned integer formats. */ { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): docs: list GL_OES_compressed_ETC1_RGB8_texture in 7. 12 release notes
Module: Mesa Branch: master Commit: 912f7b6bfe809432bf719cdab5659a999083cd52 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=912f7b6bfe809432bf719cdab5659a999083cd52 Author: Chia-I Wu o...@lunarg.com Date: Wed Nov 30 12:29:54 2011 +0800 docs: list GL_OES_compressed_ETC1_RGB8_texture in 7.12 release notes Reviewed-by: Brian Paul bri...@vmware.com --- docs/relnotes-7.12.html |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/docs/relnotes-7.12.html b/docs/relnotes-7.12.html index f7a1dee..471bbda 100644 --- a/docs/relnotes-7.12.html +++ b/docs/relnotes-7.12.html @@ -46,6 +46,7 @@ tbd liGL_NV_fog_distance (all gallium drivers, nouveau classic) liGL_NV_primitive_restart (r600g) liGL_OES_EGL_image_external (gallium drivers) +liGL_OES_compressed_ETC1_RGB8_texture (softpipe, llvmpipe) liARB_texture_rgb10_a2ui (softpipe, r600g) liMany updates to the VMware svga Gallium driver /ul ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i915g: Add unsupported PIPE_SHADER_CAP_OUTPUT_READ to silence warnings.
Module: Mesa Branch: master Commit: d269ce0a3940a650d6808b5893222a5596ebf36e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d269ce0a3940a650d6808b5893222a5596ebf36e Author: Stéphane Marchesin marc...@chromium.org Date: Thu Dec 1 18:09:18 2011 -0800 i915g: Add unsupported PIPE_SHADER_CAP_OUTPUT_READ to silence warnings. --- src/gallium/drivers/i915/i915_screen.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 9341fa9..7ef24f5 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -151,6 +151,8 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha return 0; case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: return I915_TEX_UNITS; + case PIPE_SHADER_CAP_OUTPUT_READ: + return 0; default: debug_printf(%s: Unknown cap %u.\n, __FUNCTION__, cap); return 0; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i915g: Implement GL_STREAM_* for textures by using untiled textures.
Module: Mesa Branch: master Commit: 52b75c6165f2b100fe3f8a55ea3f91fbc79e1bf5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=52b75c6165f2b100fe3f8a55ea3f91fbc79e1bf5 Author: Stéphane Marchesin marc...@chromium.org Date: Wed Nov 9 16:46:24 2011 -0800 i915g: Implement GL_STREAM_* for textures by using untiled textures. --- src/gallium/drivers/i915/i915_resource_texture.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index 0b6424f..8ff733a 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -958,7 +958,7 @@ i915_texture_create(struct pipe_screen *screen, pipe_reference_init(tex-b.b.reference, 1); tex-b.b.screen = screen; - if (force_untiled) + if ( (force_untiled) || (template-usage == PIPE_USAGE_STREAM) ) tex-tiling = I915_TILE_NONE; else tex-tiling = i915_texture_tiling(is, tex); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges.
Module: Mesa Branch: master Commit: a4f345e0d21d13186b22f78718547b862d63fdf6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4f345e0d21d13186b22f78718547b862d63fdf6 Author: Mathias Fröhlich mathias.froehl...@web.de Date: Thu Dec 1 18:29:18 2011 +0100 mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges. The BITSET64_{TEST,SET,CLEAR}_RANGE macros only work on ranges wither in the lower 32 or in the upper 32 bits of the bitset. This change extends these macros to work on arbitrary ranges possibly crossing the bitset word boundary. Signed-off-by: Mathias Froehlich mathias.froehl...@web.de Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/main/bitset.h | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index 7a0704b..c27b4c4 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -129,17 +129,32 @@ __bitset_ffs(const BITSET_WORD *x, int n) /* bit range operations */ -#define BITSET64_TEST_RANGE(x, b, e) \ +#define BITSET64_TEST_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] BITSET64_RANGE(b, e)) : \ (assert (!BITSET64_TEST_RANGE: bit range crosses word boundary), 0)) -#define BITSET64_SET_RANGE(x, b, e) \ +#define BITSET64_TEST_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_TEST_SUBRANGE(x, b, e)) : \ + (BITSET64_TEST_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ +BITSET64_TEST_SUBRANGE(x, BITSET64_WORDBITS, e))) +#define BITSET64_SET_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] |= BITSET64_RANGE(b, e)) : \ (assert (!BITSET64_SET_RANGE: bit range crosses word boundary), 0)) -#define BITSET64_CLEAR_RANGE(x, b, e) \ +#define BITSET64_SET_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_SET_SUBRANGE(x, b, e)) : \ + (BITSET64_SET_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ +BITSET64_SET_SUBRANGE(x, BITSET64_WORDBITS, e))) +#define BITSET64_CLEAR_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] = ~BITSET64_RANGE(b, e)) : \ (assert (!BITSET64_CLEAR_RANGE: bit range crosses word boundary), 0)) +#define BITSET64_CLEAR_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_CLEAR_SUBRANGE(x, b, e)) : \ + (BITSET64_CLEAR_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ +BITSET64_CLEAR_SUBRANGE(x, BITSET64_WORDBITS, e))) #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Renumber the tnl attributes to match VERT_ATTRIB*.
Module: Mesa Branch: master Commit: ce45aecfdab9926b767d9924bddbc4304d59641c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce45aecfdab9926b767d9924bddbc4304d59641c Author: Mathias Fröhlich mathias.froehl...@web.de Date: Thu Dec 1 18:31:06 2011 +0100 mesa: Renumber the tnl attributes to match VERT_ATTRIB*. Also renumber the tnl modules vertex attributes to match the renumbered VERT_ATTRIB_* values. This should fix https://bugs.freedesktop.org/show_bug.cgi?id=43353 Signed-off-by: Mathias Froehlich mathias.froehl...@web.de Tested-by: Vinson Lee v...@vmware.com Reviewed-by: Brian Paul bri...@vmware.com --- src/mesa/tnl/t_context.h | 58 +++--- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index a7e8c7c..36b1043 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -93,22 +93,22 @@ enum { _TNL_ATTRIB_TEX6 = 14, _TNL_ATTRIB_TEX7 = 15, - _TNL_ATTRIB_GENERIC0 = 16, /* doesn't really exist! */ - _TNL_ATTRIB_GENERIC1 = 17, - _TNL_ATTRIB_GENERIC2 = 18, - _TNL_ATTRIB_GENERIC3 = 19, - _TNL_ATTRIB_GENERIC4 = 20, - _TNL_ATTRIB_GENERIC5 = 21, - _TNL_ATTRIB_GENERIC6 = 22, - _TNL_ATTRIB_GENERIC7 = 23, - _TNL_ATTRIB_GENERIC8 = 24, - _TNL_ATTRIB_GENERIC9 = 25, - _TNL_ATTRIB_GENERIC10 = 26, - _TNL_ATTRIB_GENERIC11 = 27, - _TNL_ATTRIB_GENERIC12 = 28, - _TNL_ATTRIB_GENERIC13 = 29, - _TNL_ATTRIB_GENERIC14 = 30, - _TNL_ATTRIB_GENERIC15 = 31, + _TNL_ATTRIB_GENERIC0 = 17, /* doesn't really exist! */ + _TNL_ATTRIB_GENERIC1 = 18, + _TNL_ATTRIB_GENERIC2 = 19, + _TNL_ATTRIB_GENERIC3 = 20, + _TNL_ATTRIB_GENERIC4 = 21, + _TNL_ATTRIB_GENERIC5 = 22, + _TNL_ATTRIB_GENERIC6 = 23, + _TNL_ATTRIB_GENERIC7 = 24, + _TNL_ATTRIB_GENERIC8 = 25, + _TNL_ATTRIB_GENERIC9 = 26, + _TNL_ATTRIB_GENERIC10 = 27, + _TNL_ATTRIB_GENERIC11 = 28, + _TNL_ATTRIB_GENERIC12 = 29, + _TNL_ATTRIB_GENERIC13 = 30, + _TNL_ATTRIB_GENERIC14 = 31, + _TNL_ATTRIB_GENERIC15 = 32, /* These alias with the generics, but they are not active * concurrently, so it's not a problem. The TNL module @@ -120,25 +120,25 @@ enum { * generic attribute in order to pick up per-vertex material * data. */ - _TNL_ATTRIB_MAT_FRONT_AMBIENT = 16, - _TNL_ATTRIB_MAT_BACK_AMBIENT = 17, - _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 18, - _TNL_ATTRIB_MAT_BACK_DIFFUSE = 19, - _TNL_ATTRIB_MAT_FRONT_SPECULAR = 20, - _TNL_ATTRIB_MAT_BACK_SPECULAR = 21, - _TNL_ATTRIB_MAT_FRONT_EMISSION = 22, - _TNL_ATTRIB_MAT_BACK_EMISSION = 23, - _TNL_ATTRIB_MAT_FRONT_SHININESS = 24, - _TNL_ATTRIB_MAT_BACK_SHININESS = 25, - _TNL_ATTRIB_MAT_FRONT_INDEXES = 26, - _TNL_ATTRIB_MAT_BACK_INDEXES = 27, + _TNL_ATTRIB_MAT_FRONT_AMBIENT = 17, + _TNL_ATTRIB_MAT_BACK_AMBIENT = 18, + _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 19, + _TNL_ATTRIB_MAT_BACK_DIFFUSE = 20, + _TNL_ATTRIB_MAT_FRONT_SPECULAR = 21, + _TNL_ATTRIB_MAT_BACK_SPECULAR = 22, + _TNL_ATTRIB_MAT_FRONT_EMISSION = 23, + _TNL_ATTRIB_MAT_BACK_EMISSION = 24, + _TNL_ATTRIB_MAT_FRONT_SHININESS = 25, + _TNL_ATTRIB_MAT_BACK_SHININESS = 26, + _TNL_ATTRIB_MAT_FRONT_INDEXES = 27, + _TNL_ATTRIB_MAT_BACK_INDEXES = 28, /* This is really a VERT_RESULT, not an attrib. Need to fix * tnl to understand the difference. */ _TNL_ATTRIB_POINTSIZE = 16, - _TNL_ATTRIB_MAX = 32 + _TNL_ATTRIB_MAX = 33 } ; #define _TNL_ATTRIB_TEX(u) (_TNL_ATTRIB_TEX0 + (u)) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit