summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* swrast: do depth/stencil clearing with Map/UnmapRenderbuffer()Brian Paul2011-12-245-140/+305
| | | | | | | | Another step toward getting rid of the renderbuffer PutRow/etc functions. v2: fix assorted depth/stencil clear bugs found by Eric Reviewed-by: José Fonseca <[email protected]>
* mesa: split get_tex_rgba() into compressed/uncompressed versionsBrian Paul2011-12-241-145/+175
| | | | | | | This just splits one big function into two smaller ones for better readability. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix comments in getteximage_error_check()Brian Paul2011-12-241-2/+2
|
* mesa: move the format and type check before select_tex_image()Jian Zhao2011-12-241-6/+6
| | | | | | | | | | Move the format and type check before select_tex_image, or it will fail to report the mismatch error if the teximage is null. Reported-by: Anuj Phogat <[email protected]> Signed-off-by: Jian Zhao <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* vl: Fix inverted logic in vlc checksMaarten Lankhorst2011-12-241-4/+4
| | | | | Reported-by: Andy Furniss <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]>
* egl,glx,wgl: Fixes stapi->createContext usageAlexandre Demers2011-12-243-6/+9
| | | | | | | | Fixed the build failure, fixed a warning where attributs and error arguments had been inverted and fixed another call that was missing an argument. Signed-off-by: José Fonseca <[email protected]>
* i965/gen7: Fix feedback for flat-shaded tristrips versus provoking vertex.Eric Anholt2011-12-231-0/+5
| | | | | | | Fixes piglit tesselation triangle_strip flat_last. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Paul Berry <[email protected]>
* i965/gen7: Add support for transform feedback.Eric Anholt2011-12-231-7/+201
| | | | | | | | | | | | Fixes almost all of the transform feedback piglit tests. Remaining are a few tests related to tesselation for quads/trifans/tristrips/polygons with flat shading. v2: Incorporate Paul's feedback (squash with previous, state flag note, static assert, update FINISHME) Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Paul Berry <[email protected]>
* i965/gen7: Move SOL stage disable to gen7_sol_state.cEric Anholt2011-12-234-7/+58
| | | | | | | We'll be growing more code in here as we actually enable the unit. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965/gen7: Add register definitions for GL_EXT_transform_feedback.Eric Anholt2011-12-232-2/+86
| | | | | | | v2: Make the buffer enable bitfield take an index argument. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965/gen7: Make primitives_written counting work.Eric Anholt2011-12-231-6/+27
| | | | | | | | | | | The code was relying on gs.prog_data's copy of the number-of-verts-per-prim, which segfaulted on gen7 since it doesn't make a GS program. We can easily calculate that value right here. v2: Fix svbi_0_starting_index regression. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7: Enable EXT_transform_feedback extension under 3.0 override.Eric Anholt2011-12-231-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: remove old autogen.shMatt Turner2011-12-231-12/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965 Gen6+: Invalidate VF address-based cache on flushPaul Berry2011-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although there is not much documentation of this fact, there are in fact two separate VF caches: - an "index-based" cache (described in the Sandy Bridge PRM, vol 2 part 1, section 2.1.2 "Vertex Cache"). This cache stores URB handles of vertex shader outputs; its purpose is to avoid redundant invocations of the vertex shader when drawing in random access mode (e.g. glDrawElements()), and the same vertex index is specified multiple times. It is automatically invalidated between 3D_PRIMITIVE commands and between instances within a single 3D_PRIMITIVE command. - an "address-based" cache (mentioned briefly in vol 2 part 1, section 1.7.4 "PIPE_CONTROL Command"). This cache stores the data read from vertex buffers; its purpose is to avoid redundant memory accesses when doing instanced drawing or when multiple 3D_PRIMITIVE commands access the same vertex data. It needs to be manually invalidated whenever new data is written to a buffer that is used for vertex data. Previous to this patch, it was not necessary for Mesa to explicitly invalidate the address-based cache, because there were no reasonable use cases in which the GPU would write to a vertex data buffer during a batch, and inter-batch flushing was taken care of by the kernel. However, with transform feedback, there is now a reasonable use case: vertex data is written to a buffer using transform feedback, and then that data is immediately re-used as vertex input in the next drawing operation. To make this use case work, we need to flush the address-based VF cache between transform feedback and the next draw operation. Since we are already calling intel_batchbuffer_emit_mi_flush() when transform feedback completes, and intel_batchbuffer_emit_mi_flush() is intended to invalidate all caches, it seems reasonable to add VF cache invalidation to this function. As with commit 63cf7fad13fc9cfdd2ae7b031426f79107000300 (i965: Flush pipeline on EndTransformFeedback), this is not an ideal solution. It would be preferable to only invalidate the VF cache if the next draw call was about to consume data generated by a previous draw call in the same batch. However, since we don't have the necessary dependency tracking infrastructure to figure that out right now, we have to overzealously invalidate the cache. Fixes Piglit test "EXT_transform_feedback/immediate-reuse". Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Resend binding table pointer after updating SOL bindings.Paul Berry2011-12-231-0/+2
| | | | | | | | | After creating new binding table entries for transform feedback, we need to set the dirty flag BRW_NEW_SURFACES, so that a new binding table pointer will be sent to the hardware. Otherwise the new binding table entries will not take effect. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename BRW_NEW_WM_SURFACES to BRW_NEW_SURFACES.Paul Berry2011-12-233-9/+9
| | | | | | | | | The surface states tracked by BRW_NEW_WM_SURFACES are no longer used for just WM. They are also used for vertex texturing and transform feedback. To avoid confusion, this patch renames BRW_NEW_WM_SURFACES to BRW_NEW_SURFACES. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.Kenneth Graunke2011-12-231-1/+4
| | | | | | | | | | | X8 depth formats weren't supported until Ironlake (Gen 5). Fixes GPU hangs introduced in d84a180417d1eabd680554970f1eaaa93abcd41e. One example test case was "fbo-missing-attachment-blit from". Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Pause transform feedback during meta ops.Paul Berry2011-12-231-0/+13
| | | | | | | | | Fixes piglit tests "EXT_transform_feedback/generatemipmap buffer" and "EXT_transform_feedback/generatemipmap prims_written" on i965 Gen6. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Implement transform feedback pause/resume functionality.Paul Berry2011-12-233-3/+6
| | | | | | | | | Although i965 gen6 does not yet support ARB_transform_feedback2 or NV_transform_feedback2, it needs to support pause/resume functionality so that meta-ops will work correctly. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Disable certain error checks when transform feedback is pausedPaul Berry2011-12-232-3/+5
| | | | | | | | | | 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: Save and restore GL_RASTERIZER_DISCARD state during meta ops.Paul Berry2011-12-231-0/+7
| | | | | | | | | | | | | | | During meta-operations (such as _mesa_meta_GenerateMipmap()), we need to be able to draw even if GL_RASTERIZER_DISCARD is enabled. This patch causes _mesa_meta_begin() to save the state of GL_RASTERIZER_DISCARD and disable it (so that drawing can be done during the meta-op), and causes _mesa_meta_end() to restore it. Fixes piglit test "EXT_transform_feedback/generatemipmap discard" on i965 Gen6. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri2: Add createContextAttribs entry point for DRISW version 3Ian Romanick2011-12-232-3/+25
| | | | Signed-off-by: Ian Romanick <[email protected]>
* dri2: Add createContextAttribs entry point for DRI2 version 3Ian Romanick2011-12-232-4/+56
| | | | Signed-off-by: Ian Romanick <[email protected]>
* st-api: Have context_create explain why creation failedIan Romanick2011-12-234-5/+36
| | | | | | | | | | This won't be used in the client-side libGL, but the xserver has to generate a different protocol error depending on the reason context creation failed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* st-api: Clean-up OpenGL profile handlingIan Romanick2011-12-233-19/+44
| | | | | | | | | | | | | | | | There seems to have been two different ways to communicate the profile. There were flags and there were profiles. I've opted to remove the profile flags and use ST_PROFILE_DEFAULT (compatibility profile) and ST_PROFILE_OPENGL_CORE (core profile) consistently instead. Also change the values of the ST_CONTEXT_FLAG_DEBUG and ST_CONTEXT_FLAG_FORWARD_COMPATIBLE flags to match the WGL and GLX values. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* glx: Propagate the glXIsDirect protocol error back to the applicationIan Romanick2011-12-231-3/+26
| | | | | | | | | | | | If the server returned BadContext, the error would just get droped on the floor. Fixes the piglit test glx-import-context-single-process NOTE: This is a candidate for the 7.11 branch, but it also requires the previous patch. Signed-off-by: Ian Romanick <[email protected]>
* glx: Deliver an xlib style error to the application from an XCB errorIan Romanick2011-12-232-0/+23
| | | | Signed-off-by: Ian Romanick <[email protected]>
* vl: improve vlc functions and handlingMaarten Lankhorst2011-12-232-59/+156
| | | | | | | | | | | | | | Only initialize vlc in MPEG2 decoding once for all slices, add more sanity checks to vlc decoding functions, support multiple vlc input buffer, improve documentation of the vlc functions. v2: also implement multiple inputs for the vlc functions v3: some bug fixes for buffer size and alignment corner cases v4: rework of the patch, some more improvements Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
* nouveau: Fix bugs in nouveau_video_bufferMaarten Lankhorst2011-12-232-4/+3
| | | | | | | Double free and array overflow, even if only 2 members are used the last one needs to be set to NULL explicitly. Signed-off-by: Maarten Lankhorst <[email protected]
* gallivm: Close a memory leakLauri Kasanen2011-12-221-0/+1
| | | | | | | | | | | | | | | | Hi all This fixes a memory leak of 32 bytes on exit. From 924f8fdccb41b011f372bc57252005bcdb096105 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Thu, 22 Dec 2011 21:28:33 +0200 Subject: [PATCH] gallivm: Close a memory leak As reported by "valgrind --leak-check=full glxgears". Signed-off-by: Lauri Kasanen <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* softpipe: try and use back color for a slot if color fails.Dave Airlie2011-12-221-0/+5
| | | | | | | | | | | | | | In the case where a front and back output are specified, the draw code will copy the back output into the front color slot and everything is happy. However if no front is specified then the draw code will do a bad copy (separate patch), but also the frag shader won't pick up the color as there there is no write to COLOR from the vertex shader just BCOLOR. This patch fixes that problem so if it can't find a vertex shader output for the front color slot, it will go and lookup and use one for the back color slot. Signed-off-by: Dave Airlie <[email protected]>
* format_unpack: add 8/16 rgba/rgb types.Dave Airlie2011-12-221-0/+134
| | | | | | | | | | fixing these makes piglit fbo-integer pass on softpipe. modified to re-order things, haven't addressed Eric's concerns, can't find anything in spec that mentions sign extensions, it does say integers aren't clamped or modified. Signed-off-by: Dave Airlie <[email protected]>
* i965: Don't make consumers of brw_CONT/brw_WHILE track if depth in loop.Eric Anholt2011-12-216-58/+25
| | | | | | | The codegen backends all had this same tracking, so just do it at the EU level. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Don't make consumers of brw_WHILE do pre-gen6 BREAK/CONT patching.Eric Anholt2011-12-214-86/+45
| | | | | | | The EU code itself can just do this work, since all the consumers were duplicating it. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Don't make consumers of brw_DO()/brw_WHILE() track loop start.Eric Anholt2011-12-219-28/+58
| | | | | | | This is a similar cleanup to what we did for brw_IF(), brw_ELSE(), brw_ENDIF() handling. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Drop unused do_insn argument from gen6_CONT().Eric Anholt2011-12-215-7/+5
| | | | | | The branch distances get patched up later at the WHILE instruction. Reviewed-by: Yuanhan Liu <[email protected]>
* mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.Paul Berry2011-12-214-5/+12
| | | | | | | | | | This makes it easier to keep track of which dirty bits correspond to which pieces of context, since it makes _NEW_RASTERIZER_DISCARD correspond with ctx->RasterDiscard. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Move RasterDiscard to toplevel of gl_context.Paul Berry2011-12-218-19/+19
| | | | | | | | | | | | | | | | | | | | Previously we were storing the RasterDiscard flag (for GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback. This was confusing, because we use the _NEW_TRANSFORM flag (not _NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because rasterizer discard has effects even when transform feedback is not in use. This patch makes RasterDiscard a toplevel element in gl_context rather than a subfield of gl_context::TransformFeedback. Note: We can't put RasterDiscard inside gl_context::Transform, since all items inside gl_context::Transform need to be pieces of state that are saved and restored using PushAttrib and PopAttrib. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/x11: Merge the right version of Frederiks changeKristian Høgsberg2011-12-211-21/+8
| | | | | Argh, I merged an older broken version of the swapbuffer change instead of Frederiks fixed version. This diffs gets us back to the right version.
* egl_dri2/x11: Add support for the DRI2 SwapBuffers requestFredrik Höglund2011-12-202-21/+81
|
* egl_dri2/x11: Add support for eglSwapIntervalFredrik Höglund2011-12-203-1/+36
|
* i965 gen6: Turn on transform feedback extension unconditionally.Paul Berry2011-12-201-1/+1
| | | | | | | | | | | | Previously, we only enabled transform feedback when MESA_GL_VERSION_OVERRIDE was 3.0 or greater, since transform feedback support was not completely finished, so it didn't make sense to advertise support for it unless absolutely necessary. Now that transform feedback is fully implemented on gen6, we can enable this extension unconditionally. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Implement transform feedback queries.Paul Berry2011-12-203-0/+54
| | | | | | | | | | | | | | | | | | | | This patch adds software-based PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries that work by keeping track of the number of primitives that are sent down the pipeline, and adjusting as necessary to account for the way each primitive type is tessellated. In the long run we'll want to replace this with a hardware-based implementation, because the software approach won't work with geometry shaders or primitive restart. However, at the moment, we don't have the necessary kernel support to implement a hardware-based query (we would need the kernel to save GPU registers when context switching, so that drawing performed by another process doesn't get counted). Fixes Piglit tests EXT_transform_feedback/query-primitives_generated-* and EXT_transform_feedback/query-primitives-written-*. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Convert if/else to switch statements in brw_queryobj.cPaul Berry2011-12-201-6/+30
| | | | | | | | | | | | | Previously, i965 only supported two query types: GL_TIME_ELAPSED_EXT and GL_SAMPLES_PASSED_ARB, and it distinguished between the two using if/else statements that compared query->Base.Target to GL_TIME_ELAPSED_EXT. This patch changes the if/else statements to switch statements so that we can add more query types without having to have a chain of else-ifs. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Ensure correct transform feedback indices on new batch.Paul Berry2011-12-205-8/+72
| | | | | | | | | | | | | | | | We don't currently have kernel support for saving GPU registers on a context switch, so if multiple processes are performing transform feedback at the same time, their SVBI registers will interfere with each other. To avoid this situation, we keep a software shadow of the state of the SVBI 0 register (which is the only register we use), and re-upload it on every new batch. The function that updates the shadow state of SVBI 0 is called brw_update_primitive_count, since it will also be used to update the counters for the PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add a function to query whether a meta-op is in progress.Paul Berry2011-12-202-0/+13
| | | | | | | This is needed by i965 to ensure that transform feedback counters are not incremented during meta-ops. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add count_tessellated_primitives() function.Paul Berry2011-12-202-0/+51
| | | | | | | | | | | This function computes the number of primitives that will be generated when the given drawing operation is performed. It accounts for the tessellation that is performed on line strips, line loops, triangle strips, triangle fans, quads, quad strips, and polygons, so it is suitable for implementing the primitive counters needed by transform feedback. 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]>
* i965 gen6: Implement rasterizer discard.Paul Berry2011-12-203-0/+37
| | | | | | | | | | | | | | | | | | | This patch enables rasterizer discard functionality (a part of transform feedback) in Gen6, by generating an alternate GS program when rasterizer discard is active. Instead of forwarding vertices down the pipeline, the alternate GS program uses a URB Write message to deallocate the URB entry that was allocated by FF sync and terminate the thread. Note: parts of the Sandy Bridge PRM seem to imply that we could do this more efficiently, by clearing the GEN6_GS_RENDERING_ENABLE bit, and not allocating a URB entry at all. However, it's not clear how we are supposed to terminate the thread if we do that. Volume 2 part 1, section 4.5.4, says "GS threads must terminate by sending a URB_WRITE message with the EOT and Complete bits set.", and my experiments so far confirm that. Reviewed-by: Kenneth Graunke <[email protected]>