summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add TBO support for GL_EXT_texture_norm16Tapani Pälli2018-04-271-3/+3
| | | | | | | | Earlier plumbing missed interaction with texture buffer objects. Fixes: 7f467d4f73 "mesa: GL_EXT_texture_norm16 extension plumbing" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove snprintf macro in imports.h to fix MSVC buildBrian Paul2018-04-131-1/+1
| | | | | | | | | | | | | | snprintf is a macro in the MSVC stdio.h header and we needed to include that header before imports.h where we also defined an snprintf macro. Otherwise, the MSVC build would fail. The recent mtypes.h removal patches seems to have exposed this issue. This patch simply removes our snprintf macro and replaces one use of it in teximage.c with _mesa_snprintf(). There are other calls to snprintf() in DRI drivers, but none of them are built on Windows. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* mesa: Silence remaining unused parameter warnings in teximage.cIan Romanick2018-04-111-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/mesa/main/teximage.c: In function ‘_mesa_test_proxy_teximage’: src/mesa/main/teximage.c:1301:51: warning: unused parameter ‘level’ [-Wunused-parameter] GLuint numLevels, GLint level, ^~~~~ src/mesa/main/teximage.c: In function ‘texsubimage_error_check’: src/mesa/main/teximage.c:2186:30: warning: unused parameter ‘dsa’ [-Wunused-parameter] bool dsa, const char *callerName) ^~~ src/mesa/main/teximage.c: In function ‘copytexture_error_check’: src/mesa/main/teximage.c:2297:32: warning: unused parameter ‘width’ [-Wunused-parameter] GLint width, GLint height, GLint border ) ^~~~~ src/mesa/main/teximage.c:2297:45: warning: unused parameter ‘height’ [-Wunused-parameter] GLint width, GLint height, GLint border ) ^~~~~~ src/mesa/main/teximage.c: In function ‘check_rtt_cb’: src/mesa/main/teximage.c:2679:21: warning: unused parameter ‘key’ [-Wunused-parameter] check_rtt_cb(GLuint key, void *data, void *userData) ^~~ src/mesa/main/teximage.c: In function ‘override_internal_format’: src/mesa/main/teximage.c:2756:55: warning: unused parameter ‘width’ [-Wunused-parameter] override_internal_format(GLenum internalFormat, GLint width, GLint height) ^~~~~ src/mesa/main/teximage.c:2756:68: warning: unused parameter ‘height’ [-Wunused-parameter] override_internal_format(GLenum internalFormat, GLint width, GLint height) ^~~~~~ src/mesa/main/teximage.c: In function ‘texture_sub_image’: src/mesa/main/teximage.c:3293:24: warning: unused parameter ‘dsa’ [-Wunused-parameter] bool dsa) ^~~ src/mesa/main/teximage.c: In function ‘can_avoid_reallocation’: src/mesa/main/teximage.c:3788:53: warning: unused parameter ‘x’ [-Wunused-parameter] mesa_format texFormat, GLint x, GLint y, GLsizei width, ^ src/mesa/main/teximage.c:3788:62: warning: unused parameter ‘y’ [-Wunused-parameter] mesa_format texFormat, GLint x, GLint y, GLsizei width, ^ src/mesa/main/teximage.c: In function ‘valid_texstorage_ms_parameters’: src/mesa/main/teximage.c:5987:40: warning: unused parameter ‘samples’ [-Wunused-parameter] GLsizei samples, unsigned dims) ^~~~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Silence unused parameter warning in compressedteximage_only_formatIan Romanick2018-04-111-8/+8
| | | | | | | | | | | | | | | Passing ctx to compressedteximage_only_format was the only use of the ctx parameter in _mesa_format_no_online_compression, so that parameter had to go too. ../../SOURCE/master/src/mesa/main/teximage.c: In function ‘compressedteximage_only_format’: ../../SOURCE/master/src/mesa/main/teximage.c:1355:57: warning: unused parameter ‘ctx’ [-Wunused-parameter] compressedteximage_only_format(const struct gl_context *ctx, GLenum format) ^~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Assert base format before truncating to unsigned shortTopi Pohjolainen2018-04-111-2/+3
| | | | | | | | | CID: 1433709 Fixes: ca721b3d8: mesa: use GLenum16 in a few more places Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* mesa: Inherit texture view multi-sample information from the original ↵Henri Verbeet2018-03-291-10/+10
| | | | | | | | | | | | | | texture images. Found running "The Witness" in Wine. Without this patch, texture views created on multi-sample textures would have a GL_TEXTURE_SAMPLES of 0. All things considered such views actually work surprisingly well, but when combined with (plain) multi-sample textures in a framebuffer object, the resulting FBO is incomplete because the sample counts don't match. CC: <[email protected]> Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: adjust incorrect comment in texture_buffer_rangeMarek Olšák2018-03-191-2/+2
|
* mesa: RGB9_E5 invalid for CopyTexSubImage* in GLESJuan A. Suarez Romero2018-03-161-0/+14
| | | | | | | | | | According to OpenGL ES 3.2, section 8.6, CopyTexSubImage* should return an INVALID_OPERATION if the internalformat of the texture is RGB9_E5. This fixes dEQP-GLES31.functional.debug.negative_coverage.*.copytexsubimage2d_texture_internalformat. Reviewed-by: Tapani Pälli <[email protected]>
* mesa: enable ASTC format for CompressedTexSubImage3DJuan A. Suarez Romero2018-02-051-8/+33
| | | | | | | | | | | | If extensions GL_KHR_texture_compression_astc_hdr or GL_KHR_texture_compression_astc_sliced_3d are implemented then ASTC format are supported in CompressedTex*Îmage3D. Fixes KHR-GLES2.texture_3d.* with this format. CC: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]>
* mesa: Correctly print glTexImage dimensionsElie Tournier2018-01-301-7/+6
| | | | | | | | texture_format_error_check_gles() displays error like "glTexImage%dD". This patch just replace the %d by the correct dimension. Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* 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]>