summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: don't call TexImage driver hooks for zero-sized imagesBrian Paul2012-10-041-7/+9
| | | | | | | This simply avoids some failed assertions but there's no reason to call the driver hooks for storing a tex image if its size is zero. Note: This is a candidate for the stable branches.
* mesa: remove bogus compressed texture size checksBrian Paul2012-10-021-22/+0
| | | | | | | | | | | | | | A compressed texture image size doesn't have to be a multiple of the compressed block size (only sub-images do). Fixes issues when building compressed mipmaps because we often wind up with non-block-size images for the higher mipmap levels. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=55445 Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Sven Arvidsson <[email protected]>
* intel: add support for ANGLE_texture_compression_dxt.Oliver McFadden2012-10-011-0/+12
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: move _mesa_es_error_check_format_and_type() to glformats.cBrian Paul2012-09-261-65/+0
| | | | | | Where the non-ES _mesa_error_check_format_and_type() function lives. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move GL_HALF_FLOAT_OES definition to glheader.hBrian Paul2012-09-261-6/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: minor fix to glTexSubImage error messageBrian Paul2012-09-261-1/+2
|
* mesa: consolidate sub-texture error checking codeBrian Paul2012-09-261-168/+94
| | | | | | Do all error checking of glTexSubImage, glCopyTexSubImage and glCompressedTexSubImage's xoffset, yoffset, zoffset, width, height, and depth params in one place.
* mesa: consolidate glTexSubImage() error checkingBrian Paul2012-09-261-40/+38
|
* mesa: consolidate glCompressedTexSubImage() error checkingBrian Paul2012-09-261-77/+88
| | | | | Do all the checking in one function instead of two and fix up some of the error checking.alignment check
* mesa: consolidate subtexture xoffset/yoffset/width/height error checking codeBrian Paul2012-09-261-88/+73
| | | | | This is the code that checks if a subtexture region is aligned to the compressed format's block size.
* mesa: consolidate glCopyTexSubImage error checkingBrian Paul2012-09-261-79/+60
| | | | Do all the checking in one function instead of two.
* mesa: fix incorrect error for glCompressedSubTexImageBrian Paul2012-09-261-3/+3
| | | | | | | | | If a subtexture region isn't aligned to the compressed block size, return GL_INVALID_OPERATION, not gl_INVALID_VALUE. NOTE: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't override S3TC internalFormat if data is pre-compressed.Kenneth Graunke2012-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 42723d88d intended to override an S3TC internalFormat to a generic compressed format when the application requested online compression of uncompressed data. Unfortunately, it also broke pre-compressed textures when libtxc_dxtn isn't installed but the extensions are forced on. Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which calls _mesa_choose_texture_format(), hitting this override code. If we have actual S3TC source data, we can't treat it as any other format, and need to avoid the override. Since glCompressedTexImage2D() passes in a format of GL_NONE (which is illegal for glTexImage), we can use that to detect the pre-compressed case and avoid the overrides. Fixes a regression since 42723d88d370a7599398cc1c2349aeb951ba1c57. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-and-tested-by: Jordan Justen <[email protected]>
* Revert "mesa: consolidate subtexture x/y/width/height error checking code"Brian Paul2012-09-191-73/+84
| | | | | | This reverts commit 5b807400a87d5efefc481017eb420b772933e1da. accidentally pushed.
* Revert "more comment"Brian Paul2012-09-191-2/+4
| | | | | | This reverts commit 5205db6a7ce623a7fca72e6dc6391bd12be3f6aa. accidentally pushed
* Revert "mesa: clean-up and fix glCompressedTexSubImage error checking"Brian Paul2012-09-191-81/+64
| | | | | | This reverts commit 0c67fe5d2dc6d8066fc23c39184d9614abf63992. accidentally pushed.
* mesa: clean-up and fix glCompressedTexSubImage error checkingBrian Paul2012-09-191-64/+81
|
* more commentBrian Paul2012-09-191-4/+2
|
* mesa: consolidate subtexture x/y/width/height error checking codeBrian Paul2012-09-191-84/+73
| | | | | This is the code that checks if a subtexure region is aligned to the compressed format's block size.
* mesa: take cube faces into account in _mesa_test_proxy_teximage()Brian Paul2012-09-171-0/+1
| | | | | There will always be six cube faces so take that into consideration when computing the texture size and comparing against the limit.
* mesa: rework texture size error checkingBrian Paul2012-09-171-207/+142
| | | | | | | | | | | | | | | | | | | | | | There are two aspects to texture image size checking: 1. Are the width, height, depth legal values (not negative, not larger than the max size for the mipmap level, etc)? 2. Is the texture just too large to handle? For example, we might not be able to really allocate memory for a 3D texture of maxSize x maxSize x maxSize. Previously, we did (1) via the ctx->Driver.TestProxyTextureImage() hook but those tests are really device-independent. Now we do (2) via that hook since the max texture memory and texture shape are device-dependent. Also, (1) is now done outside the general texture parameter error checking functions because of the special interaction with proxy textures. The recently introduced PROXY_ERROR token is removed. The teximage() and copyteximage() functions are bit simpler now (less if-then nesting, etc.) Reviewed-by: Jose Fonseca <[email protected]>
* mesa: refactor _mesa_test_proxy_teximage() codeBrian Paul2012-09-171-30/+51
| | | | | | | Basically, move the body into a new _mesa_legal_texture_dimensions() function. More refactoring to come. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: move glTexImage 'level' error checkingBrian Paul2012-09-171-22/+10
| | | | | | | Move level checking out of _mesa_test_proxy_teximage() and into the other error-checking functions. Reviewed-by: Jose Fonseca <[email protected]>
* Temporarily revert "mesa: remove remaining FEATURE_* defines where protected ↵José Fonseca2012-09-151-1/+5
| | | | | | | | by API check." This reverts commit 9f37b405a3de8668a5f74c9681829688475ac3b7. Fixes windows builds.
* mesa: remove remaining FEATURE_* defines where protected by API check.Oliver McFadden2012-09-151-5/+1
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_texture_sRGB define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_OES_EGL_image define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: make _mesa_get_proxy_target() non-staticBrian Paul2012-09-111-6/+6
| | | | | | Needed for the next patch. Note: This is a candidate for the stable branches.
* mesa: fix per-level max texture size error checkingBrian Paul2012-09-051-15/+21
| | | | | | | | | | | | | This is a long-standing omission in Mesa's texture image size checking. We need to take the mipmap level into consideration when checking if the width, height and depth are too large. Fixes the new piglit max-texture-size-level test. Thanks to Stéphane Marchesin for finding this problem. Note: This is a candidate for the stable branches. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: s/MALLOC/malloc/Brian Paul2012-09-011-1/+1
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Do something sensible when on-line compression is requested but not ↵Ian Romanick2012-08-291-0/+31
| | | | | | | | | | | | | | | | | | | | | possible It is possible to force S3TC extensions to be enabled. This is generally done to support applications that will only supply pre-compressed textures. This accounts for the vast majority of applications. However, there is still the possibility of an application asking for on-line compression. In that case, generate a warning and substitute a generic compressed format. The driver will either pick an uncompressed format or a compressed format that Mesa can handle on-line (e.g., FXT1). This should only cause problems for applications that request on-line compression and read the compressed texture back. This is likely an infinitesimal subset of an already infinitesimal subset. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Disallow alpha, luminance, and LA textures in core contextIan Romanick2012-08-291-4/+6
| | | | | | Also disallow the 1, 2, 3, and 4 formats. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Expose texture buffer objects when the context is GL 3.1 core.Eric Anholt2012-08-291-5/+7
| | | | | | | | | | | v2: Use API_OPENGL_CORE. v3: Only require desktop GL. If a driver can't support TexBOs in a non-core context, it should not enable them. Signed-off-by: Eric Anholt <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add texture target field to ChooseTextureFormat() driver hookBrian Paul2012-08-241-2/+3
| | | | | | | | | This will let us choose the actual hardware format depending on the type of texture. v2: fixup radeon, nouveau, intel and swrast drivers too Reviewed-by: Eric Anholt <[email protected]>
* main: fix ES compile breakageBrian Paul2012-08-241-1/+1
|
* mesa: code movement in teximage.cBrian Paul2012-08-241-204/+198
| | | | To get rid of a forward declaration.
* mesa: consolidate glTexImage and glCompressedTexImage codeBrian Paul2012-08-241-203/+138
| | | | | | There was a lot of similar or duplicated code before. To minimize this patch's size, use a forward declaration for compressed_texture_error_check(). Move the function in the next patch.
* mesa: make glTexImage, glCompressedTexImage proxy code more alikeBrian Paul2012-08-241-35/+42
| | | | Next up, we can combine the teximage() and compressed_teximage() functions.
* mesa: rename texpal.[ch] to texcompress_cpal.[ch]Brian Paul2012-08-241-1/+1
| | | | To be consistent with other files related to texture compression.
* mesa: make _mesa_get_proxy_tex_image() staticBrian Paul2012-08-241-5/+8
| | | | It's not used by any other file.
* mesa: don't clear proxy image fields when regular GL error is generatedBrian Paul2012-08-241-11/+33
| | | | | | | | If a proxy texture call generates a regular GL error, we should not clear the proxy image's width/height/depth/format fields. Use a new PROXY_ERROR token to distinguish proxy errors from regular GL errors. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: fix glTexImage proxy texture error generationBrian Paul2012-08-241-52/+43
| | | | | | | | | | | | When calling glTexImage() with a proxy target most error conditions should generate a GL error. We were erroneously doing the proxy-error behaviour (where we zeroed-out the image's width/height/depth/format fields) in too many places. There's another issue with proxy textures, but that'll be fixed in the next patch. Reviewed-by: Anuj Phogat <[email protected]>
* mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather ↵Ian Romanick2012-08-231-0/+10
| | | | | | | | than the ES wrapper Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ↵Ian Romanick2012-08-231-0/+18
| | | | | | | | | | ES wrapper v2: Add GLES3 filtering. I'm not 100% sure this is correct. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ↵Ian Romanick2012-08-231-0/+17
| | | | | | | | | | ES wrapper v2: Add proper GLES3 filtering. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code ↵Ian Romanick2012-08-231-0/+94
| | | | | | | | | | | | | rather than the ES wrapper v2: Add proper GLES3 filtering. v3: Collapse ALPHA, LUMINANCE, and LUMINANCE_ALPHA cases per review comment from Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapperIan Romanick2012-08-231-2/+4
| | | | | | | | | | | Also validate glCopyTexImage border. This fixes a bug in the APIspec. Previously glTexImage3DOES could be passed a non-zero border without error. NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Generate an error when glCopyTexImage border is invalidIan Romanick2012-08-231-0/+2
| | | | | | | | NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate tex image targets in Mesa code rather than the ES wrapperIan Romanick2012-08-231-14/+29
| | | | | | | | | | | | | | This should take care of all the TexImage, TexSubImage, CopyTexImage, CompressedTexImage3DOES, and CopyTexSubImage type paths. v2: Add proper core-profile and GLES3 filtering. v3: Squash the CompressedTexImage3DOES patch per review comment from Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than ↵Ian Romanick2012-08-231-5/+15
| | | | | | | | the ES wrapper Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>