aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: Create OGL state tracker wrappers for various CPU access operations.Thomas Hellstrom2009-04-171-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are two usage types of buffer CPU accesses: One where we try to use the buffer contents for multiple draw commands in a batch. (batch := sequence of commands that are flushed together), like incrementally adding bitmaps to a bitmap texture that is reallocated on flush. And one where we assume we can safely overwrite the old buffer contexts, like glTexSubImage. In this case we need to make sure all old drawing commands referencing the buffer are flushed before we map the buffer. This is easily forgotten. Add wrappers for the most common of these operations. The first type is prefixed with "st_no_flush" and the second type is prefixed with "st_cond_flush", where "cond" indicates that we attmpt to only flush if there is indeed unflushed draw commands referencing the buffer. Prefixed functions are screen::get_tex_transfer pipe_buffer_write pipe_buffer_read pipe_buffer_map Please use the wrappers whenever possible. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
* gallium: Make sure we flush before some texture / buffer operations.Thomas Hellstrom2009-04-151-1/+21
| | | | | | | Also implement context member functions to optimize away those flushes whenever possible. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
* gallium: remove pipe_texture::compressed fieldBrian Paul2009-04-101-1/+0
| | | | | The format field encodes compressed vs. uncompressed already. We can easily check if a texture is compressed with pf_is_compressed(texture->format).
* st: remove unneeded "is compressed" checkBrian Paul2009-04-091-2/+1
| | | | The format indicates compressed vs. uncompressed.
* st: remove comp_byte parameter to st_texture_create()Brian Paul2009-04-091-2/+1
| | | | We can determine if the texture is compressed by checking the format.
* gallium: Remove remnants of reference counting internals outside of p_refcnt.h.Michel Dänzer2009-03-231-1/+1
|
* st: update texture commentsBrian Paul2009-03-181-7/+5
|
* gallium: Use struct pipe_atomic for pipe refcounts.Thomas Hellstrom2009-03-161-1/+1
| | | | Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
* gallium: Remove do_flip argument from surface_copyJakob Bornecrantz2009-03-131-1/+0
| | | | | | | I should have gotten most uses and implementation correctly fixed, but things might break. Feel free to blame me.
* gallium: Remove some superfluous instances of #include "p_inlines.h".Michel Dänzer2009-03-041-1/+0
|
* gallium: Unify reference counting.Michel Dänzer2009-03-041-5/+5
| | | | | | | | | | | | | | 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().
* mesa: use an array for current texture objectsBrian Paul2009-02-211-1/+1
| | | | Use loops to consolidate lots of texture object code.
* gallium: No longer allow CPU mapping surfaces directly.Michel Dänzer2009-02-051-17/+19
| | | | | | | | | | 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.
* gallium: add st_set_teximage_surface for EXT_texture_from_pixmapBen Skeggs2008-11-131-0/+47
| | | | support.
* gallium: remove the copyHeight hack for compresssed formatsBrian Paul2008-09-041-4/+1
|
* mesa: Remove unused var.José Fonseca2008-09-041-1/+0
|
* gallium: added st_bind/release_teximage() functionsBrian Paul2008-09-011-0/+92
|
* gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.hBrian Paul2008-08-241-1/+0
| | | | Also, rename p_tile.[ch] to u_tile.[ch]
* gallium: move pipe_copy_rect(), pipe_fill_rect() protos into new u_rect.h headerBrian Paul2008-08-221-0/+1
|
* mesa: Prefix main includes with dir to avoid conflicts.José Fonseca2008-07-241-1/+1
| | | | | Some of the headers in src/mesa/main have pretty common names which easily conflict with third-party code, e.g. config.h
* gallium: Finer grained is_format_supported.José Fonseca2008-07-191-1/+2
|
* gallium: Drop pipe_texture->cpp and pipe_surface->cpp.José Fonseca2008-06-271-14/+12
| | | | | The chars-per-pixel concept falls apart with compressed and yuv images, where more than one pixel are coded in a single data block.
* gallium: fix out of tex memory crashesBrian Paul2008-05-081-1/+4
|
* gallium: fix some render to texture bugsBrian Paul2008-05-071-0/+16
| | | | | | | | | | | | | | | 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...
* gallium: Add texture usage flags, special-case allocation of display targetsKeith Whitwell2008-05-021-1/+3
| | | | | | | | | | | 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.
* gallium: use screen->tex_surface_release()Brian Paul2008-05-011-2/+2
|
* gallium: tex surface checkpointKeith Whitwell2008-05-011-11/+23
|
* gallium: use new buffer wrapper functions in p_inlines.hBrian Paul2008-04-301-1/+0
| | | | This allows us to remove most of the direct references to winsys in the state tracker.
* gallium: fix the compressed texture hack in st_texture_image_copy()Brian Paul2008-04-251-3/+2
| | | | | Actually, the hack is still there and needs to be revisited, but I get a bit further with compressed textures now.
* gallium: fix Element() macro redefinition warningBrian2008-03-271-0/+2
|
* gallium: added a texture format sanity check/assertion in st_texture_create()Brian Paul2008-02-281-0/+1
| | | | make sure the tex format is actually supported by the driver.
* gallium: remove pipe_context->texture_create/release/get_tex_surface()Brian2008-02-271-6/+10
| | | | These functions are now per-screen, not per-context.
* gallium: replace some ordinary assignments with pipe_reference_texture()Brian2008-02-201-3/+6
| | | | This fixes at least one instance of dereferencing an invalid texture pointer.
* gallium: pipe->surface_copy can flip the contents vertically when necessary.Michel Dänzer2008-02-131-0/+1
| | | | Fixes gears being upside down on the box in demos/gearbox.
* gallium: remove unused first_level param from st_texture_create()Brian2008-02-121-4/+2
|
* gallium: clean-up, simplification of mipmapped texturesBrian2008-02-121-9/+26
| | | | | | | | Remove pipe_texture->first_level (always implicitly zero). This means there's never any unused mipmap levels at the top. In the state tracker, we no longer re-layout mipmapped textures if the MinLod/MaxLod texture parameters change. It's up to the driver to obey the pipe_sampler->min/max_lod clamps.
* gallium: change pipe->texture_create() to operate like the CSO functionsBrian2008-02-061-18/+13
| | | | Now, pass in a template object and return a new object.
* comments, clean-ups, constsBrian2008-02-061-12/+18
|
* gallium: minor cleanups to pipe interfaceKeith Whitwell2008-01-261-6/+29
| | | | | - Remove put/get tile, just have users call put_tile_raw, etc directly. - Remove surface_data call, just map it locally.
* gallium: Make texture target an enum for better debuggability.Michel Dänzer2008-01-041-2/+2
| | | | Also make enum pipe_format used in a couple more places.
* Remove internal_format field from struct pipe_texture.Michel Dänzer2007-12-111-4/+2
| | | | It's state tracker specific / not really necessary anyway.
* Eliminate struct pipe_region.Michel Dänzer2007-12-071-5/+4
| | | | | Directly use struct pipe_buffer_handle for storage and struct pipe_surface for (un)mapping.
* Hide texture layout details from the state tracker.Michel Dänzer2007-12-061-0/+276
pipe->get_tex_surface() has to be used for access to texture image data.