summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: change glTexImage[23]DMultisample() internalformat to GLenumBrian Paul2013-10-161-2/+2
| | | | | | To match glext.h and the GL_ARB_texture_multisample extension. However, the GL 4.0 spec and man page say it's GLint. An OpenGL spec bug will be filed.
* mesa: consolidate cube width=height error checkingBrian Paul2013-10-161-38/+5
| | | | | | | | | | | | | | | Instead of checking width==height in four places, just do it in _mesa_legal_texture_dimensions() where we do the other width, height, depth checks. Similarly, move the check that cube map array depth is a multiple of 6. This change also fixes some missing cube dimension checks for the glTexStorage[23]D() functions. Remove width==height assertion in _mesa_get_tex_max_num_levels() since that's called before the other size checks for glTexStorage. Cc: "9.2" <[email protected]>
* mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().Kenneth Graunke2013-09-261-3/+3
| | | | | | | Every caller passed true. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove handcounted magic numberDylan Noblesmith2013-09-241-13/+20
| | | | | | Also make it a compile-time error with STATIC_ASSERT. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix number of mipmaps calculation for proxy texturesMikko Juola2013-07-311-0/+10
| | | | | | | | | | | | The function _mesa_get_tex_max_num_levels() is supposed to calculate the number of mipmap levels but it was not written to handle proxy textures, at best returning a maximum of 1 mipmap level. Because of this, at least glTexStorage*() calls would incorrectly fail when used with proxy textures with more than one mipmap level. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected]
* mesa: GL_ARB_texture_storage is not optionalIan Romanick2013-06-281-6/+2
| | | | | | | | | | | | | | In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. v2: Minor whitespace tidying (suggested by Brian). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Hide weirdness of 1D_ARRAY textures from Driver.CopyTexSubImage().Eric Anholt2013-06-171-5/+35
| | | | | | | | | | | | | | | | | Intel had brokenness here, and I'd like to continue moving Mesa toward hiding 1D_ARRAY's ridiculousness inside of the core, like we did with MapTextureImage. Fixes copyteximage 1D_ARRAY on intel. There's still an impedance mismatch in meta when falling back to read and texsubimage, since texsubimage expects coordinates into 1D_ARRAY as (width, slice, 0) instead of (width, 0, slice). v2: Fix offset of scanline reads from the source. (Thanks Brian!), replace dd.h comment with Paul's text and replace early exit with an assert. Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Paul Berry <[email protected]> (v1)
* mesa: fix OES_EGL_image_external being partially allowed in the core profileMarek Olšák2013-06-131-2/+3
| | | | Reviewed-by: Chad Versace <[email protected]>
* mesa: fix error checking of DXT sRGB formats in _mesa_base_tex_format()Brian Paul2013-05-301-2/+4
| | | | | | | | | | | | | For formats such as GL_COMPRESSED_SRGB_S3TC_DXT1_EXT we need to have both the GL_EXT_texture_sRGB and GL_EXT_texture_compression_s3tc extensions. This patch adds the missing check for the later. Found when checking out https://bugs.freedesktop.org/show_bug.cgi?id=65173 NOTE: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: asst. whitespace, formatting fixes in teximage.cBrian Paul2013-05-301-28/+43
|
* mesa: Track the TexImage being rendered to in the gl_renderbuffer.Eric Anholt2013-05-171-1/+1
| | | | | | | | | We keep having to pass the attachments around with our gl_renderbuffers because that's the only way to find what the gl_renderbuffer actually refers to. This is a step toward removing that (though drivers still need the Zoffset as well). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make core Mesa allocate the texture renderbuffer wrapper.Eric Anholt2013-05-061-2/+1
| | | | | | Every driver did the same thing. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix the compressed TexSubImage size checking codeBrian Paul2013-04-261-3/+9
| | | | | | | | | | | | | Before, we'd incorrectly generate an error if we we tried to replace a non-4x4 block near the edge of a NPOT compressed texture. For example, if the dest image was 15 texels wide and xoffset=12 and width=3 we'd incorrectly generate GL_INVALID_OPERATION. Verified with new tests added to piglit s3tc-errors test. Note: This is a candidate for the stable branches. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix type comparison errors in sub-texture error checking codeTapani Pälli2013-04-261-5/+5
| | | | | | | | | | patch fixes a crash that happens if glTexSubImage2D is called with a negative xoffset. NOTE: This is a candidate for stable branches. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-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: fix texture storage multisample prototypes harder.Dave Airlie2013-04-011-2/+2
| | | | | | I just noticed the warnings since I fixed the other bit. Signed-off-by: Dave Airlie <[email protected]>
* mesa: improve reported function name in Tex*MultisampleChris Forbes2013-03-311-16/+14
| | | | | | | | | Now that there are 4 variants, just pass the function name into teximagemultisample rather than reconstructing it. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glapi: add definition of ARB_texture_storage_multisampleChris Forbes2013-03-311-0/+20
| | | | | | | | | | Adds XML for the extension, dispatch_sanity enabling, and the two new entrypoints. These are both implemented by calling the shared teximagemultisample() with immutable=GL_TRUE. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add support for immutable textures to teximagemultisample()Chris Forbes2013-03-311-3/+28
| | | | | | | | | | | | | | | | | | The new entrypoints will come later, but this adds the actual logic for supporting immutable multisample textures: - The immutability flag is set as desired. - Attempting to modify an immutable multisample texture produces INVALID_OPERATION. Note: The extension spec does not mention adding this behavior to TexImage*Multisample, but it seems like the reasonable thing to do. V2: - Cover missing error cases (unsized formats; texture object zero) Signed-off-by: Chris Forbes <[email protected]> [V1] Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use _mesa_check_sample_count() for multisample texturesChris Forbes2013-03-241-27/+7
| | | | | | | | | | | | | | | | | | Extends _mesa_check_sample_count() to properly support the TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY targets, which have subtly different limits than renderbuffers. This resolves the remaining TODO in the implementation of TexImage*DMultisample. V2: - Don't introduce spurious block. - Do this in multisample.c instead. - Fix typo in error message. - Inline spec quotes Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't allocate a texture if width or height is 0 in CopyTexImageMarek Olšák2013-03-111-10/+12
| | | | | | NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: Allow ETC2/EAC formats with ARB_ES3_compatibility.Matt Turner2013-03-081-1/+1
| | | | | | Fixes piglit's oes_compressed_etc2_texture-miptree tests on Desktop GL. Reported-by: Marek Olšák <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* Add missing GL_TEXTURE_CUBE_MAP entry in _mesa_legal_texture_dimensionsAlan Hourihane2013-03-051-0/+1
| | | | | | | | | This was hit on the glTexStorage2D() path. Note: this is a candidate for the stable branches Signed-off-by: Alan Hourihane <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: implement TexImage*MultisampleChris Forbes2013-03-021-4/+163
| | | | | | | | | | | | | | | | V2: - fix formatting issues - generate GL_OUT_OF_MEMORY if teximage cannot be allocated - fix for state moving from texobj to image V3: - remove ridiculous stencil hack - alter format check to not allow a base format of STENCIL_INDEX - allow width/height/depth to be zero, to deallocate the texture - dont forget to call _mesa_update_fbo_texture V4: - fix indentation - don't throw errors on proxy texture targets Signed-off-by: Chris Forbes <[email protected]>
* mesa: add texobj support for ARB_texture_multisampleChris Forbes2013-03-021-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the new texture targets, and per-image state for GL_TEXTURE_SAMPLES and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS. V2: - Allow multisample texture targets in glInvalidateTexSubImage too. This was already partly there, but I missed it the first time around since the interaction is defined in a newer extension. Fixed weird indentation. - Allow multisample array textures in glFramebufferTextureLayer. This was overlooked as the tests originally only used 2d multisample textures. V3: - Set min/mag filters sensibly for multisample textures. This can't actually be changed by the user, so it's more sensible to initialize it correctly than to hack around it being bogus later. V4: - Tidy up initial min/mag filter setup. Setup in _mesa_initialize_texture_object was bogus, but benign since finish_texture_init() clobbered everything with correct values. For V4, just do the setup in finish_texture_init(). V5: - Don't break glPopAttrib(GL_TEXTURE_BIT) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: add ARB_texture_multisampleChris Forbes2013-03-021-0/+21
| | | | | | | | | | | | | | | | | | | | Adds new enums, dispatch machinery, and stubs for the 4 new entrypoints. V2: - Drop placeholder - Align enum values - Remove explicit exec=mesa; it *is* the dispatch flavor we want, but it's also the default. I misunderstood how this worked before; after actually reading the generator it makes good sense. V3: - Squash in stubs for new entrypoints, and dispatch_sanity tweaks, so we don't get build breakage between those patches. V4: - Fix various remaining whitespace issues Signed-off-by: Chris Forbes <[email protected]> [1/3 V2] Reviewed-by: Matt Turner <[email protected]> [V3] Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/es: NULL check in EGLImageTargetTexture2DOESTapani Pälli2013-02-251-0/+6
| | | | | | | | | check that pointer passed is valid and return error if not. Note: This is a candidate for the stable branches. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* CopyTexImage: Don't check sRGB vs LINEAR for desktop GLJordan Justen2013-02-121-18/+10
| | | | | | | | | | | | | | In OpenGL 4.3, new language was added that would require this check. But, if this check results in broken applications then perhaps it will be reversed. For now, remove this check and re-evaluate when desktop GL 4.3 is closer. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: fixup inconsistent naming of RG16 formatsMarek Olšák2013-02-061-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use format chooser code for glCompressedTexImageBrian Paul2013-02-041-2/+12
| | | | | | | | | | When glCompressedTexImage is called the internalFormat is a specific format for the incoming image and the the hardware format should be the same (since we never do format transcoding). So use the simpler _mesa_glenum_to_compressed_format() function. This change is also needed for the next patch. Note: This is a candidate for the stable branches.
* mesa: implement GL_ARB_texture_buffer_rangeChristoph Bumiller2013-01-301-17/+72
| | | | | | | | | | | | | | | | | | | | | | | v2: Record texObj.BufferSize as -1 in TexBuffer(non-Range) instead of the buffer's current size so we know we always have to use the full size of the buffer object (i.e. even if it changes without the user calling TexBuffer again) for the texture. Clarify invalid offset alignment error message. v3: Use extra GL_CORE-only section in get_hash_params.py for TEXTURE_BUFFER_OFFSET_ALIGNMENT. v4: Remove unnecessary check for profile in _mesa_TexBufferRange. Add check for extension enable in get_tex_level_parameter_buffer. v5: Fix position in gl_API.xml. Add comment about meaning of BufferSize == -1. v6: Add back checks for core profile and add a note about it. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Like EXT_texture_compression_dxt1, advertise ↵Ian Romanick2013-01-231-13/+3
| | | | | | | | | | | | | | | ANGLE_texture_compression_dxt in all APIs This is technically outside the ANGLE spec, but it seems unlikely to cause any harm. v2: Simplify the extension checks by assuming the ANGLE extension will always be enabled by any driver that enables the EXT. Suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
* mesa: Use a single flag for the S3TC extensions that don't require on-line ↵Ian Romanick2013-01-231-1/+2
| | | | | | | | compression Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-7/+7
| | | | | | | | | | | 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]>
* copyteximage: update error checking for GLES3Jordan Justen2013-01-201-1/+36
| | | | | | | Changes based on GTF/gles3 conformance test suite. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* copyteximage: check that sRGB usage is valid for GLES3 / GLJordan Justen2013-01-201-0/+39
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* mesa/es2: Allow depth component cube maps in ES2 if the extension is enabledIan Romanick2013-01-201-1/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_typeIan Romanick2013-01-171-2/+1
| | | | | | | | | | Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already done in texture_error_check because these combinations aren't allowed on desktop GL either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Don't allow DEPTH_STENCIL for 3D texturesIan Romanick2013-01-171-1/+2
| | | | | | | | Just like DEPTH_COMPONENT. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* copyteximage: Use Driver's AllocTextureImageBuffer instead of TexImageJordan Justen2013-01-141-3/+1
| | | | | | | | | | | | | | | Call Driver.AllocTextureImageBuffer rather than calling Driver.TexImage with NULL data, format=GL_NONE and type=GL_NONE. This avoids setting ctx->Unpack, which can lead to incorrectly trying to upload data. The GLES3 GTF program's packed_pixels_pbo test was triggering an error for i965 with the previous code. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* copyteximage: update signed vs. unsigned format matchingJordan Justen2013-01-141-7/+25
| | | | | | | | Fixes issues with gles3-gtf Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* teximage: use _mesa_es3_error_check_format_and_type for GLES3Matt Turner2013-01-141-6/+13
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Use _mesa_lookup_enum_by_nr in tex*_error_checkMatt Turner2013-01-111-6/+9
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement compressed 2D array textures.Paul Berry2013-01-021-5/+11
| | | | | | | | | | | | | This patch adds functionality to Mesa to upload compressed 2-dimensional array textures, using the glCompressedTexImage3D and glCompressedTexSubImage3D calls. Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES 3.0/ext_texture_array-compressed_gles3 *". Also partially fixes GLES3 conformance test "CoverageES30.test". Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: add support for ARB_texture_buffer_object_rgb32Dave Airlie2012-12-161-0/+13
| | | | | | | | | | This adds the extensions + the tex buffer support for checking the formats. There is a piglit test enhancement sent to that list. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: don't advertise ARB_texture_buffer_object in legacy contextsMarek Olšák2012-12-121-8/+7
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add new MESA_FORMATs for ETC2 compressed texturesAnuj Phogat2012-12-071-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.