summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* swrast: remove core renderbuffer functions from s_renderbuffer.[ch]Brian Paul2011-12-082-267/+49
| | | | | | | We'll use the functions that live in main/ Plus, rename the remaining functions with "swrast_" prefix. Reviewed-by: Eric Anholt <[email protected]>
* swrast: add s_renderbuffer.[ch], copied from main/renderbuffer.[ch]Brian Paul2011-12-082-0/+2318
| | | | | | | Copying these files is the first step in moving the software buffer code from main/renderbuffer.c to swrast/s_renderbuffer.c Reviewed-by: Eric Anholt <[email protected]>
* swrast: remove dead accum buffer context fieldsBrian Paul2011-12-082-10/+1
|
* mesa: remove dead swrast and state tracker accum buffer codeBrian Paul2011-12-083-639/+0
|
* mesa: rewrite accum buffer supportBrian Paul2011-12-081-3/+2
| | | | | | | | | | | | | Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <[email protected]>
* swrast: Add depth cube map support.Anuj Phogat2011-12-051-4/+14
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88Brian Paul2011-12-022-8/+8
| | | | R is in the high byte, G in the low byte.
* mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88Brian Paul2011-12-022-8/+8
| | | | | To better reflect the component ordering and be consistent with other format names.
* mesa: fix unpacking of RG88_REV texelsBrian Paul2011-12-021-3/+3
| | | | R should be in the high byte and G in the low byte for this format.
* mesa: add support for GL_OES_compressed_ETC1_RGB8_textureChia-I Wu2011-12-021-0/+8
| | | | | | | | | | | Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa. There is no driver support yet. Unlike desktop GL compressed texture formats, GLES compressed texture formats usually can only be used with glCompressedTexImage2D. All other gl*Tex*Image* functions are updated to check for that. Reviewed-by: Brian Paul <[email protected]>
* swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entriesBrian Paul2011-11-301-1/+2
| | | | | | | When new MESA_FORMAT_x enums are added we need to add a new entry in the table of texture fetch functions. In the past this has been missed if swrast isn't actually tested. Using a static assertion should help with that.
* swrast: Fix some static analysis warningsChad Versace2011-11-291-0/+9
| | | | | | | | | | | To each switch statement in s_texfilter.c, add a break statement to the default case. Eliminates the Eclipse static analysis warning: No break at the end of this case. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINTBrian Paul2011-11-281-0/+7
| | | | | | | | | | As with the other integer-valued formats, use NULL until we support integer textures. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316 Tested-by: Vinson Lee <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REVChia-I Wu2011-11-272-0/+62
| | | | | | | | | | | | | MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android. Thanks to texture-from-pixmap, drivers may actually see texture images with this format on Android. MESA_FORMAT_RGBX8888 is added only for completeness. Reviewed-by: Brian Paul <[email protected]> [olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format. I accidentally moved them to the wrong place when preparing the patch.]
* swrast: fix unmatched span->array->ChanTypeYuanhan Liu2011-11-211-0/+4
| | | | | | | | | | | texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the same time, make sure the span->array->ChanType is changed, too. v2: pick a nicer comment from Brian Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* swrast: simplify the prototype of function texture_combineYuanhan Liu2011-11-211-10/+9
| | | | | | | | | | | | Parameter n and rgbaChan are both from structure span, thus using span as paramter to simplify the prototype. Function texture_combine is only used by _swrast_texture_span, so I guess it's safe to do so. This patch is mainly for the next patch. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* swrast: fix glReadPixels from texture attachmentBrian Paul2011-11-151-0/+13
| | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42635
* mesa: remove _swrast_ReadPixels()Brian Paul2011-11-153-531/+1
| | | | | | We use the code in main/readpix.c now. Acked-by: Eric Anholt <[email protected]>
* mesa: replace GLstencil with GLubyteBrian Paul2011-11-157-115/+111
|
* swrast: avoid calling _mesa_get_srgb_format_linear() inside a loopBrian Paul2011-11-111-3/+3
|
* swrast: remove bogus assertionBrian Paul2011-11-111-1/+0
| | | | | It would fail for images that were never allocated (and wouldn't be used during rendering).
* swrast: Add support for glReadPixels() to integer types.Eric Anholt2011-11-091-6/+13
| | | | | | | With this change, i965 passes GL_EXT_texture_integer/fbo_integer_precision_clear Reviewed-by: Kenneth Graunke <[email protected]>
* swrast: update program type assertionBrian Paul2011-11-071-1/+3
| | | | | | | Fixes bogus failed assertion when using NV_fragment_program, such as with demos/fplight.c Note: This is a candidate for the 7.11 branch.
* swrast: Avoid void * arithmetic.José Fonseca2011-11-041-1/+1
| | | | An error with MSVC.
* swrast: Drop the global mapping of buffers across glReadPixels().Eric Anholt2011-11-031-8/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* swrast: Drop the remaining GetRow-based glReadPixels() fast-path.Eric Anholt2011-11-031-90/+0
| | | | | | | | | In all of piglit, only two tests hit it (reading to RGBA float, where GetRow would drop floats into place from R, RG, or RGB). Mostly this is because _ColorReadClamp has been causing transferOps to always be set, skipping any fast-paths anyway. Reviewed-by: Brian Paul <[email protected]>
* swrast: Remove dead _swrast_read_depth_span_uint().Eric Anholt2011-11-032-88/+0
| | | | | | | All the code using it is converted to MapRenderbuffer and the core unpack functions. Reviewed-by: Brian Paul <[email protected]>
* swrast: Convert color glReadPixels slow path to using MapRenderbuffer.Eric Anholt2011-11-031-72/+33
| | | | | | | | | | | | | | | | | | | This may be a bit slower than before because we're switching from per-format compiled loops in GetRow to _mesa_unpack_rgba_block_unpack's loop around a callback to unpack a pixel. The solution there would be to make _mesa_unpack_rgba_block fold the span loop into the format handlers. (On the other hand, function call overhead will hardly matter if MapRenderbuffer means the driver gets the data into cacheable memory instead of uncached). The adjust_colors code should no longer be required, since the unpack function does the 565 to float conversion in a single pass instead of converting it (poorly) through 8888 as apparently happened in the past. Reviewed-by: Brian Paul <[email protected]>
* swrast: Skip _swrast_validate_derived in _swrast_ReadPixels().Eric Anholt2011-11-031-4/+0
| | | | | | | None of the callgraph below this uses derived state (almost nothing even dereferences the swrast context). Reviewed-by: Brian Paul <[email protected]>
* swrast: Add a readpixels fast-path based on memcpy and MapRenderbuffer.Eric Anholt2011-11-031-4/+53
| | | | | | v2: Move _mesa_get_format_bytes out of the loop. Reviewed-by: Brian Paul <[email protected]>
* swrast: Switch the remaining depth readpixels to MapRenderbuffer.Eric Anholt2011-11-031-5/+17
| | | | | | | This avoids the wrapper, which should improve performance on packed depth/stencil drivers. Reviewed-by: Brian Paul <[email protected]>
* swrast: Switch the remaining depth/stencil readpixels path to MapRenderbuffer.Eric Anholt2011-11-031-30/+42
| | | | Reviewed-by: Brian Paul <[email protected]>
* swrast: MapRenderbuffer in separate depth/stencil readpixels fastpathEric Anholt2011-11-032-21/+59
| | | | | | | | | | | | This introduces two new span helper functions we'll want to use in several places as we move to MapRenderbuffer, which pull out integer depth and stencil values from a renderbuffer mapping based on the renderbuffer format. v2: Use format_unpack helper for stencil read. v3: Clean up comment after conversion to format_unpack. Reviewed-by: Brian Paul <[email protected]>
* swrast: Calculate image address/stride once for depth/stencil readpixels.Eric Anholt2011-11-031-16/+14
| | | | | | The fast and slow paths were doing these separately before. Reviewed-by: Brian Paul <[email protected]>
* swrast: Make the packed depth/stencil read fastpath use MapRenderbuffer.Eric Anholt2011-11-031-29/+55
| | | | | | | | | | | This also makes it handle 24/8 vs 8/24, fixing piglit depthstencil-default_fb-readpixels-24_8 on i965. While here, avoid incorrectly fast-pathing if packing->SwapBytes is set. v2: Move the unpack code to format_unpack.c, fix BUFFER_DEPTH typo v3: Fix signed/unsigned comparison. Reviewed-by: Brian Paul <[email protected]>
* swrast: Directly map the stencil buffer in read_stencil_pixels.Eric Anholt2011-11-031-4/+12
| | | | | | | | | | | This avoids going through the wrapper that has to rewrite the data for packed depth/stencil. This isn't done in _swrast_read_stencil_span because we don't want to map/unmap for each span. v2: Move the unpack code to format_unpack.c. v3: Fix signed/unsigned comparison. Reviewed-by: Brian Paul <[email protected]>
* swrast: simplify the condition test for _swrast_choose_texture_sample_funcYuanhan Liu2011-11-031-13/+9
| | | | | | | | | remove another long if condition test. I don't feel a strong need of this patch. But for it make the code a little simpler(I do think so), I send it out. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Use MapRenderbuffer for glReadPixels(GL_DEPTH_COMPONENT) fast-paths.Eric Anholt2011-11-011-68/+63
| | | | | | | | This fixes issues with the code playing fast and loose with types of buffers, and as a bonus avoids the wrappers that were previously used to pull bits out of packed depth/stencil buffers. Reviewed-by: Brian Paul <[email protected]>
* Add MapRenderbuffer implementations for software drivers.Eric Anholt2011-11-011-0/+1
| | | | | | | | | | Mesa core's is generic for things like osmesa. For swrast_dri.so, we have to do Y flipping. The front-buffer path isn't actually tested, though, because both before and after it fails with a BadMatch in XGetImage. Reviewed-by: Brian Paul <[email protected]>
* swrast: implement GL_ARB_texture_storageBrian Paul2011-10-312-0/+39
|
* swrast: Fix memory leak in out-of-memory path.Vinson Lee2011-10-251-0/+1
| | | | | | Fixes Coverity resource leak defect. Reviewed-by: Brian Paul <[email protected]>
* swrast: use _mesa_ffs() instead of ffs()Brian Paul2011-10-251-2/+2
| | | | Fixes MSVC build.
* swrast: fix comment typo (s/texure/texture/)Brian Paul2011-10-231-1/+1
|
* swrast: update renderbuffer format assertionBrian Paul2011-10-231-1/+4
| | | | Failed when exercising i965 swrast fallback rendering.
* mesa: add swrast_texture_image::BufferBrian Paul2011-10-234-23/+211
| | | | | | | | | | | | | | | In the past, swrast_texture_image::Data has been overloaded. It could either point to malloc'd memory storing texture data, or it could point to a current mapping of GPU memory. Now, Buffer always points to malloc'd memory (if we're not using GPU memory) and Data always points to mapped memory. The next step would be to rename Data -> Map. This change also involves adding swrast functions for mapping textures and renderbuffers prior to rendering to setup the Data pointer. Plus, corresponding functions to unmap texures and renderbuffers. This is very much like similar code in the dri drivers.
* mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrastBrian Paul2011-10-236-32/+58
| | | | | | Only swrast and the drivers that fall back to swrast need these fields now. This removes the last of the fields related to software rendering from gl_texture_image.
* swrast: fix float->uint conversion of gl_FragDepthBrian Paul2011-10-191-1/+2
| | | | | | | | | Using IROUND() to convert a float depth value to a 32-bit uint Z value. didn't work (it returns a signed value). Just use a cast instead Fixes piglit fbo-depth-array failure with swrast. Note: this is a candidate for the 7.11 branch.
* swrast: Fix fastpaths for glRead/WritePixels(GL_DEPTH_STENCIL)Chad Versace2011-10-182-0/+4
| | | | | | | | | | | | | | | | | | | In some cases, Intel hardware requires that depth and stencil buffers be separate. To accommodate swrast, i965 resorts to hackery that causes a segfault in the fastpaths of draw_depth_stencil_pixels() and read_depth_stencil_pixels(). The hack is that i965 sets framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer and framebuffer->Attachment[BUFFER_STENCIL].Renderbuffer to a dummy renderbuffer for which the GetRow accessors and friends are null. The real buffers are located at framebuffer->_DepthBuffer and framebuffer->_Stencilbuffer. To fix the segault, this patch skips the fastpath if framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer->GetRow is null. Note: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* swrast: Remove redundant term in logic expressionChad Versace2011-10-152-2/+0
| | | | | | | | Fix is in {read,draw}_depth_stencil_pixels(). If depthRb == stencilRb, then it is redundant to check depthRb->x *and* stencilRb->x. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>