summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: assorted whitespace, formatting fixes in teximage.cBrian Paul2015-07-211-20/+10
| | | | Trivial.
* mesa: allow GL_TEXTURE_CUBE_MAP_ARRAY case for glCompressedTexSubImage3D()Brian Paul2015-07-211-1/+1
| | | | | | | | | | | Since s3tc works for cube maps and 2D arrays, it should also work for cube arrays. NVIDIA's driver supports this too. Seems like the spec should say this. This is a minor follow-on fix for the commit "mesa: fix up some texture error checks". Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-57/+57
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix up some texture error checksRoland Scheidegger2015-07-181-21/+20
| | | | | | | | | | | In particular, we were incorrectly accepting s3tc (and lots of others) for CompressedTexSubImage3D (but not CompressedTexImage3D) calls with 3d targets. At this time, the only allowed formats for these calls are the bptc ones, since none of the specific extensions allow it (astc hdr would). Also, fix up a bug in _mesa_target_can_be_compressed - 3d target needs to be allowed for bptc formats. Reviewed-by: Brian Paul <[email protected]>
* mesa/teximage: use correct extension for accept stencil texture.Dave Airlie2015-06-081-1/+1
| | | | | | | | | | | | | This was using the wrong extension, ARB_stencil_texturing doesn't mention any changes in this area. Fixes "dEQP-GLES3.functional.fbo.completeness.renderable.texture. stencil.stencil_index8." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90751 Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "mesa: Add ARB_direct_state_access checks in texture functions"Ian Romanick2015-05-281-74/+0
| | | | | | | This reverts commit 8940957238e8584ce27295791cee4cc3d6f7cf1e. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Add ARB_direct_state_access checks in texture functionsFredrik Höglund2015-05-141-0/+74
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: put more info in glTexImage GL_OUT_OF_MEMORY error messageBrian Paul2015-04-241-1/+3
| | | | | | | Give the user some idea about the size of the texture which caused the GL_OUT_OF_MEMORY error. Reviewed-by: Matt Turner <[email protected]>
* mesa: finish implementing ARB_texture_stencil8 (v5)Dave Airlie2015-04-231-1/+2
| | | | | | | | | | | | | | 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]>
* main: Add TEXTURE_CUBE_MAP support in CopyTextureSubImage3D.Laura Ekstrand2015-03-191-3/+11
| | | | | | | | | | | | | | | | | | So it turns out that this doesn't actually fix any bugs or add any features, stictly speaking. However, it does avoid a lot of kludginess. Previously, if you called glCopyTextureSubImage3D(texcube, 0, 0, 0, zoffset = 3, ... it would grab the texture image object for face = 0 in teximage.c instead of the desired face = 3. But Line 274 of brw_blorp_blit.cpp would correct for this by updating the slice to 3. This commit does the correct thing before calling any drivers, which should make the functionality much more robust and uniform across all drivers. Reviewed-by: Anuj Phogat <[email protected]>
* main: Simplify debug messages for CopyTex*SubImage*D.Laura Ekstrand2015-03-191-48/+36
| | | | | Reviewed-by: Martin Peres <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Check for valid PBO access in gl(Compressed)Tex(Sub)Image callsEduardo Lima Mitev2015-03-131-77/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds two types of checks to the gl(Compressed)Tex(Sub)Imgage family of functions when a pixel buffer object is bound to GL_PIXEL_UNPACK_BUFFER: - That the buffer is not mapped. - The total data size is within the boundaries of the buffer size. It does so by calling auxiliary validations functions from PBO API: _mesa_validate_pbo_source() for non-compressed texture calls, and _mesa_validate_pbo_source_compressed() for compressed texture calls. The first check is defined in Section 6.3.2 'Effects of Mapping Buffers on Other GL Commands' of the GLES 3.1 spec, page 57: "Any GL command which attempts to read from, write to, or change the state of a buffer object may generate an INVALID_OPERATION error if all or part of the buffer object is mapped. However, only commands which explicitly describe this error are required to do so. If an error is not generated, using such commands to perform invalid reads, writes, or state changes will have undefined results and may result in GL interruption or termination." Similar wording exists in GL 4.5 spec, page 76. In the case of gl(Compressed)Tex(Sub)Image(2,3)D, the specification doesn't force implemtations to throw an error. However since Mesa don't currently implement checks to determine when it is safe to read/write from/to a mapped PBO, we should always return the error if all or parts of it are mapped. The 2nd check is defined in Section 8.5 'Texture Image Specification' of the OpenGL 4.5 spec, page 203: "An INVALID_OPERATION error is generated if a pixel unpack buffer object is bound and storing texture data would access memory beyond the end of the pixel unpack buffer." Fixes 4 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.compressedteximage2d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedteximage3d_invalid_buffer_target * dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d_invalid_buffer_target Reviewed-by: Laura Ekstrand <[email protected]>
* main: Add entry point for TextureBufferRange.Laura Ekstrand2015-03-091-0/+46
| | | | | | | | v2: Review by Martin Peres - Get rid of difficult-to-follow code copied and pasted from the original TexBufferRange Reviewed-by: Anuj Phogat <[email protected]>
* main: Add check_texture_buffer_target.Laura Ekstrand2015-03-091-11/+28
| | | | | | | | | | Creates a shared function to ensure that texture buffer target is GL_TEXTURE_BUFFER. Helps to clean up the Tex[ture]Buffer[Range] functions. v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] Reviewed-by: Anuj Phogat <[email protected]>
* main: Add check_texture_buffer_range.Laura Ekstrand2015-03-091-15/+58
| | | | | | | | | | Creates a shared function that TexBufferRange and TextureBufferRange can use to check the buffer range. This cleans up TexBufferRange considerably. v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] Reviewed-by: Anuj Phogat <[email protected]>
* main: Cosmetic changes for Texture Buffers.Laura Ekstrand2015-03-091-2/+9
| | | | | | | | | Adds a useful comment and some whitespace. Fixes an error message. v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] Reviewed-by: Anuj Phogat <[email protected]>
* main: Refactor _mesa_texture_buffer_range.Laura Ekstrand2015-03-091-36/+22
| | | | | | | | | | | Changes how the caller is identified in error messages, moves a check for ARB_texture_buffer_object from the entry points to the shared code in _mesa_texture_buffer_range, and removes an unused argument (GLenum target). v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] Reviewed-by: Anuj Phogat <[email protected]>
* main: Use _mesa_lookup_bufferobj_err to simplify Tex[ture]Buffer[Range].Laura Ekstrand2015-03-091-11/+12
| | | | | | | | v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] - Closing curly brace on the same line as else Reviewed-by: Anuj Phogat <[email protected]>
* main: Add TEXTURE_CUBE_MAP support for glCompressedTextureSubImage3D.Laura Ekstrand2015-03-091-27/+131
| | | | | | | | | 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 NumLayers checks.Laura Ekstrand2015-03-091-14/+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]>
* main/base_tex_format: Properly handle STENCIL_INDEX1/4/16Jason Ekstrand2015-03-021-0/+3
| | | | | | | | This takes "fbo-stencil blit GL_STENCIL_INDEX1/4/16" from crash to pass on BDW. Cc: 10.5 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/main: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-021-2/+2
| | | | | | | | We've been using a mix of these two macros for a while now. Let's just use the later everywhere. It seems to be the convention used by other open-source projects. Acked-by: Ilia Mirkin <[email protected]>
* main: Fix whitespace in teximage.c.Laura Ekstrand2015-02-271-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* main: Fix target checking for CompressedTexSubImage*D.Laura Ekstrand2015-02-261-15/+65
| | | | | | | | | | | | | This fixes a dEQP test failure. In the test, glCompressedTexSubImage2D was called with target = 0 and failed to throw INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx, target) being called before the target checking. To remedy this, target checking was made into its own function and called prior to _mesa_get_current_tex_object. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89311 Reviewed-by: Anuj Phogat <[email protected]>
* main: Fix target checking for CopyTexSubImage*D.Laura Ekstrand2015-02-261-8/+54
| | | | | | | | | | | | | This fixes a dEQP test failure. In the test, glCopyTexSubImage2D was called with target = 0 and failed to throw INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx, target) being called before the target checking. To remedy this, target checking was separated from the main error-checking function and called prior to _mesa_get_current_tex_object. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89312 Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Add _mesa_is_array_texture helperIago Toral Quiroga2015-02-241-0/+22
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix error validating args for TexSubImage3DEduardo Lima Mitev2015-02-241-2/+2
| | | | | | | | | | | | | The zoffset and depth values were not being considered when calling error_check_subtexture_dimensions(). Fixes 2 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_offset * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_invalid_offset Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "10.4 10.5" <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-17/+17
| | | | Acked-by: Eric Anholt <[email protected]>
* main: Add STENCIL_INDEX formats to base_tex_formatJason Ekstrand2015-01-301-0/+10
| | | | | | | | This fixes a bug on BDW when our meta-based stencil blit path assert-fails due to an invalid internal format even though we do support the ARB_stencil_texturing extension. Reviewed-by: Matt Turner <[email protected]>
* teximage: Don't indent switch casesJason Ekstrand2015-01-301-146/+146
| | | | | | No functional change. Reviewed-by: Matt Turner <[email protected]>
* Mesa: Add support for HALF_FLOAT_OES type.Kalyan Kondapally2015-01-291-1/+1
| | | | | | | | | This patch adds needed support for accepting HALF_FLOAT_OES as valid type for TexImage*D and TexSubImage*D when Texture FLoat extensions are supported. Signed-off-by: Kevin Rogovin <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Mesa: Add support for GL_OES_texture_*float* extensions.Kalyan Kondapally2015-01-291-0/+64
| | | | | | | | | | | | | | | | | | | This patch series adds support for following GLES2 Texture Float extensions: 1)GL_OES_texture_float, 2)GL_OES_texture_half_float, 3)GL_OES_texture_float_linear, 4)GL_OES_texture_half_float_linear. This patch adds basic infrastructure and needed boolean flags to advertise support for these extensions, by default the support is disabled. Next patch in the series introduces support for HALF_FLOAT_OES token. v4: take assert away and make valid_filter_for_float conditional (Tapani), fix the alphabetical order (Emil) Signed-off-by: Kevin Rogovin <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: In _mesa_CompressedTextureSubImage3D() check found texObjJuha-Pekka Heikkila2015-01-121-0/+2
| | | | | | | Check returned texObj is not null. If texObj is null there is already GL_INVALID_OPERATION error set. Signed-off-by: Juha-Pekka Heikkila <[email protected]>
* mesa: Fix incorrect assertion in init_teximage_fields_msIago Toral Quiroga2015-01-121-1/+1
| | | | | | | | | | | | | | | | _BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the arb_texture_view-lifetime-format piglit test on nouveau, since that test calls _mesa_base_tex_format with GL_R16F with a context that does not have ARB_texture_float, so it returns -1 for the BaseFormat, which was not being caught properly by the ASSERT in init_teximage_fields_ms until now. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix get_texbuffer_format().Samuel Iglesias Gonsalvez2015-01-121-2/+2
| | | | | | | | | We were returning incorrect mesa formats for GL_LUMINANCE_ALPHA16I_EXT and GL_LUMINANCE_ALPHA32I_EXT. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: compute row stride outside of loop and fix MSVC compilation errorBrian Paul2015-01-081-2/+4
| | | | | | Can't do void pointer arithmetic with MSVC. Reviewed-by: Jose Fonseca <[email protected]>
* main: Checking for cube completeness in TextureSubImage.Laura Ekstrand2015-01-081-13/+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 TextureSubImage when target=GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <[email protected]>
* main: Refactor in teximage.c to handle NULL from _mesa_get_current_tex_object.Laura Ekstrand2015-01-081-0/+22
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureBuffer.Laura Ekstrand2015-01-081-16/+74
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Fix texObj->Immutable flag update in _mesa_texture_image_multisample.Laura Ekstrand2015-01-081-1/+1
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureStorage[23]DMultisample.Laura Ekstrand2015-01-081-28/+96
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glCompressedTextureSubImage*D.Laura Ekstrand2015-01-081-52/+187
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for CopyTextureSubImage*D.Laura Ekstrand2015-01-081-46/+124
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureSubImage*D.Laura Ekstrand2015-01-081-81/+251
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Removed trailing whitespaces in texture code.Laura Ekstrand2015-01-081-19/+19
| | | | | | | | main: Removed trailing whitespace in texstate.c. main: Deleted trailing whitespaces in texobj.c. main: Fixed whitespace errors in teximage.h and teximage.c. Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_get_current_tex_object from teximage.c to texobj.c.Laura Ekstrand2015-01-081-81/+0
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: remove unused ctx parameter for _mesa_select_tex_image()Brian Paul2015-01-051-13/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix height error check for 1D array texturesBrian Paul2014-12-021-1/+1
| | | | | | | | height=0 is legal for 1D array textures (as depth=0 is legal for 2D arrays). Fixes new piglit ext_texture_array-errors test. Cc: "10.3 10.4" <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* mesa: Mark buffer objects that are used as TexBOsChris Forbes2014-10-161-0/+6
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>