summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texgetimage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add ARB_direct_state_access checks in texture functionsFredrik Höglund2015-05-141-0/+14
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: finish implementing ARB_texture_stencil8 (v5)Dave Airlie2015-04-231-1/+49
| | | | | | | | | | | | | | Parts of this were implemented previously, so finish it off. v2: fix getteximage falling into the integer check add fixes for the FBO paths, (fbo-stencil8 test). v3: fix getteximage path harder. v4: remove swapbytes from getteximage path (Ilia) v5: brown paper bag the swapbytes removal. (Ilia) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: Fix typo in a commentAnuj Phogat2015-04-221-2/+2
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Checking for cube completeness in GetCompressedTextureImage.Laura Ekstrand2015-03-091-1/+10
| | | | | | | | | v2: Review from Anuj Phogat - Remove redundant copies of the cube map block comment - Replace redundant "if (!texImage) return;" statements with assert(texImage) Reviewed-by: Anuj Phogat <[email protected]>
* main: assert(texImage) in ARB_DSA texture cube map functions.Laura Ekstrand2015-03-091-2/+3
| | | | | | | | | | | | | ARB_direct_state_access functions that deal with texture cube maps need to make sure that texture images are not NULL before operating on them. In the following cases, the error check functions already throw an error if texImage == NULL, so an assert can be raised instead. v2: Review from Anuj Phogat - Replace redundant "if (!texImage) return;" statements with assert(texImage) Reviewed-by: Anuj Phogat <[email protected]>
* main: Remove redundant copy of cube map block comment in GetTextureImage.Laura Ekstrand2015-03-091-29/+3
| | | | | | | | | | | | The comment describing why ARB_direct_state_access texture cube map functions use _mesa_cube_level_complete is very long. To save room in the files, readers are now referred to one central comment on texturesubimage in teximage.c. v2: Review from Anuj Phogat - Remove redundant copies of the cube map block comment Reviewed-by: Anuj Phogat <[email protected]>
* main: Remove redundant NumLayers checks.Laura Ekstrand2015-03-091-13/+0
| | | | | | | | ARB_direct_state_access texture functions that operate on cube maps no longer need to verify that cube map texture objects contain six texture images because _mesa_cube_level_complete now does that for them. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: silence unused var warning in get_tex_rgba_uncompressed()Brian Paul2015-02-271-1/+2
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.Laura Ekstrand2015-02-171-2/+2
| | | | | | | | | | | Previously array textures were not working with GetCompressedTextureImage, leading to failures in the test arb_direct_state_access/getcompressedtextureimage.c. Tested-by: Laura Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "10.4, 10.5" <[email protected]>
* mesa: silence uninitialized var warning in get_tex_rgba_uncompressed()Brian Paul2015-02-161-2/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix element count for byte-swaps in texstore, readpix and texgetimageIago Toral Quiroga2015-02-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some old format conversion code in pack.c implemented byte-swapping like this: GLint comps = _mesa_components_in_format(dstFormat); GLint swapSize = _mesa_sizeof_packed_type(dstType); if (swapSize == 2) _mesa_swap2((GLushort *) dstAddr, n * comps); else if (swapSize == 4) _mesa_swap4((GLuint *) dstAddr, n * comps); where n is the pixel count. But this is incorrect for packed formats, where _mesa_sizeof_packed_type is already returning the size of a pixel instead of the size of a single component, so multiplying this by the number of components in the format results in a larger element count for _mesa_swap than we want. Unfortunately, we followed the same implementation for byte-swapping in the rewrite of the format conversion code for texstore, readpixels and texgetimage. This patch computes the correct element counts for _mesa_swap calls by computing the bytes per pixel in the image and dividing that by the swap size to obtain the number of swaps required per pixel. Then multiplies that by the number of pixels in the image to obtain the swap count that we need to use. Also, when handling byte-swapping in texstore_rgba, we were ignoring the image's depth. This patch fixes this too. Reviewed-by: Jason Ekstrand <[email protected]> Cc: "10.5" <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-3/+3
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: rename RGBA8888_* format constants to something appropriate.Iago Toral Quiroga2015-01-141-2/+2
| | | | | | | | The 8888 suggests 8-bit components which is not correct, so replace that with the actual size of the components in each format. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Use _mesa_format_convert to implement get_tex_rgba_compressed.Iago Toral Quiroga2015-01-121-39/+34
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: use _mesa_format_convert to implement get_tex_rgba_uncompressed.Iago Toral Quiroga2015-01-121-117/+133
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: fix MSVC compilation errorsBrian Paul2015-01-081-5/+5
| | | | | | Move assertions after declarations and don't use void pointer arithmetic. Reviewed-by: Jose Fonseca <[email protected]>
* main: Checking for cube completeness in GetTextureImage.Laura Ekstrand2015-01-081-12/+35
| | | | | | | | This is part of a potential solution to a spec bug. Cube completeness is a concept from glGenerateMipmap, but it seems reasonable to check for it in GetTextureImage when the target is GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetCompressedTextureImage.Laura Ekstrand2015-01-081-45/+121
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetTextureImage.Laura Ekstrand2015-01-081-66/+230
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Renamed _mesa_get_compressed_teximage to _mesa_GetCompressedTexImage_sw.Laura Ekstrand2015-01-081-3/+3
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* main: Renamed _mesa_get_teximage to _mesa_GetTexImage_sw.Laura Ekstrand2015-01-081-3/+3
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_lock_texture and _mesa_unlock_texture to texobj.h from ↵Laura Ekstrand2015-01-081-1/+1
| | | | | | teximage.h. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: remove unused ctx parameter for _mesa_select_tex_image()Brian Paul2015-01-051-4/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix GetTexImage for 1D array depth texturesDave Airlie2014-10-031-2/+7
| | | | | | | | | | | | | | | | While running piglit in virgl, I hit an assert in intel driver. "qemu-system-x86_64: intel_tex.c:219: intel_map_texture_image: Assertion `tex_image->TexObject->Target != 0x8C18 || h == 1' failed." Thanks to Eric and Ken for pointing me in the right direction, Fix the get_tex_depth to do the same fixup as get_tex_rgba does for 1D array textures. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
* mesa: move _mesa_compressed_texture_pixel_storage_error_check()Brian Paul2014-08-161-3/+4
| | | | | | | to pixelstore.c, add const qualifier to the 'packing' parameter. Add comments. Reviewed-by: Matt Turner <[email protected]>
* mesa: minor improvements to _mesa_compute_compressed_pixelstore()Brian Paul2014-08-161-1/+1
| | | | | | | | | Replace the gl_texture_image parameter with mesa_format since we only used the image's format. Add some comments. Reviewed-by: Matt Turner <[email protected]>
* Remove the ATI_envmap_bumpmap extensionJason Ekstrand2014-06-301-5/+0
| | | | | | | | | | | As far as I can tell, the Intel mesa driver is the only driver in the world still supporting this legacy extension. If someone wants to do bump mapping, they can use shaders. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1] Reviewed-by: Chris Forbes <[email protected]> [v2] Reviewed-by: Ian Romanick <[email protected]> [v3]
* mesa: Add pixel storage support for GetCompressedTexImageChris Forbes2014-06-101-33/+40
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Emit errors for inconsistent compressed pixel store stateChris Forbes2014-06-101-1/+9
| | | | | | | V2: Use bool rather than GLboolean for internal function Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()Anuj Phogat2014-05-011-2/+2
| | | | | | | | Fixes a crash in Khronos OpenGL CTS packed_pixels tests. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add new helper function _mesa_unpack_depth_stencil_row()Anuj Phogat2014-05-011-5/+4
| | | | | | | | | | This patch makes non-functional changes in the code. New helper function added here will make it easier to support more data types in the following patches. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()Anuj Phogat2014-05-011-0/+5
| | | | | | | | | | From OpenGL 4.0 spec, page 306: "Calling GetTexImage with a format of STENCIL_INDEX causes the error INVALID_ENUM." Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add error condition for integer formats in glGetTexImage()Anuj Phogat2014-04-161-0/+5
| | | | | | | | | | | | | | OpenGL 4.0 spec, page 306 suggests an INVALID_OPERATION in glGetTexImage if : "format is one of the integer formats in table 3.3 and the internal format of the texture image is not integer, or format is not one of the integer formats in table 3.3 and the internal format is integer." V2: Use helper function _mesa_is_format_integer() Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: do depth/stencil format conversion in glGetTexImageBrian Paul2014-02-281-2/+9
| | | | | | | | | | | | | | | | glGetTexImage(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) was just using memcpy() instead of _mesa_unpack_uint_24_8_depth_stencil_row() to convert texels from the hardware format to the GL format. Fixes issue reported by David Meng at Intel. The new piglit ext_packed_depth_stencil-getteximage test checks for this bug. Also, add some format/type assertions. We don't yet handle the GL_FLOAT_32_UNSIGNED_INT_24_8_REV type. That should be fixed in a follow-on patch. Reviewed-by: Eric Anholt <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* mesa: allow buffers to be mapped multiple timesMarek Olšák2014-02-251-4/+6
| | | | | | | | | | | | | | | | | | | OpenGL allows a buffer to be mapped only once, but we also map buffers internally, e.g. in the software primitive restart fallback, for PBOs, vbo_get_minmax_index, etc. This has always been a problem, but it will be a bigger problem with persistent buffer mappings, which will prevent all Mesa functions from mapping buffers for internal purposes. This adds a driver interface to core Mesa which supports multiple buffer mappings and allows 2 mappings: one for the GL user and one for Mesa. Note that Gallium supports an unlimited number of buffer and texture mappings, so it's not really an issue for Gallium. v2: fix unmapping in xm_dd.c, remove the GL errors there v3: fix the intel driver (by Fredrik) Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: allow buffers mapped with the persistent flag to be used by the GPUMarek Olšák2014-02-251-2/+2
| | | | | | v2: also fixed InvalidateBufferData, added citations from the 4.4 spec Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-2/+2
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* mesa: Use a single enable for GL_EXT_texture_array and GL_MESA_texture_arrayIan Romanick2013-12-041-2/+1
| | | | | | | | | | | Every driver that enables one also enables the other. The difference between the two is MESA adds support for fixed-function and assembly fragment shaders, but EXT only adds support for GLSL. The MESA extension was created back when Mesa did not support GLSL. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: improve format selection for GLESMarek Olšák2013-10-081-1/+1
| | | | Reviewed-by: Wladimir J. van der Laan <[email protected]>
* mesa: handle 2D texture arrays in get_tex_rgba_compressed()Brian Paul2013-07-241-28/+24
| | | | | | | | | | | If we call glGetTexImage() for a compressed 2D texture array we need to loop over all the slices. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850 NOTE: This is a candidate for the 9.x branches. Cc: [email protected] Reviewed-by: José Fonseca <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: handle HALF_FLOAT like FLOAT in get_tex_rgbaMarek Olšák2013-03-231-0/+1
| | | | | | | NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: fix GetTexImage if mesa format and internal format don't matchMarek Olšák2013-02-111-0/+45
| | | | | | | | Tested with softpipe only exposing RGBA formats. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use memcpy fast path for GetTexImage if base format is differentMarek Olšák2013-02-111-4/+6
| | | | | | | | | | | The Mesa format can be RGBA8888_REV, the format/type can be GL_RGBA/GL_UNSIGNED_BYTE, but the actual texture internal format can be LUMINANCE_ALPHA, INTENSITY, etc. Therefore we should look at the base internal format as well. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use _mesa_base_tex_format for format parameter of GetTexImageMarek Olšák2013-02-111-1/+36
| | | | | | | | | | _mesa_base_tex_format doesn't accept GL_BGR and GL_ABGR_EXT, etc. v2: add a (now hopefully complete) helper function to deal with this NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-2/+4
| | | | | | | | | | | We now have a separate dispatch table for begin/end that prevent these functions from being entered during that time. The ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to change any return values or introduce new error-only stubs at this point. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>