summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* swrast: rewrite glDrawPixels(GL_DEPTH) with zoomBrian Paul2011-12-243-69/+28
| | | | | | | This gets rid of another renderbuffer->PutRow() call and _DepthBuffer usage. We always work with 32-bit uint Z values now. Reviewed-by: Eric Anholt <[email protected]>
* swrast: stop using _DepthBuffer in triangle codeBrian Paul2011-12-241-16/+11
| | | | | The only consequence is we can only use the occlusion_zless_16_triangle() function with MESA_FORMAT_Z16.
* mesa: remove gl_renderbuffer::PutRowRGB()Brian Paul2011-12-2414-1017/+0
| | | | | | No longer used anywhere. Reviewed-by: Eric Anholt <[email protected]>
* swrast: stop using PutRowRGB() in triangle codeBrian Paul2011-12-241-10/+12
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: refactor/rewrite fast_draw_rgba_pixels()Brian Paul2011-12-241-234/+167
| | | | | | | | | Use Map/UnmapRenderbuffer() for the special, optimized cases we care about. Note that we're dropping some seldom-used cases in the new fast-path code: as CI->RGB conversion and zooming. Reviewed-by: Eric Anholt <[email protected]>
* swrast: move swrast_render_start/finish() call in drawpixels codeBrian Paul2011-12-241-10/+24
| | | | | | | | We don't want to call these functions where we'll be using Map/UnmapRenderbuffer(). So push them further down in the drawpixels cases so that we can switch over to Map/UnmapRenderbuffer() step by step. Reviewed-by: Eric Anholt <[email protected]>
* swrast: new fast_draw_depth_stencil() for glDrawPixels(GL_DEPTH_STENCIL)Brian Paul2011-12-241-16/+40
| | | | | | | | Stop using deprecated renderbuffer PutRow() function. Note that we aren't using Map/UnmapRenderbuffer() yet because this call is inside a swrast_render_start/finish() pair. v2: use _mesa_pack_uint_24_8_depth_stencil_row(), per Eric.
* swrast: remove the copy_depth_stencil_pixels() functionBrian Paul2011-12-241-178/+3
| | | | | | | | | Hopefully glCopyPixels(GL_DEPTH_STENCIL) will be handled by the fast copy function. Otherwise, just do the copy with separate depth + stencil copies. That's effectively what the removed code did anyway. Reviewed-by: Eric Anholt <[email protected]>
* swrast: stop using depth/stencil wrappers in CopyPixels codeBrian Paul2011-12-241-8/+21
| | | | | | | | | | | The functions that read depth/stencil values understand all (packed) depth/stencil buffer formats now so there's no reason to use the wrappers. Also, improve the format checks in fast_copy_pixels() to catch mismatched depth/stencil cases. v2: fix the test for combined depth+stencil buffers, per Eric.
* swrast: remove needless assignment in draw_depth_stencil_pixels()Brian Paul2011-12-241-1/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swast: replace renderbuffer->GetPointer() with _swrast_pixel_address()Brian Paul2011-12-243-4/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: use _swrast_pixel_address() helper functionBrian Paul2011-12-243-32/+20
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: rewrite stencil test codeBrian Paul2011-12-241-858/+259
| | | | | | | | Stop using the deprecated renderbuffer Get/Put Row/Values functions. Consolidate code paths, etc. The file is nearly half the size it used to be! Reviewed-by: Eric Anholt <[email protected]>
* swrast: remove dead code in s_stencil.cBrian Paul2011-12-241-33/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: rewrite _swrast_read_stencil_span()Brian Paul2011-12-241-5/+26
| | | | | | | | | Use format pack/unpack functions instead of deprecated renderbuffer GetRow/PutRow functions. v2: use get_stencil_address(), s/destVals/newVals/ Reviewed-by: Eric Anholt <[email protected]>
* swrast: rewrite _swrast_read_depth_span_float()Brian Paul2011-12-241-25/+4
| | | | | | Stop using the deprecated renderbuffer GetRow() function. Reviewed-by: Eric Anholt <[email protected]>
* mesa: rewrite _swrast_depth_bounds_test()Brian Paul2011-12-241-82/+21
| | | | | | Stop using the deprecated renderbuffer functions. Reviewed-by: Eric Anholt <[email protected]>
* swrast: rewrite depth-testing codeBrian Paul2011-12-241-1019/+208
| | | | | | | Consolidate code, stop using the deprecateted renderbuffer Put/Get Row/Values() functions. Reviewed-by: Eric Anholt <[email protected]>
* swrast: stop using _swrast_get_values() in z/depth codeBrian Paul2011-12-241-6/+75
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: stop using _swrast_get_values() in stencil codeBrian Paul2011-12-241-1/+30
| | | | | | That function will go a way in the future. Reviewed-by: Eric Anholt <[email protected]>
* swrast: do fast_copy_pixels() with Map/UnmapRenderbuffer()Brian Paul2011-12-241-43/+89
| | | | | | v2: use memmove() instead of memcpy() in case of overlap Reviewed-by: Eric Anholt <[email protected]>
* swrast: replace GetRow() call with _mesa_unpack_ubyte_stencil_row()Brian Paul2011-12-241-1/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()Brian Paul2011-12-2414-1835/+8
| | | | | | | The former was only used for clearing buffers. The later wasn't used anywhere! Remove them and all implementations of those functions. Reviewed-by: Eric Anholt <[email protected]>
* swrast: rewrite color buffer clearing to use Map/UnmapRenderbuffer()Brian Paul2011-12-241-112/+113
| | | | | | v2: use _mesa_pack_colormask() helper and fix incorrect masking arithmetic Reviewed-by: José Fonseca <[email protected]>
* mesa: add _mesa_pack_colormask()Brian Paul2011-12-242-0/+78
| | | | | | For generating bit-wise colormasks for arbitrary pixel formats. Reviewed-by: José Fonseca <[email protected]>
* mesa: add _mesa_get_format_max_bits()Brian Paul2011-12-242-0/+19
| | | | | | Returns max bits per channel for the given format. Reviewed-by: José Fonseca <[email protected]>
* 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-231-2/+6
| | | | Signed-off-by: Ian Romanick <[email protected]>
* dri2: Add createContextAttribs entry point for DRI2 version 3Ian Romanick2011-12-231-2/+6
| | | | Signed-off-by: Ian Romanick <[email protected]>