summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add const qualifier on _mesa_is_renderable_texture_format()Brian Paul2017-12-051-1/+2
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa: simplify/improve some _mesa_error() calls in teximage.cBrian Paul2017-12-051-9/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa/gles: adjust internal format in glTexSubImage2D error checksTapani Pälli2017-11-281-1/+55
| | | | | | | | | | | | | | | | | | | | | When floating point textures are created on OpenGL ES 2.0, driver is free to choose used internal format. Mesa makes this decision in adjust_for_oes_float_texture. Error checking for glTexImage2D properly checks that sized formats are not used. We use same error checking path for glTexSubImage2D (since there is lot of overlap), however since those checks include internalFormat checks, we need to pass original internalFormat passed by the client. Patch adds oes_float_internal_format that does reverse adjust_for_oes_float_texture to get that format. Fixes following test failure: ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float (when running test with MESA_GLES_VERSION_OVERRIDE=2.0) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227 Cc: "17.3" <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/teximage: add TEXTURE_CUBE_MAP_ARRAY target for CompressedTexImage3DJuan A. Suarez Romero2017-11-211-1/+19
| | | | | | | | | | | | | | | | | | | | | From section 8.7, page 179 of OpenGL ES 3.2 spec: An INVALID_OPERATION error is generated by CompressedTexImage3D if internalformat is one of the the formats in table 8.17 and target is not TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY or TEXTURE_3D. An INVALID_OPERATION error is generated by CompressedTexImage3D if internalformat is TEXTURE_CUBE_MAP_ARRAY and the “Cube Map Array” column of table 8.17 is not checked, or if internalformat is TEXTURE_3D and the “3D Tex.” column of table 8.17 is not checked. So far it was only considering TEXTURE_2D_ARRAY as valid target. But as "Cube Map Array" column is checked for all the cases, in practice we can consider also TEXTURE_CUBE_MAP_ARRAY. This fixes KHR-GLES32.core.texture_cube_map_array.etc2_texture Reviewed-by: Nanley Chery <[email protected]>
* mesa: Expose GL_OES_required_internalformat on GLES contexts.Eric Anholt2017-10-101-22/+9
| | | | | | | | | | | | | | | | | | | | | | | This extension is effectively a backport of GLES3's internalformat handling to GLES 1/2. It guarantees that sized internalformats specified for textures and renderbuffers have at least the specified size stored. That's a pretty minimal requirement, so I think it can be dummy_true and exposed as a standard in Mesa. As a side effect, it also allows GL_RGB565 to be specified as a texture format, not just as a renderbuffer. Mesa had previously been allowing 565 textures, which angered DEQP in the absence of this extension being exposed. v2: Allow 2101010rev with sized internalformats even on GLES3, citing the extension spec. Extend extension checks for GLES2 contexts exposing with texture_float, texture_half_float, and texture_rg. v3: Fix ALPHA/LUMINANCE/LUMINANCE_ALPHA error checking (GLES3 CTS failures) v4: Mark GL_RGB10 non-color-renderable on ES, fix A/L/LA errors on GLES2 with float formats. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: silence 'variable may be used uninitialized' warning in teximage.cBrian Paul2017-10-031-1/+1
| | | | | | Found with MinGW optimized build. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: Drop Mesa_DXTn from gl_contextMatt Turner2017-10-021-32/+0
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: whitespace, formatting fixes in teximage.cBrian Paul2017-09-081-55/+55
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: provide more info in some texture image error messagesBrian Paul2017-09-081-9/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: only copy requested compressed teximage cubemap facesChristoph Haag2017-08-201-2/+2
| | | | | | | | | This is analogous to commit 2259b11 which only fixed the regular case Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102308 Signed-off-by: Christoph Haag <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* mesa: hook up memory object multisamples tex(ture)storage apiAndres Rodriguez2017-08-061-22/+53
| | | | | | | | V2 (Timothy): - error check memory == 0 before lookup Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: make get_texbuffer_format() globalSamuel Pitoiset2017-08-021-3/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glTextureSubImage*D()Samuel Pitoiset2017-07-311-0/+52
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add texturesubimage_error() helperSamuel Pitoiset2017-07-311-30/+45
| | | | | | | And make texturesubimage() always inline. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add compressed_tex_sub_image_{error,no_error} helpersSamuel Pitoiset2017-07-241-36/+65
| | | | | | | To avoid inlining compressed_tex_sub_image() a bunch of times. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove pointless assignments in init_teximage_fields_ms()Brian Paul2017-07-221-3/+0
| | | | | | | | The NumSamples and FixedSampleLocation fields are set again later at the end of the function so these earlier assignments aren't needed. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: include texture size in error messagesBrian Paul2017-07-221-4/+5
| | | | | Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* main/teximage: Even on failure use valid format for init()Topi Pohjolainen2017-07-221-1/+1
| | | | | | | | | Otherwise init_teximage_fields_ms() (called by _mesa_init_teximage_fields()) will always assert as it can't find valid base format. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* mesa: simplify get_tex_images_for_clear()Brian Paul2017-07-061-19/+14
| | | | | | Get rid of redundant code. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: new comments, assertion related to glClearTexSubImageBrian Paul2017-07-061-0/+12
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* mesa: add KHR_no_error support for glCopyTexImage*D()Timothy Arceri2017-06-271-0/+20
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add no error support to copyteximage()Timothy Arceri2017-06-271-13/+30
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: create copyteximage_err() helper and always inline copyteximage()Timothy Arceri2017-06-271-4/+14
| | | | | | | This will be useful in the following patch when we add KHR_no_error support. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: tidy up copyteximage()Timothy Arceri2017-06-271-5/+5
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for glCopyTex{ture}SubImage*D()Timothy Arceri2017-06-271-0/+81
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add copy_texture_sub_image_no_error() helperTimothy Arceri2017-06-271-0/+17
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: remove redundant NULL checkTimothy Arceri2017-06-271-6/+2
| | | | | | This can never be NULL in any of the entry paths. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: create copy_texture_sub_image_err() helperTimothy Arceri2017-06-271-36/+48
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: make _mesa_copy_texture_sub_image() staticTimothy Arceri2017-06-271-90/+85
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for gl{Compressed}TexImage*D()Timothy Arceri2017-06-271-0/+82
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add no error support to teximage()Timothy Arceri2017-06-271-29/+32
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: create wrapper around teximage()Timothy Arceri2017-06-271-14/+26
| | | | | | | | This is used to inline KHR_no_error logic without inlining the function into all its callers. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: fix using texture id 0 with glTextureSubImage*()Samuel Pitoiset2017-06-221-5/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use _mesa_lookup_texture_err() in get_tex_obj_for_clear()Samuel Pitoiset2017-06-221-10/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: refuse to change textures when a handle is allocatedSamuel Pitoiset2017-06-141-1/+24
| | | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glTexSubImage*D()Samuel Pitoiset2017-06-071-0/+43
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add texsubimage() helperSamuel Pitoiset2017-06-071-0/+18
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: make _mesa_texture_sub_image() staticSamuel Pitoiset2017-06-071-20/+20
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: rename texsubimage() to texsubimage_err()Samuel Pitoiset2017-06-071-17/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glCompressedTex*SubImage3D()Timothy Arceri2017-05-171-1/+27
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add 3D support to compressed_tex_sub_image() helperTimothy Arceri2017-05-171-119/+66
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glCompressedTex*SubImage2D()Timothy Arceri2017-05-171-0/+27
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add 2D support to compressed_tex_sub_image() helperTimothy Arceri2017-05-171-67/+16
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for CompressedTex*SubImage1D()Timothy Arceri2017-05-171-9/+40
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add compressed_tex_sub_image() helperTimothy Arceri2017-05-171-44/+38
| | | | | | | | This reduces duplication between the dsa and non-dsa function and will also be used in the following commit to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: make _mesa_compressed_texture_sub_image() staticTimothy Arceri2017-05-171-39/+30
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-291-3/+3
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: remove unused _mesa_new_texture_image()Samuel Pitoiset2017-03-091-17/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa/main: *TextureSubImage* generates INVALID_OPERATION on wrong targetAlejandro Piñeiro2017-03-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Equivalent *TexSubImage* methods generates INVALID_ENUM. From OpenGL 4.5 spec, section 8.6 Alternate Texture Image Specification Commands: "An INVALID_ENUM error is generated by *TexSubImage* if target does not match the command, as shown in table 8.15." And: "An INVALID_OPERATION error is generated by *TextureSubImage* if the effective target of texture does not match the command, as shown in table 8.15." Fixes: GL45-CTS.direct_state_access.textures_copy_errors v2: slightly change commit summary (Samuel) Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Enable EXT_compressed_ETC1_RGB8_sub_texturePlamena Manolova2017-02-021-1/+0
| | | | | | | | | | | | | | | | Since we already have the functionality in place and games like Game of Thrones seem to depend on this extension, I think it makes sense to enable it by making it part of the extension string even though it's still a draft: https://www.khronos.org/registry/gles/extensions/EXT/EXT_compressed_ETC1_RGB8_sub_texture.txt Note: OES_compressed_ETC1_RGB8_sub_texture seems to be listed in gl2ext.h, but there's no documentation for it in the KHR registry Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>