summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/tests: Sanity check the ES2 dispatch tableIan Romanick2012-09-283-1/+313
| | | | | | | | | | | | | | | | | | | | | This test is only built when shared-glapi is used. Because of changes elsewhere in the tree that were necessary to make shared-glapi work correct with GLX, it's not feasible to make the test function both ways. The list of expected functions originally came from the functions set by api_exec_es2.c. This file no longer exists in Mesa (but api_exec_es1.c is still generated). It was the generated file that configured the dispatch table for ES2 contexts. This test verifies that all of the functions set by the old api_exec_es2.c (with the recent addition of VAO functions) are set in the dispatch table and everything else is a NOP. When adding ES2 (or ES3) extensions that add new functions, this test will need to be modified to expect dispatch functions for the new extension functions. v2: Expect VAO functions be non-NOP. Signed-off-by: Ian Romanick <[email protected]>
* mesa/main: Make no-op dispatch function publicIan Romanick2012-09-282-3/+5
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa/tests: Move stub function to a separate fileIan Romanick2012-09-283-13/+49
| | | | | | | When building with shared-glapi, we can just use Mesa's _mesa_warning without problems. stubs.cpp is only used when shared-glapi is not used. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Don't set uniform dispatch pointers for many things in ES2 or coreIan Romanick2012-09-283-36/+39
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set shaderapi dispatch pointers for many things in ES2 or coreIan Romanick2012-09-284-22/+35
| | | | | | | | | | | | v2: Allow GL_ARB_shader_objects functions in core profile because we still expose the extension string there. Don't allow glBindFragDataLocation in GLES3 because it's not part of that API. Based (mostly) on review comments from Eric Anholt. NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or coreIan Romanick2012-09-281-53/+73
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set loopback dispatch pointers for most things in ES2 or coreIan Romanick2012-09-284-219/+228
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Pass GL context to _mesa_create_save_tableIan Romanick2012-09-283-3/+3
| | | | | | | | | | | This isn't used by this patch, but it will be necessary for several follow-on patches. Separating this out will make it easier to reorder patches later. NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glTexStorage in ES2Ian Romanick2012-09-281-4/+6
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glGetProgramivARB in ES2Ian Romanick2012-09-281-1/+1
| | | | | | | | | This function is not the same as glGetProgramiv. NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2Ian Romanick2012-09-281-1/+3
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2Ian Romanick2012-09-281-4/+8
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2Ian Romanick2012-09-281-2/+8
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glGetBufferSubData in ES2Ian Romanick2012-09-281-1/+3
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glGetDoublev in ES2Ian Romanick2012-09-281-1/+3
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't set dispatch pointer for glPointSize in ES2Ian Romanick2012-09-281-3/+1
| | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Set dispatch pointer for glShaderBinaryIan Romanick2012-09-281-0/+1
| | | | | | | NOTE: This is a candiate for stable branches Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix typo in error message.Vinson Lee2012-09-271-1/+1
| | | | Signed-off-by: Vinson Lee <[email protected]>
* 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"