summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.c
AgeCommit message (Collapse)Author
2009-07-30mesa st: Report unsupported render-to-texture formats.Thomas Hellstrom
If a texture image is bound to a framebuffer for render-to-texture, but the hardware doesn't support rendering to its internal format, report the framebuffer as incomplete with FRAMEBUFFER_UNSUPPORTED. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2009-06-11Merge branch 'mesa_7_5_branch'José Fonseca
Conflicts: src/mesa/state_tracker/st_cb_fbo.c src/mesa/state_tracker/st_framebuffer.c
2009-06-10mesa: Pure software accum buffer.José Fonseca
The existing implementation was already implemented on software, but relied on the pipe driver to always support the R16G16B16A16_SNORM format. This patch eliminates that, without prejudice against a future hardware-only implementation. It also avoids some of the short <-> float conversions, and only does a read transfer of the color buffer on GL_RETURN if absolutely necessary.
2009-05-01Merge branch 'mesa_7_5_branch'Brian Paul
2009-05-01st: create renderbuffer's pipe_surface in st_render_texture()Brian Paul
Previously we created the pipe_surface during framebuffer validation. But if we did a glCopyTex[Sub]Image() before anything else we wouldn't yet have the surface. This fixes that.
2009-05-01st: when creating an on-demand front color buffer, init to back buffer imageBrian Paul
When we create a new front color buffer (user called glDrawBuffer(GL_FRONT)) initialize it to the contents of the back buffer. Any previous call to SwapBuffers() would have done that in effect, so make it reality.
2009-05-01st: added st_renderbuffer::defined flagBrian Paul
Indicates whether there's defined image contents, or garbage/don't care. This is set when we draw into a renderbuffer and cleared when we resize/ reallocate a renderbuffer or do a buffer swap (back buffer becomes undefined). We use this to determine whether the front color buffer has been drawn to, and whether to display its contents upon glFlush/Finish(), when the new st_swapbuffers() function is used.
2009-05-01st: when double buffered, only create front color buffer on demandBrian Paul
Before we always created the front color buffer, even if was never used. This can save some memory.
2009-04-09st: rearrange some code to be a little more clearBrian Paul
2009-04-09gallium: remove unneeded compressed=0 assignmentBrian Paul
2009-03-04gallium: Remove some superfluous instances of #include "p_inlines.h".Michel Dänzer
2009-03-04gallium: Unify reference counting.Michel Dänzer
The core reference counting code is centralized in p_refcnt.h. This has some consequences related to struct pipe_buffer: * The screen member of struct pipe_buffer must be initialized, or pipe_buffer_reference() will crash trying to destroy a buffer with reference count 0. u_simple_screen takes care of this, but I may have missed some of the drivers not using it. * Except for rare exceptions deep in winsys code, buffers must always be allocated via pipe_buffer_create() or via screen->*buffer_create() rather than via winsys->*buffer_create().
2009-03-03gallium: remove old state tracker renderbuffer attachment assertionBrian Paul
Not needed since renderbuffers are ref-counted. Fixes progs/demos/shadowtex.
2009-02-27gallium: add st_validate_framebuffer() driver functionBrian Paul
Gallium only supports combined depth/stencil buffers, not separate ones. If the user tries to create create a FBO with separate depth/stencil renderbuffers mark the FBO as unsupported.
2009-02-16Merge branch 'master' into gallium-texture-transferKeith Whitwell
Conflicts: src/mesa/state_tracker/st_cb_accum.c src/mesa/state_tracker/st_cb_drawpixels.c
2009-02-12mesa: use new ST_CALLOC_STRUCT() macro in gallium state trackerBrian Paul
2009-02-12mesa: consistantly use mesa memory-functions in gallium state trackerBrian Paul
Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc. Still using CALLOC_STRUCT() at this point.
2009-02-09mesa: merge gallium-0.2 into gallium-master-mergeBrian Paul
Merge commit 'origin/gallium-0.2' into gallium-master-merge Conflicts: Makefile docs/relnotes-7.4.html docs/relnotes.html src/mesa/drivers/dri/i965/brw_wm.h src/mesa/main/imports.c src/mesa/main/mtypes.h src/mesa/main/texcompress.c src/mesa/main/texenvprogram.c src/mesa/main/version.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_draw.c
2009-02-05gallium: No longer allow CPU mapping surfaces directly.Michel Dänzer
Instead, a new pipe_transfer object has to be created and mapped for transferring data between the CPU and a texture. This gives the driver more flexibility for textures in address spaces that aren't CPU accessible. This is a first pass; softpipe/xlib builds and runs glxgears, but it only shows a black window. Looks like something's off related to the Z buffer, so the depth test always fails.
2009-02-02gallium: remove pipe_buffer from surfacesZack Rusin
this change disassociates, at least from the driver perspective, the surface from buffer. surfaces are technically now views on the textures so make it so by hiding the buffer in the internals of textures.
2009-01-30gallium: make p_winsys internalZack Rusin
move it to pipe/internal/p_winsys_screen.h and start converting the state trackers to the screen usage
2009-01-15mesa: tweak to formattingAlan Hourihane
2009-01-15mesa: small cleanupAlan Hourihane
2009-01-14mesa: handle some cases of 0x0 render targetsAlan Hourihane
2008-12-12gallium: avoid mapping same vertex buffer in subsequent framesKeith Whitwell
Quite a few util modules were maintaining a single vertex buffer over multiple frames, and potentially reusing it in subsequent frames. Unfortunately that would force us into syncrhonous rendering as the buffer manager would be forced to wait for the previous rendering to complete prior to allowing the map. This resolves that issue, but requires the state tracker to issue a few new flush() calls at the end of each frame.
2008-09-17gallium: new assertion on surface->textureBrian Paul
2008-07-04gallium: replace assertion with conditionalBrian Paul
2008-06-27gallium: handle msaaRoland Scheidegger
2008-06-27gallium: Drop pipe_texture->cpp and pipe_surface->cpp.José Fonseca
The chars-per-pixel concept falls apart with compressed and yuv images, where more than one pixel are coded in a single data block.
2008-06-19gallium: remove unused varsBrian Paul
2008-05-26gallium: free renderbuffer's old texture in st_renderbuffer_alloc_storage()Brian Paul
2008-05-09gallium: depth textures have usage depth_stencil instead of render_targetRoland Scheidegger
2008-05-08gallium: re-enable call to init_renderbuffer_bits(), remove dead codeBrian Paul
2008-05-07gallium: fix some render to texture bugsBrian Paul
Before, we were sometimes rendering into a stale texture because st_finalize_texture() would discard the old texture and create a new one. Moved st_update_framebuffer atom after texture validation so that we can create a new renderbuffer surface if the texture changes. Also, split texture validation into two parts: finalize_textures and update_textures. Do finalize_textures first to avoid getting into the situtation where we're doing a pipe->surface_copy() mid-way through state validation. Some debug code still in place, but disabled...
2008-05-06gallium: create drawing surfaces as GPU_READ/WRITE onlyBrian Paul
Create different temporary surfaces for CPU_READ/WRITE when needed (such as for glReadPixels, glAccum, some glCopy/DrawPixels, glCopyTexSubImage, etc).
2008-05-06gallium: create renderbuffer surface w/out CPU_READ/WRITE flagsMichal Danzer
2008-05-02gallium: set template.target = PIPE_TEXTURE_2DBrian Paul
2008-05-02gallium: identify depth-stencil texturesKeith Whitwell
And don't use the display-target path to allocate them.
2008-05-02gallium: Add texture usage flags, special-case allocation of display targetsKeith Whitwell
For many envirionments it's necessary to allocate display targets in a window-system friendly manner. Add facilities so that a driver can tell if a texture is likely to be used to generate a display surface and if use special allocation paths if necessary. Hook up softpipe to call into the winsys->surface_alloc_storage() routine in this case, though we probably want to change that interface slightly also.
2008-05-02gallium: remove usage of winsys->surface_alloc_storage from state trackerKeith Whitwell
Allocate a texture containing storage instead. Also clean up ACCUM buffer allocation slightly -- drivers will need some changes to texture allocation logic to accomodate the concept of a texture that will only as image storage by the CPU, but it's cleaner than it was.
2008-05-01gallium: tex surface checkpointKeith Whitwell
2008-04-30gallium: use new buffer wrapper functions in p_inlines.hBrian Paul
This allows us to remove most of the direct references to winsys in the state tracker.
2008-04-29gallium: added some assertions to st_render_texture() to check surface formatBrian Paul
Make sure we can really render to the texture surface given its format.
2008-04-25gallium: Tell the driver the texture is updated when we finish rendering to it.Michel Dänzer
2008-04-24gallium: Initial support for pixel formats with unused storage components.Michel Dänzer
Also clarify that RGB formats with no (used) alpha component are treated as having alpha = 1.0.
2008-04-07gallium: accum buffer fixesBrian Paul
If the driver can't create a PIPE_FORMAT_R16G16B16A16_SNORM surface, create an accum surface using a shallower format and taller height. Since only the accum buffer code accesses the surface the actual format doesn't really matter, just that there's enough memory.
2008-04-07gallium: clean-up in st_renderbuffer_alloc_storage()Brian Paul
2008-03-26gallium: Change pipe->flush() interface to optionally return a fence.Michel Dänzer
The cell driver still uses an internal CELL_FLUSH_WAIT flag, in the long run proper fencing should be implemented for it.
2008-02-27gallium: remove pipe_context->texture_create/release/get_tex_surface()Brian
These functions are now per-screen, not per-context.
2008-02-20gallium: state tracker didn't always notify drivers of texobj data changesBrian
Calling glTexSubImage() or glTexImage() to replace texture data didn't reliably cause pipe->set_sampler_texture() to get called so drivers didn't always get notified of new texture data. The st_texture_object->pt pointer doesn't always indicate changed data so added a dirtyData field.