summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Remove the generated glapi from source control, and just build it.Eric Anholt2012-05-294-25414/+3
| | | | | | | | | | | Mesa already always depends on python to build. The checked in changes are not reviewed (because any trivial change rewrites the world). We also have been pushing commits between xml change and regen where at-build-time xml-generated code disagrees with committed xml-generated code. And worst of all, sometimes we ("I") check in *stale* xml-generated code. Acked-by: Ian Romanick <[email protected]>
* mesa: Remove the OES_draw_texture extension from ES2.Kenneth Graunke2012-05-231-1/+1
| | | | | | | | | This extension appears to be written against ES 1.0. In ES 2.0, you really want to be using FBOs instead. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Use initializers to configure samplersIan Romanick2012-05-231-32/+9
| | | | | | | | | Now that the linker handles initializers of samplers just like any other uniform, a bunch of this annoying code is unnecessary. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Initialize samplers to 0, propagate sampler values to the gl_programIan Romanick2012-05-231-0/+1
| | | | | | | | | | | | | The spec requires that samplers be initialized to 0. Since this differs from the 1-to-1 mapping of samplers to texture units assumed by ARB assembly shaders (and the gl_program structure), be sure to propagate this date from the gl_shader_program to the gl_program. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> CC: Vadim Girlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
* mesa: Keep a computed value for dual source blend func with each buffer.Eric Anholt2012-05-233-17/+32
| | | | | | | | | The i965 driver needed this as well for hardware setup, so instead of duplicating the logic, just save it off. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: use F_TO_I() instead of IROUND()Brian Paul2012-05-193-120/+120
| | | | | | | | Use it where performance matters more and the exact method of float->int conversion/rounding isn't terribly important. There should no net change here since F_TO_I() is the new name of the old IROUND() function. Reviewed-by: José Fonseca <[email protected]>
* mesa: reimplement IROUND(), add F_TO_I()Brian Paul2012-05-191-21/+36
| | | | | | | | | | | | | | The different implementations of IROUND() behaved differently and in the case of fistp, depended on the current x86 FPU rounding mode. This caused some tests like piglit roundmode-pixelstore and roundmode-getintegerv to fail on 32-bit x86 but pass on 64-bit x86. Now IROUND() always rounds to the nearest integer (away from zero). The new F_TO_I function converts a float to an int by whatever means is fastest. We'll use this where we're more concerned with performance and not too worried to how the conversion is done. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix Z32_FLOAT -> uint conversion functionsBrian Paul2012-05-191-2/+2
| | | | | | | | The IROUND converted all arguments to 0 or 1. That's not what we wanted. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: add GLSL_REPORT_ERRORS debug flagBrian Paul2012-05-192-0/+15
| | | | | | | If the MESA_GLSL env var contains "errors", GLSL compilation and link errors will be reported to stderr. Reviewed-by: Ian Romanick <[email protected]>
* mesa: add some comments on shaderapi.c functionsBrian Paul2012-05-191-1/+14
|
* mesa: Remove undefinition of _P symbol.Vinson Lee2012-05-181-6/+0
| | | | | | | IRIX isn't used anymore. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add PrimitiveRestartInSoftware to gl_context.ConstJordan Justen2012-05-172-0/+8
| | | | | | | | | | | If set, then the VBO module will handle all primitive restart scenarios before calling the driver draw_prims. Software primitive restart support is disabled by default. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Check for framebuffer completeness before looking at the rb.Eric Anholt2012-05-171-6/+6
| | | | | | | | | Otherwise, an incomplete framebuffer could have a NULL _ColorReadBuffer and we'd deref that. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix assertion failure when a cube face is not present.Eric Anholt2012-05-171-1/+2
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Throw error on glGetActiveUniform inside Begin/End.Eric Anholt2012-05-171-0/+2
| | | | | | | | Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.Oliver McFadden2012-05-141-2/+10
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GLES specifies restrictions on uniform matrix transpose.Oliver McFadden2012-05-141-0/+10
| | | | | | | | | GL_INVALID_VALUE is generated if transpose is not GL_FALSE. http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flagsBrian Paul2012-05-114-24/+21
| | | | | | | Instead of having to hack the code to enable these debugging options, set them through the MESA_DEBUG env var. Reviewed-by: Eric Anholt <[email protected]>
* mesa: implement DEBUG_ALWAYS_FLUSH debug optionBrian Paul2012-05-111-0/+12
| | | | | | | | This flag has been around for a while but it wasn't actually used anywhere. Now, setting this flag causes a glFlush() to be issued after each drawing call (including glBegin/End, glDrawElements, glDrawArrays, glDrawPixels, glCopyPixels and glBitmap).
* mesa: define DEBUG_SILENT flag, use in output_if_debug()Brian Paul2012-05-113-12/+13
|
* mesa: clean-up the debug/verbose flag setup codeBrian Paul2012-05-111-26/+46
| | | | Split the verbose and debug flag setup code into separate functions.
* mesa: do FLUSH_VERTICES() in _mesa_flush/finish()Brian Paul2012-05-111-2/+4
| | | | | | | This was being done in the _mesa_Flush/Finish() calls but if there was an internal call to _mesa_flush/finish() the FLUSH_VERTICES() wouldn't happen. Looks like only the intel and radeon drivers made such calls in MakeCurrent().
* mesa: fix/add error check in _mesa_ColorMaterial()Brian Paul2012-05-111-0/+2
| | | | | | | _mesa_material_bitmask() will record a GL error and return 0 if face or mode are illegal. Return early in that case. NOTE: This is a candidate for the 8.0 branch.
* intel: Add extern "C" declarations to headersPaul Berry2012-05-101-0/+7
| | | | | | | | These declarations are necessary to allow C++ code to call C code without causing unresolved symbols (which would make the driver fail to load). Reviewed-by: Chad Versace <[email protected]>
* mesa: remove needless casts in save_EdgeFlag()Brian Paul2012-05-081-1/+1
|
* mesa: minor clean-ups in dlist material codeBrian Paul2012-05-081-7/+15
|
* mesa: fix error strings in dlist codeBrian Paul2012-05-081-4/+4
|
* mesa: add gl_context::NewDriverState and use it for vertex arraysMarek Olšák2012-05-082-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use the same flag to notify the driver. Since we've run out of bits in NewState and NewState is for core Mesa anyway, we need to find another way. This patch is the first to start decoupling the state flags meant only for core Mesa and those only for drivers. The idea is to have two flag sets: - gl_context::NewState - used by core Mesa only - gl_context::NewDriverState - used by drivers only (the flags are defined by the driver and opaque to core Mesa) It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module that the user changed vertex arrays, and the vbo module in turn sets a driver-specific flag to notify the driver that it should update its vertex array bindings. The driver decides which bits of NewDriverState should be set and stores them in gl_context::DriverFlags. Then, Core Mesa can do this: ctx->NewDriverState |= ctx->DriverFlags.NewArray; This patch implements this behavior and adapts st/mesa. DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS. Core Mesa only sets NewDriverState. It's the driver's responsibility to read it whenever it wants and reset it to 0. Reviewed-by: Brian Paul <[email protected]>
* mesa: move gl_client_array*[] from vbo_draw_func into gl_contextMarek Olšák2012-05-081-0/+5
| | | | | | | | | | | | | | | | | | In the future we'd like to treat vertex arrays as a state and not as a parameter to the draw function. This is the first step towards that goal. Part of the goal is to avoid array re-validation for every draw call. This commit adds: const struct gl_client_array **gl_context::Array::_DrawArrays. The pointer is changed in: * vbo_draw_method * vbo_rebase_prims - unused by gallium * vbo_split_prims - unused by gallium * st_RasterPos Reviewed-by: Brian Paul <[email protected]>
* fbo: Only reuse depth/stencil attachments if the parameters match.Paul Berry2012-05-071-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user attaches a texture to one of the depth/stencil attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we check to see if the same texture is also attached to the other attachment point, and if so, we re-use the existing texture attachment. This is necessary to ensure that if the user later queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not receive an error. If, however, the user attaches buffers to the two different attachment points using different parameters (e.g. a different miplevel), then we can't re-use the existing texture attachment, because it is pointing to the wrong part of the texture. This might occur as a transitory condition if, for example, if the user attached miplevel zero of a texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to it, and then later attempted to attach miplevel one of the same texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT. This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT use the same attachment parameters before attempting to share the texture attachment. On i965 Gen6, fixes piglit tests "texturing/depthstencil-render-miplevels 1024 depth_stencil_shared" and "texturing/depthstencil-render-miplevels 1024 stencil_depth_shared". Reviewed-by: Chad Versace <[email protected]>
* mesa: Add primitive restart support to glArrayElementJordan Justen2012-05-051-1/+9
| | | | | | | | | | When primitive restart is enabled, and glArrayElement is called with the restart index value, then call glPrimitiveRestartNV. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul<[email protected]>
* mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE.Eric Anholt2012-05-041-1/+1
|
* mesa: do more teximage error checking for generic compressed formatsBrian Paul2012-05-041-2/+30
| | | | | | | | | | | | When glTexImage or glCopyTexImage is called with internalFormat being a generic compressed format (like GL_COMPRESSED_RGB) we need to do the same error checks as for specific compressed formats. In particular, check if the texture target is compatible with the format. None of the texture compression formats we support so far work with GL_TEXTURE_1D, for example. See also https://bugs.freedesktop.org/show_bug.cgi?id=49124 NOTE: This is a candidate for the 8.0 branch.
* mesa: add _mesa_shader_debug()Dylan Noblesmith2012-05-022-0/+46
| | | | | | | | | This should be the one entrypoint libglsl needs for GL_ARB_debug_output. v2: added comments. Reviewed-by: Brian Paul <[email protected]>
* mesa: reject immutable textures in glEGLImageTargetTexture2DOES()Dylan Noblesmith2012-04-301-0/+7
| | | | | | | | | | | | | | | | | | GL_ARB_texture_storage says: The commands eglBindTexImage, wglBindTexImageARB, glXBindTexImageEXT or EGLImageTargetTexture2DOES are not permitted on an immutable-format texture. They will generate the following errors: - EGLImageTargetTexture2DOES: INVALID_OPERATION - eglBindTexImage: EGL_BAD_MATCH - wglBindTexImage: ERROR_INVALID_OPERATION - glXBindTexImageEXT: BadMatch Fixing the EGL and GLX cases requires extending the DRI interface, since setTexBuffer2 doesn't currently return any error information. Reviewed-by: Brian Paul <[email protected]>
* mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0Dylan Noblesmith2012-04-291-0/+1
| | | | | | | | | As noted in commit be4e46b21a60cfdc826bf89d1078df54966115b1, this was missing before. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move gl_array_attrib::NewState to gl_array_object::NewArraysBrian Paul2012-04-206-18/+10
| | | | | | | | The field wasn't actually used before and it's not used now either. But this is a more logical place for it and will hopefully allow doing smarter draw/array validation (per array object) in the future. Reviewed-by: Mathias Fröhlich <[email protected]>
* Revert "mesa: only update _MaxElement when we actually need it"Marek Olšák2012-04-191-3/+1
| | | | | | | This reverts commit 0de5a21470b3bff9b7c8714e5d960d5ed9d01b9c. I was wrong, we use it in the vbo module too. This fixes a performance regression in Nexuiz.
* mesa: move unrefs of array objects earlier in _mesa_free_context_data()Brian Paul2012-04-191-3/+3
| | | | | | | | | | If a non-default array object was bound at context destruction time we'd try to unreference the array object after it was already deleted in _mesa_free_varray_data(). Now do the unref first. Fixes a regression from commit 86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b. Reviewed-by: José Fonseca <[email protected]>
* mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & validMarek Olšák2012-04-191-1/+10
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputsMarek Olšák2012-04-193-6/+8
| | | | | | | | | This is a frequently-updated state and _NEW_ARRAY already causes revalidation of the vbo module. It's kinda counter-productive to recompute arrays in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa,vbo: properly detect when vertex arrays need to be recalculatedMarek Olšák2012-04-193-6/+0
| | | | | | | | | | | | | | | | | | | This moves the RebindArrays flag into the vbo module, consolidates the code, and adds missing vbo_draw_method calls. Also with this change, the vertex arrays are not needlessly recalculated twice. The issue with the old code was: - If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set. - _mesa_update_state is called and the vp_varying_inputs change causes regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM. - The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets the recalculate_inputs flag to TRUE again. - The new code sets the flag to FALSE after the second _mesa_update_state, because there can't possibly be any change which would require recalculating the arrays. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: only update _MaxElement when we actually need itMarek Olšák2012-04-191-1/+3
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: Use array object constructor.Mathias Fröhlich2012-04-182-2/+3
| | | | | | | | This change uses the array object factory for gl_array_objects. This prevents crashes when deriving from gl_array_object. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()Brian Paul2012-04-171-7/+55
| | | | | | | | | | | | Accelerates a few glReadPixels cases for WebGL. See https://bugs.freedesktop.org/show_bug.cgi?id=48545 v2: Per Jose, use bit twiddling for the swizzle case instead of ubyte arrays (it's about 44% faster). Note: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: Remove dead _mesa_sizeof_glsl_type().Eric Anholt2012-04-162-63/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add a helper for generating temporary variables in ir_builder.Eric Anholt2012-04-131-31/+11
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add a helper for ir_builder to make dereferences for assignments.Eric Anholt2012-04-131-49/+17
| | | | | | v2: Fix writemask setup for non-vec4 assignments. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Make a little tracking class for emitting IR lists.Eric Anholt2012-04-131-50/+28
| | | | | | | This lets us significantly shorten p->instructions->push_tail(ir), and will be used in a few more places. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add common swizzles to ir_builder.Eric Anholt2012-04-131-48/+18
| | | | | | | | | | Now we can fold a bunch of our expression setup in ff_fragment_shader into single-line, parseable commits. v2: Make it actually work. I wasn't setting num_components in the mask structure, and not setting up a mask structure is way easier. Reviewed-by: Kenneth Graunke <[email protected]>