aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texfetch.c
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: fixup inconsistent naming of RG16 formatsMarek Olšák2013-02-061-2/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* swrast: use new core Mesa compressed texel fetch functionsBrian Paul2012-12-141-87/+106
|
* swrast: merge get_texel_fetch_func() and set_fetch_functions()Brian Paul2012-12-141-26/+20
| | | | No real need for separate functions anymore.
* swrast: make _mesa_get_texel_fetch_func() staticBrian Paul2012-12-141-4/+4
| | | | Not called from any other file.
* mesa: Add decoding functions for GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2Anuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored in MESA_FORMAT_SARGB. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2Anuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored in MESA_FORMAT_RGBA8888_REV. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SIGNED_RG11_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_SIGNED_RG11_EAC format is decoded and stored in MESA_FORMAT_SIGNED_GR1616. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in MESA_FORMAT_SIGNED_R16. v2: 16 bit signed data is converted to 16 bit unsigned data by adding 2 ^ 15 and stored in an unsigned texture format. v3: 1. Handle a corner case when base code word value is -128. As per OpenGL ES 3.0 specification -128 is not an allowed value and should be truncated to -127. 2. Converting a decoded 16 bit signed data to 16 bit unsigned data by adding 2 ^ 15 gives us an output which matches the decompressed image (.ppm) generated by ericsson's etcpack tool. ericsson is also doing this conversion in their tool because .ppm image files don't support signed data. But gles 3.0 specification doesn't suggest this conversion. We need to keep the decoded data in signed format. Both signed format tests in gles3 conformance pass with these changes. Signed-off-by: Anuj Phogat <[email protected]> Tested-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RG11_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_RG11_EAC format is decoded and stored in MESA_FORMAT_RG1616. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_R11_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_R11_EAC format is decoded and stored in MESA_FORMAT_R16. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC format is decoded and stored in MESA_FORMAT_SARGB8. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RGBA8_ETC2_EACAnuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_RGBA8_ETC2_EAC format is decoded and stored in MESA_FORMAT_RGBA8888_REV. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ETC2Anuj Phogat2012-12-071-1/+1
| | | | | | | | Data in GL_COMPRESSED_SRGB8_ETC2 format is decoded and stored in MESA_FORMAT_SARGB8. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add decoding functions for GL_COMPRESSED_RGB8_ETC2Anuj Phogat2012-12-071-1/+1
| | | | | | | | | Data in GL_COMPRESSED_RGB8_ETC2 format is decoded and stored in MESA_FORMAT_RGBX8888_REV. v2: Use CLAMP macro and stdbool.h Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add new MESA_FORMATs for ETC2 compressed texturesAnuj Phogat2012-12-071-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is required by OpenGL ES 3.0 to support ETC2 textures. This patch adds new MESA_FORMATs for following etc2 texture formats: GL_COMPRESSED_RGB8_ETC2 GL_COMPRESSED_SRGB8_ETC2 GL_COMPRESSED_RGBA8_ETC2_EAC GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC GL_COMPRESSED_R11_EAC GL_COMPRESSED_RG11_EAC GL_COMPRESSED_SIGNED_R11_EAC GL_COMPRESSED_SIGNED_RG11_EAC MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1 MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1 Above formats are currently available in only gles 3.0. v2: Add entries in texfetch_funcs[] array. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> v3 (Paul Berry <[email protected]>): comment out symbols that are not implemented yet, so that this commit compiles on its own; future commits will uncomment the symbols as they become available.
* swrast: remove explicit size from texfetch_funcs arrayBrian Paul2012-10-311-1/+1
| | | | | | | | By removing the array size, the static assertion to check for missing elements can do its job properly. This will catch cases where a new Mesa format is added but the swrast texfetch code isn't updated. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formatsBrian Paul2012-08-241-24/+24
| | | | | | | As with the previous commit. This fixes the last crash in the piglit copyteximage test but there's still some failures.
* mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formatsBrian Paul2012-08-241-24/+24
| | | | | | | Fix-up the texel fetch functions so that they handle 3D coords (as used for array textures) and remove the "f_2d" part from their names. Helps fix swrast crashes in piglit's copyteximage test. More to come.
* swrast: Support sampler object for texture fetching statePauli Nieminen2012-08-011-4/+14
| | | | | | | | | | | | swrast needs to pass sampler object into all texture fetching functions to use correct sampling state when sampler object is bound to the unit. The changes were made using half manual regular expression replace. v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current values aren't set yet, so we need to look at our texObj2D. (anholt) Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa formats: add MESA_FORMAT_ABGR2101010_UINTJordan Justen2012-07-211-1/+7
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: remove unused StoreTexel codeBrian Paul2012-01-241-274/+95
| | | | | No longer needed since we do all rendering to texture with the buffer mapping and pixel packing functions.
* mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88Brian Paul2011-12-021-5/+5
| | | | R is in the high byte, G in the low byte.
* mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88Brian Paul2011-12-021-5/+5
| | | | | To better reflect the component ordering and be consistent with other format names.
* mesa: add support for GL_OES_compressed_ETC1_RGB8_textureChia-I Wu2011-12-021-0/+8
| | | | | | | | | | | 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 <[email protected]>
* swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entriesBrian Paul2011-11-301-1/+2
| | | | | | | When new MESA_FORMAT_x enums are added we need to add a new entry in the table of texture fetch functions. In the past this has been missed if swrast isn't actually tested. Using a static assertion should help with that.
* swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINTBrian Paul2011-11-281-0/+7
| | | | | | | | | | As with the other integer-valued formats, use NULL until we support integer textures. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316 Tested-by: Vinson Lee <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REVChia-I Wu2011-11-271-0/+14
| | | | | | | | | | | | | MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android. Thanks to texture-from-pixmap, drivers may actually see texture images with this format on Android. MESA_FORMAT_RGBX8888 is added only for completeness. Reviewed-by: Brian Paul <[email protected]> [olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format. I accidentally moved them to the wrong place when preparing the patch.]
* swrast: s/FetchTexelf/FetchTexel/Brian Paul2011-10-071-7/+7
|
* swrast: remove unused swrast_texture_image::FetchTexelc methodBrian Paul2011-10-071-61/+1
| | | | We only use the float-valued function now.
* swrast: update texfetch_funcs table for new int/uint formatsBrian Paul2011-10-051-0/+325
| | | | | This only adds dummy entries to the table to fix failed assertions. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41491
* mesa: s/INLINE/inline/Brian Paul2011-10-011-1/+1
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: move gl_texture_image::FetchTexel fields to swrastBrian Paul2011-09-171-10/+12
| | | | | This also involves passing swrast_texture_image instead of gl_texture_image into all the fetch functions.
* mesa: move software texel fetch code into swrastBrian Paul2011-09-171-0/+1057
It's only used by swrast now so move it out of core Mesa.