summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_blit.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-05mesa: remove outdated version lines in commentsRico Schüller1-1/+0
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-04-23mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke1-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 <brianp@vmware.com>
2013-04-23mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke1-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 <brianp@vmware.com>
2013-04-23mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke1-1/+1
Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-16mesa/swrast: Move memory allocation outside the blit loopIan Romanick1-23/+20
Assume the maximum pixel size (16 bytes per pixel). In addition to moving redundant malloc and free calls outside the loop, this fixes a potential resource leak when a surface is mapped and the malloc fails. This also makes blit_nearest look a bit more like blit_linear. v2: Use MAX_PIXEL_BYTES instead of 16. Suggested by Ken. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-04-16mesa/swrast: Move free calls outside the attachment loopIan Romanick1-4/+5
This was originally discovered by Klocwork analysis: Possible memory leak. Dynamic memory stored in 'srcBuffer0' allocated through function 'malloc' at line 566 can be lost at line 746 However, I think the problem is actually much worse. Since the memory is freed after the first pass through the loop, the released buffer may be used on the next iteration! NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-04-16mesa/swrast: Refactor no-memory error checking in blit_linearIan Romanick1-29/+11
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-25swrast: init vars to silence warningsBrian Paul1-4/+4
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-22swrast: fix blit code's nearest/linear coordinate arithmeticBrian Paul1-15/+8
Fixes piglit's fbo-blit-stretch test. Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22swrast: fix incorrect width for direct/nearest blitBrian Paul1-1/+1
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22swrast: move resampleRow setup code in blit_nearest()Brian Paul1-23/+23
The resampleRow setup depends on pixelSize. For color buffers, we don't know the pixelSize until we're in the buffer loop. Move that code inside the loop. Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=59541 Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-17swrast: fix assorted bugs in software blit codeBrian Paul1-10/+20
1. The loop over dest buffers in blit_linear() needed a null pointer check. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59499 2. The code to grab the drawRb's format needs to be inside the drawing loop. 3. An equality test was using = instead of == thus messing up a renderbuffer attachment texture pointer. This lead to memory corruption and a crash at exit. Finally, fix a capitalization error NumDrawBuffers -> numDrawBuffers and change type to unsigned to fix signed/unsigned comparison warnings. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-15mesa: Add support to allow blitting to multiple color draw buffersAnuj Phogat1-261/+300
This patch fixes a blitting case when drawAttachment->Texture == readAttachment->Texture. It was causing an assertion failure in intel_miptree_attach_map() with gles3 conformance test case: framebuffer_blit_functionality_minifying_blit Number of changes in this file look scary. But most of them are caused by introducing a big for loop to support rendering to multiple color draw buffers. V2: Fixed a case when number of draw buffer attachments are zero. V3: Put a for loop in blit_nearest() and blit_linear() functions in to support blitting to multiple color draw buffers. V4: Remove variable declaration in for loop to avoid MSVC compilation issues. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02swrast: Fix memory leaks in blit_linear.Vinson Lee1-0/+9
Fixes Coverity resource leak defects. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09swrast: convert blit_linear() to Map/UnmapRenderbuffer()Brian Paul1-25/+158
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06swrast: Convert the glBlitFramebuffer(GL_NEAREST) path to MapRenderbuffer().Eric Anholt1-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 <brianp@vmware.com>
2012-01-06swrast: Use the fast copypixels code to implement fast glBlitFramebuffer().Eric Anholt1-133/+34
They were meaning to do the same thing of memcpying rows, so just write the code once. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14swrast: Add a note about overlapping support for framebuffer blit.Eric Anholt1-1/+9
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-13swrast: add missing state validation calls for Blit, ClearBrian Paul1-0/+3
2011-10-01mesa: s/INLINE/inline/Brian Paul1-1/+1
INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10swrast: fix depth/stencil blits when there's no colorbufferMarek Olšák1-3/+0
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-05-30swrast: BlitFramebuffer should not be killed by conditional renderingMarek Olšák1-3/+0
NOTE: This is a candidate for the 7.10 branch. Reviewed-by: Brian Paul <brianp@vmware.com>
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg1-4/+4
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg1-16/+16
2009-12-31swrast: add check for conditional renderingBrian Paul1-0/+4
2009-08-08swrast: replace GLenum, GLint with GLbitfield for buffer varsBrian Paul1-3/+3
2009-08-05mesa: make _mesa_clip_blit() a shared functionBrian Paul1-180/+3
2009-01-30swrast: replace RENDER_START/FINISH macros with inline functionsBrian Paul1-3/+2
2008-09-18mesa: prefix a bunch of #include lines with "main/".Brian Paul1-2/+2
This is another step toward removing a whole bunch of -I flags from the cc commands. Still need to address driver code...
2008-01-22Fix some issues with glDrawBuffer(GL_NONE), bug 14198Brian1-0/+3
Set _ColorDrawBuffers[0] = NULL if no renderbuffers enabled. Check that _ColorDrawBuffers[0] is non-null before dereferencing in a few places.
2008-01-06Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.Brian1-3/+3
These fields are no longer indexed by shader output. Now, we just have a simple array of renderbuffer pointers. If the shader writes to gl_FragData[i], send those colors to the N _ColorDrawBuffers. Otherwise, replicate the single gl_FragColor (or the fixed-function color) to the N _ColorDrawBuffers. A few more changes and simplifications can follow from this...
2006-03-02implementation of _swrast_BlitFramebuffer()Brian Paul1-4/+754
2006-03-01_swrast_blit_framebuffer() functionBrian Paul1-0/+40