summaryrefslogtreecommitdiff
path: root/src/mesa/main/framebuffer.c
AgeCommit message (Collapse)Author
2011-03-14mesa: fix up assertion in _mesa_source_buffer_existsMarek Olšák
This was probably missed when implementing luminance and luminance alpha render targets. _mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE. This fixes: main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.
2011-03-02Revert "mesa: reduce calls to _mesa_test_framebuffer_completeness()"Brian Paul
This reverts commit 1f9a0a4e6e5566c36c781add5f1e62af3efdfb58. This caused trouble with Lightsmark w/ i965 driver and fbo/fbo-blit-d24s8 (see bug 34894). It's probably something simple but no time to debug now.
2011-02-28mesa: remove some old do-nothing codeBrian Paul
2011-02-28mesa: reduce calls to _mesa_test_framebuffer_completeness()Brian Paul
when updating/validating framebuffer state. The _Status field is set to zero when we need to recompute _Status. Otherwise, it's up to date.
2011-02-05mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)Dave Airlie
This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new constant to say that the driver can support sRGB enabled FBOs since enabling the extension doesn't mean the driver can actually support sRGB. Also adds the suggested state flush in the core code suggested by Brian. fix the ARB_fbo color encoding. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-03mesa: Use the common logic for "is this baseformat a color format?"Eric Anholt
When figuring out whether a renderbuffer should be used to set the visual bits of an FBO, we were missing important baseformats like GL_RED, GL_RG, and GL_LUMINANCE.
2010-10-23mesa: added cases for GL_EXT_texture_integer formatsBrian Paul
2010-10-21mesa: add GL_RG case to _mesa_source_buffer_exists()Brian Paul
Fixes failure with glReadPixels(format=GL_RG)
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-13Drop GLframebuffer typedef and just use struct gl_framebufferKristian Høgsberg
2010-10-13Rename GLvisual and __GLcontextModes to struct gl_configKristian Høgsberg
2010-08-26mesa: fix mixed-up function call nameBrian Paul
2010-08-26mesa: Identify packed depth/stencil buffers using the Format field.Nick Bowler
Intel sometimes uses packed depth/stencil buffers even when only a depth buffer or only a stencil buffer was requested. Common code currently uses the _BaseFormat field to determine whether a depth/stencil wrapper is necessary. But unless the user explicitly requested a packed depth/stencil buffer, the _BaseFormat field does not encode this information, and the required wrappers are not created. The problem was introduced by commit 45e76d2665b38b ("mesa: remove a bunch of gl_renderbuffer fields"), which killed off the _ActualFormat field upon which the decision to create a wrapper used to be made. This patch changes the logic to use the Format field instead, which is more like the old code. Fixes fdo bug 27590. Signed-off-by: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-28intel: Implement EGL_KHR_surfaceless extensionKristian Høgsberg
2010-06-23mesa: fix assertion failure for GL_ALPHA FBOsMarek Olšák
2010-06-10mesa: Allow GL_ALPHA FBOs with ARB_framebuffer_object.Eric Anholt
Drivers still reject them today, but cairo would like to use these.
2010-04-29mesa: added _mesa_print_framebuffer() for debuggingBrian Paul
2010-03-10mesa: added new function commentsBrian Paul
2010-03-03mesa: Remove checks of Visual.rgbModeIan Romanick
This must always be true now, so there is no reason to check it. Ever. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-02-21mesa: Add assert to check for null pointer dereference.Vinson Lee
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg
2010-02-19mesa: replace _mesa_bzero() with memset()Brian Paul
2010-02-03mesa: Factor out the fb initialization details from _mesa_new_framebuffer.Francisco Jerez
This should make things easier for drivers wanting to work with a "subclass" of gl_framebuffer. The complementary "_mesa_initialize_framebuffer" function is now called "_mesa_initialize_window_framebuffer" for the sake of symmetry. Signed-off-by: Brian Paul <brianp@vmware.com>
2009-12-09mesa: Move OES_read_format support from drivers into the core.Eric Anholt
The assertion is that the correct read type to be using is the native type of the underlying read renderbuffer. For some fallback paths, this may be worse than GL_RGBA/GL_UNSIGNED_BYTE for reads today, but it gets all drivers the expected GL_BGRA/GL_UNSIGNED_BYTE for ARGB8888 or GL_BGR//GL_UNSIGNED_SHORT_5_6_5_REV for rgb565 with no work. This fixes the intel (and other) DRI drivers to report read formats that should hit blit PBO readpixels paths.
2009-10-08mesa: remove a bunch of gl_renderbuffer fieldsBrian Paul
_ActualFormat is replaced by Format (MESA_FORMAT_x). ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are all replaced by MESA_FORMAT_x queries.
2009-08-08mesa: update framebuffer status as needed in _mesa_source/dest_buffer_exists()Brian Paul
2009-08-07mesa: test DrawBuffer, not ReadBuffer in _mesa_dest_buffer_exists()Brian Paul
Also, update comments.
2009-03-12mesa: add missing _glthread_INIT_MUTEX in _mesa_new_framebuffer()Keith Whitwell
2009-03-07mesa: remove last of _mesa_unreference_framebuffer() callsBrian Paul
2009-02-09mesa: rework _mesa_reference_framebuffer() to look like ↵Brian Paul
_mesa_reference_renderbuffer() _mesa_unreference_framebuffer() is deprecated since _mesa_reference_framebuffer(ptr, NULL) can be used instead.
2009-01-27mesa: move call to _mesa_update_framebuffer_visual()Brian Paul
Update the visual info in the _mesa_test_framebuffer_completeness() function when we've determined the FBO to be "complete". Fixes regression seen in progs/demos/shadowtex.c
2009-01-22mesa: avoid calling _mesa_test_framebuffer_completeness() more than neededBrian Paul
When we change a FBO's attachments, set _Status=0. Before using an FBO, check if status != GL_FRAMEBUFFER_COMPLETE. Also, fix missing GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE status.
2009-01-22mesa: update Visual.samples field in _mesa_update_framebuffer_visual()Brian Paul
2009-01-22mesa: update update_framebuffer_size() for ARB_fbo and mixed renderbuffer sizesBrian Paul
2008-09-23mesa: Apply MSVC portability fixes from Alan Hourihane.José Fonseca
2008-09-21mesa: refactor: move _mesa_resizebuffers(), _mesa_ResizeBuffersMESA() to ↵Brian Paul
framebuffer.c (cherry picked from commit 9091015a9782ad15e58540a8fd61df83ea2bfe31)
2008-09-02fix BUFFER_DEPTH/BUFFER_ACCUM mix-upBrian Paul
2008-01-22Fix some issues with glDrawBuffer(GL_NONE), bug 14198Brian
Set _ColorDrawBuffers[0] = NULL if no renderbuffers enabled. Check that _ColorDrawBuffers[0] is non-null before dereferencing in a few places.
2008-01-06Replace gl_framebuffer's _ColorDrawBufferMask with _ColorDrawBufferIndexesBrian
Each array element is now a BUFFER_x token rather than a BUFFER_BIT_x bitmask. The number of active color buffers is specified by _NumColorDrawBuffers. This builds on the previous DrawBuffer changes and will help with drivers implementing GL_ARB_draw_buffers.
2008-01-06Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.Brian
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...
2007-08-16Rework the GL_READ_BUFFER, GL_DRAW_BUFFER state repairs that Roland ↵Brian
previously did. Basically, in update_framebuffer() (which should be called after an FBO is bound with MakeCurrent or BindFramebuffer) we check if the FBO is a window-system FBO. If it is, update the FBO's GL_READ/DRAW_BUFFER state according to the context state. Old code still in place but disabled with #if 0 / #endif.
2007-08-16update comments, etc related to Read/DrawBuffer stateBrian
2007-08-13Implement mutex/locking around texture object reference counting.Brian
Use new _mesa_reference_texobj() function for referencing/unreferencing textures. Add new assertions/tests to try to detect invalid usage of deleted textures.
2007-07-19fix mesa's handling of fbo's / window fb (again)Roland Scheidegger
Make sure the relevant fields in window fbs get updated at appropriate time (those are NOT the same as fbos!!!), and fix up related code accordingly. This is a bit ugly, but there's a reason the issues section in EXT_fbo is a couple hundred pages long... Hopefully correct now.
2007-07-19fix up mesa's probably bogus framebuffer updates with different read/write fbsRoland Scheidegger
Conflicts: src/mesa/main/framebuffer.c
2007-07-11Minor clean-up of polygon offset logic. Properly compute _MRD field.Brian
2007-03-25Fix some renderbuffer reference counting issues. Also fixes a mem leak.Brian
2007-03-16Assorted fixes for dealing with zero-size frame/renderbuffers.Brian
In xmesa_check_and_update_buffer_size() handle xmctx==NULL correctly: still call _mesa_resize_framebufer(). If we don't we can wind up in a situation where the framebuffer size is non-zero but an attached renderbuffer size is still initialized to zero. This inconsistancy can later cause problems. Check for zero-size renderbuffers in update_color_draw_buffers() and update_color_read_buffer(). See bug 7205.
2007-03-06unreference old framebuffer, if needed, in _mesa_reference_framebuffer()Brian
2007-03-06Fix/improve framebuffer object reference counting.Brian
Use _mesa_reference_framebuffer() and _mesa_unreference_framebuffer() functions to be sure reference counting is done correctly. Additional assertions are done too. Note _mesa_dereference_framebuffer() renamed to "unreference" as that's more accurate.