summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: move _mesa_es_error_check_format_and_type() to glformats.cBrian Paul2012-09-265-69/+73
| | | | | | 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-263-11/+7
| | | | 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]>
* gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.Paul Berry2012-09-252-2/+9
| | | | | | | | | | | | | | | | GLES 3 supports sRGB functionality, but it does not expose the GL_FRAMEBUFFER_SRGB enable/disable bit. Instead the implementation is expected to behave as though that bit is always enabled. This patch ensures that ctx->Color.sRGBEnabled (the internal variable tracking GL_FRAMEBUFFER_SRGB) is initially true in GLES 2/3 contexts, and that it cannot be modified through the GLES 3 API. This is safe for GLES 2, since ctx->Color.sRGBEnabled has no effect on non-sRGB formats, and GLES 2 doesn't support any sRGB formats. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* enable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.Paul Berry2012-09-252-3/+22
| | | | | | | | | | | | | | | GLES3 supports sRGB formats, but it does not support the GL_FRAMEBUFFER_SRGB enable/disable flag (instead it behaves as if this flag is always enabled). Therefore, meta ops that need to disable GL_FRAMEBUFFER_SRGB will need a backdoor mechanism to do so when the API is GLES3. We were already doing a similar thing for GL_MULTISAMPLE, which has the same constraints. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove 'struct' from texenv_fragment_programBrian Paul2012-09-251-13/+13
| | | | | | texenv_fragment_program is declared as a class. Fixes warnings with MSVC. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add signbit() macroBrian Paul2012-09-241-0/+7
| | | | Reviewed-by: Matt Turner <[email protected]>
* Use signbit() in IS_NEGATIVE and DIFFERENT_SIGNSMatt Turner2012-09-241-19/+2
| | | | | | | | | | signbit() appears to be available everywhere (even MSVC according to MSDN), so let's use it instead of open-coding some messy and confusing bit twiddling macros. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54805 Reviewed-by: Paul Berry <[email protected]> Suggested-by: Ian Romanick <[email protected]>
* mesa: Silence narrowing warnings in ff_fragment_shader's emit_texenv().Kenneth Graunke2012-09-231-4/+4
| | | | | | | | | | | | | Recent version of GCC report a warning for the implicit conversion from int to float: ff_fragment_shader.cpp:897:3: warning: narrowing conversion of '(1 << ((int)rgb_shift))' from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing] This is because floats cannot precisely represent all possible 32-bit integer values. However, texenv code is all expected to be floating point, so this should not be a problem. Signed-off-by: Kenneth Graunke <[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]>
* mesa: Ignore SRGB when determining compatible resolve formats.Kenneth Graunke2012-09-201-1/+2
| | | | | | | | | | | | | | | MSAA resolves and other blit-like operations ignore SRGB state anyway, so we should be able to safely allow resolves between compatible SRGB/linear formats like SRGBA8 and RGBA8888. This matches the behavior of the nVidia and AMD binary drivers. Fixes completely black rendering when using multisampling in L4D2. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXTIan Romanick2012-09-201-0/+12
| | | | | | | | | This was already (correctly) supported for glGetSamplerParameter paths. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[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: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces()Brian Paul2012-09-171-1/+7
|
* mesa: move/fix levels check for glTexStorage()Brian Paul2012-09-171-8/+8
| | | | | | Fix copy&paste error and move min levels check closer to max levels check. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: rewrite glTexStorage() codeBrian Paul2012-09-171-74/+79
| | | | | | | | Simplify the code and make it more like the other glTexImage commands. Call _mesa_legal_texture_dimensions() to validate width, height, depth. Call ctx->Driver.TestProxyTexImage() to make sure texture is not too large. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: rework texture size error checkingBrian Paul2012-09-174-225/+161
| | | | | | | | | | | | | | | | | | | | | | 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-172-30/+56
| | | | | | | 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]>
* mesa: change create_version_string() return type to voidBrian Paul2012-09-171-1/+1
| | | | Fixes "warning: no return statement in function returning non-void"
* glsl: make _mesa_builtin_uniform_desc staticDave Airlie2012-09-181-2/+0
| | | | | | | I can't see any reason this is global (unless for debugging) Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* main/version: consolodate version string creation for ES/Desktop GLJordan Justen2012-09-171-34/+24
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLsTomeu Vizoso2012-09-161-5/+5
| | | | | | | instead of just for GL and ES1. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix dropped && in glGetStringi()Chris Forbes2012-09-161-1/+1
| | | | | | | | | | This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously, all extension names returned would be NULL. NOTE: This is a candidate for release branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Temporarily revert "mesa: remove remaining FEATURE_* defines where protected ↵José Fonseca2012-09-158-2/+27
| | | | | | | | by API check." This reverts commit 9f37b405a3de8668a5f74c9681829688475ac3b7. Fixes windows builds.
* mesa: remove FEATURE_ES test in texcompress_cpal.cBrian Paul2012-09-151-4/+0
| | | | Fixes a regression after removing the #if FEATURE_x tests.
* mesa: remove never-defined FEATURE_histogram conditional.Oliver McFadden2012-09-152-15/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove remaining FEATURE_* defines where protected by API check.Oliver McFadden2012-09-158-27/+2
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove obsolete comments from mfeatures.hOliver McFadden2012-09-151-27/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ATI_fragment_shader define.Oliver McFadden2012-09-157-50/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_APPLE_object_purgeable define.Oliver McFadden2012-09-156-12/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_transform_feedback define.Oliver McFadden2012-09-1512-101/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_texture_sRGB define.Oliver McFadden2012-09-159-35/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_framebuffer_blit define.Oliver McFadden2012-09-155-21/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_sync define.Oliver McFadden2012-09-155-51/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_sampler_objects define.Oliver McFadden2012-09-154-15/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_pixel_buffer_object define.Oliver McFadden2012-09-152-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_map_buffer_range define.Oliver McFadden2012-09-153-5/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>