aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/transformfeedback.c
Commit message (Collapse)AuthorAgeFilesLines
* 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,i965: use NewDriverState to communicate TFB state changes with the driverMarek Olšák2013-04-241-6/+14
| | | | | | | | | | | | | | | | | | | | | | | _NEW_TRANSFORM_FEEDBACK is not used by core Mesa, so it can be removed. Instead, an new private flag is added to i965 to serve the same purpose. If you're new to this: * When creating a context. you can set private dirty flags in gl_context::DriverFlags, eg.: ctx->DriverFlags.NewStateX = BRW_NEW_STATE_X; * When StateX is changed, core Mesa does: ctx->NewDriverState |= ctx->DriverFlags.NewStateX; * When you have to draw, read and clear ctx->NewDriverState. * Pros: not touching NewState, the driver decides the mapping between GL states and hw state groups, unlimited number of flags in core Mesa (still limited number of flags in the driver though) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[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: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-4/+0
| | | | | | | | | | | 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]>
* Make IsTransformFeedback() return false before BindTransformFeedback()Matt Turner2012-12-211-3/+10
| | | | | | | | | | | | | | The GL 4.3 an ES 3.0 specs say A transform feedback object is created by binding a name returned by GenTransformFeedbacks with the command void BindTransformFeedback( enum target, uint id ); Fixes arb_transform_feedback2-istransformfeedback and part of es3conform's CoverageES30.test. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make a function is_transform_feedback_active_and_unpaused.Paul Berry2012-12-181-3/+2
| | | | | | | | | | The rather unweildy logic for determining this condition was repeated in a large number of places. This patch consolidates it to a single inline function. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix corner cases of BindBufferBase with transform feedback.Paul Berry2012-12-181-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the following behaviours, which are mandated by the GL 4.3 and GLES3 specs. 1. Regarding the GL_TRANSFORM_FEEDBACK_BUFFER_SIZE query: "If the ... size was not specified when the buffer object was bound (e.g. if it was bound with BindBufferBase), ... zero is returned." (GL 4.3 section 6.7.1 "Indexed Buffer Object Limits and Binding Queries"). 2. "BindBufferBase binds the entire buffer, even when the size of the buffer is changed after the binding is established. It is equivalent to calling BindBufferRange with offset zero, while size is determined by the size of the bound buffer at the time the binding is used." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). I interpret "at the time the binding is used" to mean "at the time of the call to glBeginTransformFeedback". 3. "Regardless of the size specified with BindBufferRange, or indirectly with BindBufferBase, the GL will never read or write beyond the end of a bound buffer. In some cases this constraint may result in visibly different behavior when a buffer overflow would otherwise result, such as described for transform feedback operations in section 13.2.2." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). Item 1 has been part of the spec all the way back to the inception of the EXT_transform_feedback extension. Items 2 and 3 were added in GL 4.2 and GLES 3. Prior to GL 4.2, in place of items 2 and 3, the spec simply said "BindBufferBase is equivalent to calling BindBufferRange with offset zero and size equal to the size of buffer." For transform feedback, Mesa behaved as though this meant "...equal to the size of buffer at the time of the call to BindBufferBase". However, this was problematic because it left it ambiguous what to do if the buffer is shrunk between the call to BindBuffer{Base,Range} and the call to BeginTransformFeedback. Prior to this patch, Mesa's behaviour was to try to write beyond the end of the buffer, likely resulting in memory corruption. In light of this, I'm interpreting the spec change as a clarification, not an intended behavioural change, so I'm making the change apply regardless of API version. Fixes GLES3 conformance test transform_feedback2_pause_resume.test. Reviewed-by: Jordan Justen <[email protected]>
* mesa/gles3: Generate error on draw call if transform feedback would overflow.Paul Berry2012-12-181-1/+18
| | | | | | | | | | | | | | | | | In desktop GL, if a draw call would cause transform feedback buffers to overflow, the draw call should succeed, and the extra primitives should simply not be recorded in the transform feedback buffers. In GLES3, however, if a draw call would cause transform feedback buffers to overflow, the draw call is supposed to produce an INVALID_OPERATION error and no drawing should occur. This patch implements the GLES3-required behaviour. Fixes GLES3 conformance test "transform_feedback_overflow.test". Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: refactor _mesa_compute_max_transform_feedback_vertices from i965.Paul Berry2012-12-181-0/+29
| | | | | | | | | | | | | | | | | Previously, the i965 driver contained code to compute the maximum number of vertices that could be written without overflowing any transform feedback buffers. This code wasn't driver-specific, and for GLES3 support we're going to need to use it in core mesa. So this patch moves the code into a core mesa function, _mesa_compute_max_transform_feedback_vertices(). Reviewed-by: Ian Romanick <[email protected]> v2: Eliminate C++-style variable declarations, since these won't work with MSVC. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use correct glGetTransformFeedbackVarying name in error msgMatt Turner2012-11-261-2/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix const correctness of API implementation functions.Paul Berry2012-11-121-1/+2
| | | | | | | | | | | | | | This patch changes the use of const in the type signatures of _mesa_ShaderSource() and _mesa_TransformFeedbackVaryings(), to match the type signatures in the GL spec. This avoids warnings when building the code-generated api_exec.c file. Note: previously we avoided the build warnings because these functions were being type-checked against ShaderSourceARB and TransformFeedbackVaryingsEXT; those functions are semantically equivalent, but have fewer const qualifiers in their type signatures. Acked-by: Brian Paul <[email protected]>
* dispatch: Delete unused init_dispatch functions.Paul Berry2012-11-061-22/+0
| | | | | | | | | | The new code-generated version of _mesa_create_exec_table() populates the entire dispatch table (except for dynamic functions) by itself; it no longer calls separate functions to initialize parts of the dispatch table. This patch removes those no-longer-needed functions. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: fix MSVC signed/unsigned warnings in transformfeedback.cBrian Paul2012-11-061-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.cBrian Paul2012-10-291-3/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* _mesa_create_exec_table: GLES3 fixes.Paul Berry2012-10-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets up the dispatch table for the following GLES3 functions when a GLES3 context is in use: - BeginQuery - BeginTransformFeedback - BindSampler - BindTransformFeedback - BlitFramebuffer - ClearBufferfi - ClearBufferfv - ClearBufferiv - ClearBufferuiv - ClientWaitSync - CopyBufferSubData - DeleteQueries - DeleteSamplers - DeleteSync - DeleteTransformFeedbacks - EndQuery - EndTransformFeedback - FenceSync - FramebufferTextureLayer - GenQueries - GenSamplers - GenTransformFeedbacks - GetInteger64v - GetQueryObjectuiv - GetQueryiv - GetSamplerParameterfv - GetSamplerParameteriv - GetStringi - GetSynciv - GetTransformFeedbackVarying - GetVertexAttribIiv - GetVertexAttribIuiv - IsQuery - IsSampler - IsSync - IsTransformFeedback - PauseTransformFeedback - RenderbufferStorageMultisample - ResumeTransformFeedback - SamplerParameterf - SamplerParameterfv - SamplerParameteri - SamplerParameteriv - TransformFeedbackVaryings - VertexAttribDivisor - VertexAttribIPointer - WaitSync And it avoids setting up the dispatch table for these non-GLES3 functions: - ColorMaski - GetBooleani_v - Enablei - Disablei - IsEnabledi - ClearColorIiEXT - ClearColorIuiEXT - TextureStorage2DEXT - TextureStorage3DEXT - GetActiveUniformName - GetnUniformdv - GetnUniformfv - GetnUniformiv - GetnUniformuiv Reviewed-by: Brian Paul <[email protected]> v2: Make the ctx argument to _mesa_init_transform_feedback_dispatch() a const pointer. Add a comment to remind us to add GetBufferParameteri64v once tests exist for it. Also add VertexAttribDivisor for GLES3, and remove GetActiveUniformName and GetnUniform{dv,fv,iv,uiv} for GLES3. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove FEATURE_EXT_transform_feedback define.Oliver McFadden2012-09-151-42/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* mesa: implement glGet queries and error handling for ARB_transform_feedback3Marek Olšák2012-07-121-0/+32
| | | | Acked-by: Ian Romanick <[email protected]>
* mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffersMarek Olšák2012-06-281-4/+4
| | | | | | | | | | | | This is a cleanup for ARB_transform_feedback3, where GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs. Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes this patch useful even without the extension. I don't know of any hardware which can do more than 4. Reviewed-by: Brian Paul <[email protected]>
* mesa: minor transform feedback commentsBrian Paul2012-06-221-0/+2
|
* mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.Eric Anholt2012-06-211-54/+12
| | | | | | | | | | | The rest of the TFB implementation remains in transformfeedback.c, and this will be shared with UBOs. v2: Move the size/offset checks shared with UBOs to common code as well. (Kenneth's review) Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.Kenneth Graunke2012-06-051-3/+18
| | | | | | | | | | | | | _mesa_lookup_bufferobj returns NULL for 0, which caused us to say "there's no such buffer object" and raise an error, rather than correctly binding the shared NullBufferObj. Now you can unbind your buffers. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Validate the drawing primitive against the transform feedback mode.Eric Anholt2012-03-191-27/+0
| | | | | | Fixes piglit GL_EXT_transform_feedback/negative-prims. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix glGetTransformFeedbackVarying().Eric Anholt2012-01-051-26/+11
| | | | | | | | | | The current implementation was totally broken -- it was looking in an unpopulated structure for varyings, and trying to do so using the current list of varying names, not the list used at link time. v2: Fix leaking of memory into the program per re-link. Reviewed-by: Paul Berry <[email protected]>
* mesa: Additional error checks for transform feedback.Paul Berry2012-01-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | From the EXT_transform_feedback spec: The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT if no binding points would be used, either because no program object is active or because the active program object has specified no varying variables to record. ... The error INVALID_VALUE is generated by BindBufferRangeEXT or BindBufferOffsetEXT if <offset> is not word-aligned. Fixes Piglit tests: - EXT_transform_feedback/api-errors no_prog_active - EXT_transform_feedback/api-errors interleaved_no_varyings - EXT_transform_feedback/api-errors separate_no_varyings - EXT_transform_feedback/api-errors bind_offset_offset_1 - EXT_transform_feedback/api-errors bind_offset_offset_2 - EXT_transform_feedback/api-errors bind_offset_offset_3 - EXT_transform_feedback/api-errors bind_offset_offset_5 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Check that all buffers are bound in BeginTransformFeedback.Paul Berry2012-01-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | From the EXT_transform_feedback spec: The error INVALID_OPERATION is generated by BeginTransformFeedbackEXT if any transform feedback buffer object binding point used in transform feedback mode does not have a buffer object bound. This required adding a new NumBuffers field to the gl_transform_feedback_info struct, to keep track of how many transform feedback buffers are required by the current program. Fixes Piglit tests: - EXT_transform_feedback/api-errors interleaved_unbound - EXT_transform_feedback/api-errors separate_unbound_0_1 - EXT_transform_feedback/api-errors separate_unbound_0_2 - EXT_transform_feedback/api-errors separate_unbound_1_2 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix typos in transform feedback error messages.Paul Berry2012-01-041-1/+1
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Disable certain error checks when transform feedback is pausedPaul Berry2011-12-231-1/+2
| | | | | | | | | | When transform feedback is paused, it is legal to change programs or to perform drawing operations using a drawing mode that doesn't match the transform feedback mode. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Ensure that Paused is reset to false on EndTransformFeedback.Paul Berry2011-12-231-0/+1
| | | | | | | | | | | | If a client calls BeginTransformFeedback(), then PauseTransformFeedback(), then EndTransformFeedback(), we need to make sure that the transform feedback object is not left in a "paused" state, otherwise the next call to BeginTransformFeedback() will leave transform feedback paused. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary FLUSH_VERTICES in bind_buffer_rangePaul Berry2011-12-201-1/+5
| | | | | | | | | | It isn't necessary to call FLUSH_VERTICES from bind_buffer_range, because transform feedback buffers are not allowed to be changed when transform feedback is active. Thanks to Marek Olšák for pointing out this bug. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix off-by-one error in transform feedback size check.Paul Berry2011-12-201-1/+1
| | | | | | | | | | | In _mesa_BindBufferRange(), we need to verify that the offset and size specified by the client do not exceed the size of the underlying buffer. We were accidentally doing this check using ">=" rather than ">", so we were generating a bogus error if the client specified an offset and size that fit exactly in the underlying buffer. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: implement DrawTransformFeedback from ARB_transform_feedback2Marek Olšák2011-12-151-55/+6
| | | | | | | | | | | | | | It's like DrawArrays, but the count is taken from a transform feedback object. This removes DrawTransformFeedback from dd_function_table and adds the same function to GLvertexformat (with the function parameters matching GL). The vbo_draw_func callback has a new parameter "struct gl_transform_feedback_object *tfb_vertcount". The rest of the code just validates states and forwards the transform feedback object into vbo_draw_func.
* mesa: Track changes to transform feedback state.Paul Berry2011-12-071-1/+8
| | | | | | | | | | | This patch adds a new bit to the ctx->NewState bitfield, _NEW_TRANSFORM_FEEDBACK, to track state changes that affect ctx->TransformFeedback. This bit can be used by driver back-ends to avoid expensive recomputations when transform feedback state has not been modified. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix signed/unsigned comparison warningBrian Paul2011-11-301-1/+1
|
* mesa: initialize ARB_transform_feedback2 dispatchMarek Olšák2011-10-271-1/+9
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix GL error checking in TransformFeedbackVaryingsMarek Olšák2011-10-271-1/+3
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix error string, remove out of date commentBrian Paul2011-04-291-12/+1
|
* mesa: remove commented-out #includeBrian Paul2011-04-291-1/+0
|
* mesa: fix a few incorrect error messagesBrian Paul2011-04-291-2/+2
|
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee2011-01-051-0/+1
| | | | | | Directly include mtypes.h if a file uses a gl_context struct. This allows future removal of headers that are not strictly necessary but indirectly include mtypes.h for a file.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-18/+18
|
* mesa: fix some printf warnings with castsBrian Paul2010-09-021-3/+3
|
* mesa: Fix many printf-like warnings.Eric Anholt2010-09-011-1/+2
| | | | | | | | Most of these are just typecasting to long to match the arg type. I don't really care too much about getting a GLsizei or whatever appropriate type in. However, there were a number of real bugs, like missing arguments or passing floats to integer format specifiers. My favorite: printflike("%s, argument") is missing an argument.
* mesa: Always initialize transform feedback state.Chia-I Wu2010-07-061-8/+42
| | | | | | Assert ctx->Driver.NewTransformFeedback if the feature is enabled; Use the default callbacks otherwise. The rest of core mesa expects the state to be initialized.
* mesa: free xform feedback hash tableBrian Paul2010-07-011-0/+1
|
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-2/+2
|
* mesa: refactor shader api / object codeBrian Paul2010-06-101-1/+3
| | | | | Remove the unneeded ctx->Driver hooks for shader-related functions. Move state and API-related things into main/.
* mesa: another transform feedback error check, 80-col wrappingBrian Paul2010-05-141-3/+9
|