summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
Commit message (Collapse)AuthorAgeFilesLines
* swrast: use BITFIELD64_BIT() macro to fix MSVC warningsBrian Paul2012-01-123-5/+5
| | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove _mesa_ffs(), implement ffs() for non-GNU platformsBrian Paul2012-01-121-2/+2
| | | | | | | | | | | Call ffs() and ffsll() everywhere. Define our own ffs(), ffsll() functions when the platform doesn't have them. v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs() implementation. The #else clause was recursive. Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Alexander von Gluck <[email protected]>
* swrast: convert blit_linear() to Map/UnmapRenderbuffer()Brian Paul2012-01-091-25/+158
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: fix Z testing of points/lines for 16-bit depth buffersBrian Paul2012-01-071-7/+29
| | | | | | | We were comparing 32-bit Z buffer values against 16-bit fragment values. Need to do scaling like for the 24-bit case. Triangle Z testing was OK since it didn't hit this code path.
* swrast: s/GLbitfield/GLbitfield64/ for sw_span::arrayAttribsBrian Paul2012-01-074-6/+8
| | | | This is a bitfield of FRAG_BIT_x values so it should be 64-bits now.
* swrast: s/GLint/GLuint/ to silence MSVC signed/unsigned comparison warningBrian Paul2012-01-071-2/+2
|
* swrast: remove s_depthstencil.[ch] filesBrian Paul2012-01-062-830/+0
| | | | | | The code is no longer used. Reviewed-by: Eric Anholt <[email protected]>
* swrast: remove calls to _swrast_update_depth/stencil_buffer()Brian Paul2012-01-061-23/+0
| | | | | | | These functions updated the gl_renderbuffer::_DepthBuffer and _StencilBuffer fields. But those fields are no longer used. Reviewed-by: Eric Anholt <[email protected]>
* swrast: Convert the glBlitFramebuffer(GL_NEAREST) path to MapRenderbuffer().Eric Anholt2012-01-061-39/+150
| | | | | | | | Fixes on i965: ARB_depth_buffer_float/fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit ARB_depth_buffer_float/fbo-stencil-GL_DEPTH32F_STENCIL8-blit Reviewed-by: Brian Paul <[email protected]>
* swrast: Fix use of uninitialized value in rbmapping changes.Eric Anholt2012-01-061-1/+1
| | | | | | | | | I'm so surprised that gcc didn't catch this that I feel like I must be misreading. srcMap is what we initialize (along with dstMap) from this map value right after this check. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Use the fast copypixels code to implement fast glBlitFramebuffer().Eric Anholt2012-01-063-139/+46
| | | | | | | | They were meaning to do the same thing of memcpying rows, so just write the code once. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Move the check for fast_copy_pixels() ability to caller.Eric Anholt2012-01-061-9/+5
| | | | | | | | I'm going to reuse this function from glBlitFramebuffer() handling, which wants to do the same thing. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: use memmove() instead of memcpy() in the SHIFT_ARRAY macroBrian Paul2012-01-051-1/+1
| | | | | | | | | | | The src/dst arrays would overlap but dst was less than src so a simple version of memcpy() would do the right thing. But this isn't guaranteed when memcpy() is optimized. Fixes demos/copypix when the dest region was clipped by the left side of the window. Reviewed-by: Adam Jackson <[email protected]>
* swrast: Remove dead code in _swrast_clear_depth_buffer()Paul Berry2012-01-021-9/+0
| | | | | | | | This code was generating the gcc warning: variable ‘clearValue’ set but not used [-Wunused-but-set-variable] Reviewed-by: Brian Paul <[email protected]>
* swrast: assert _swrast_map_teximage() x, y is multiple of block sizeBrian Paul2011-12-261-0/+3
|
* swrast: replace assertion with conditional in _swrast_map_teximage()Brian Paul2011-12-261-2/+6
| | | | | Just in case we ran out of memory when trying to allocate the texture memory.
* 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-244-175/+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-244-822/+1
| | | | | | | 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]>
* 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]>
* swrast: Add a note about overlapping support for framebuffer blit.Eric Anholt2011-12-141-1/+9
| | | | Reviewed-by: Brian Paul <[email protected]>
* swrast: Don't do Z24S8 drawpixels fast-paths with Z32_X24S8 input data.Eric Anholt2011-12-141-2/+4
| | | | | | | | | | The cool part was that in the "fbo-depthstencil -drawpixels GL_DEPTH24_STENCIL8 32F_24_8_REV" testcase, the shifting happened to end up with a value awfully close to the expected value, except for every other pixel being 0 (the stencil value, shifted away to nothing). Reviewed-by: Brian Paul <[email protected]>
* swrast: add debug code to test combined depth/stencil buffersBrian Paul2011-12-131-7/+47
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: move depth/stencil buffer validation to swrastBrian Paul2011-12-131-0/+23
| | | | | | | | | Since gl_framebuffer::_DepthBuffer and _StencilBuffer are only used by swrast, do the validation of those fields in swrast too. The main/depthstencil.[ch] code is no longer used and will be removed next. Reviewed-by: Eric Anholt <[email protected]>
* swrast: update depth/stencil wrapper sizesBrian Paul2011-12-131-2/+6
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: add new s_depthstencil.[ch] filesBrian Paul2011-12-132-0/+1072
| | | | | | | These files are copies of main/depthstencil.[ch] with s/mesa/swrast/. The main/depthstencil.[ch] will go away soon. Reviewed-by: Eric Anholt <[email protected]>
* swrast: add missing state validation calls for Blit, ClearBrian Paul2011-12-132-0/+6
|
* mesa: fix possible precision issues in pack/unpack/fetch functionsMarek Olšák2011-12-121-2/+2
| | | | | | | | | | | | | | | | | GLfloat doesn't have enough precision to exactly represent 0xffffff and 0xffffffff. (and a reciprocal of those, if I am not mistaken) If -ffast-math is enabled, using GLfloat causes assertion failures in: - fbo-blit-d24s8 - fbo-depth-sample-compare - fbo-readpixels-depth-formats - glean/depthStencil For example: fbo-depth-sample-compare: main/format_unpack.c:1769: unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed. Reviewed-by: Brian Paul <[email protected]>
* swrast: use malloc instead of MAX_WIDTH arrays in glCopyPixels, zoom codeBrian Paul2011-12-082-2/+18
| | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>