Commit Graph

32 Commits

Author SHA1 Message Date
Brian Paul
f4d744af24 softpipe: clean up the buffer clear and tile cache code a little 2009-04-06 15:31:58 -06:00
Brian Paul
5d3b1494b6 softpipe: add additional surface formats in tile cache code 2009-04-03 15:43:13 -06:00
Brian Paul
9808ae688a softpipe: more texture transfer fixes.
Need to null-out pointers after freeing transfer objects.
Fix mix-ups between tc->transfer and tc->tex_trans fields.
2009-03-18 10:24:19 -06:00
Brian Paul
71e3aa14fb softpipe: need to set tc->transfer=NULL after destroying the transfer object
This fixes a number of crashes/regressions in programs such as lodbias.c,
mipmap_limits.c, etc.
2009-03-18 10:24:19 -06:00
Michel Dänzer
5e27cd46c0 gallium: Unify reference counting.
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-04 11:58:48 +01:00
Michel Dänzer
3bd7c5ceff Merge branch 'gallium-texture-transfer'
Conflicts:
	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-02-18 16:43:02 +01:00
Brian Paul
07855a1d76 softpipe: some improvements to texture tile cache
Use a somewhat better function in tex_cache_pos() to get better caching.

Increase number of cache entries to 50.

Also fix a texture invalidation bug.  If texture is marked as modified,
invalidate all texture tiles.
2009-02-16 18:53:45 -07:00
Michel Dänzer
5af34758e3 gallium: Fix a couple of potential NULL pointer dereferences.
A lot more test programs work.
2009-02-12 20:13:36 +01:00
Michel Dänzer
2142bf5e17 softpipe: Unbreak keeping track of cached surface.
glxgears works.
2009-02-12 19:43:43 +01:00
Michel Dänzer
479d929530 Cosmetic: Rename struct pipe_transfer pointers from 'ps' to 'pt'.
Missed these for the initial gallium-texture-transfer commit.
2009-02-12 19:39:30 +01:00
Michel Dänzer
4617981ec7 gallium: No longer allow CPU mapping surfaces directly.
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-05 19:41:18 +01:00
Zack Rusin
5069bfed29 gallium: remove pipe_buffer from surfaces
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-02-02 23:47:16 -05:00
Brian
0b9e96fae9 softpipe: remove old/unneeded dependencies between TGSI exec and softpipe
Use tgsi_sampler struct as a base class.  Softpipe subclasses it and adds
the fields it needs.
2008-11-23 19:15:15 -07:00
Brian Paul
4f25420bdd gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.h
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-24 17:48:55 -06:00
Brian Paul
fdb7dc889f softpipe: add support for PIPE_FORMAT_X8Z24_UNORM, PIPE_FORMAT_Z24X8_UNORM 2008-08-07 15:14:52 -06:00
José Fonseca
fd6865c7e5 softpipe: Remove unused variables. 2008-07-24 21:23:09 +09:00
José Fonseca
36dd89c8a7 util: Eliminate pipe from the arguments to pipe_get/put_tile_xxx functions.
You don't need a pipe_context * for this, and all other necessary info is
already inside pipe_surface.
2008-07-13 23:37:40 +09:00
Brian Paul
f38bb10969 gallium: fix some surface usage bugs
When a surface is created with GPU_WRITE that really means "GPU render"
and that can involve reads (blending).  Set surface usage to
PIPE_BUFFER_USAGE_CPU_READ + WRITE.  Fixes progs/demos/lodbias demo.

Also, mark texture as 'modified' when mapped for writing so that the tile
cache can know when to freshen a cached tile.  Fixes glTexSubImage2D().
2008-06-20 15:58:19 -06:00
Brian Paul
12bb907522 gallium: fix some PIPE_FORMAT_Z24S8_UNORM bugs in softpipe driver 2008-05-30 15:07:58 -06:00
Keith Whitwell
09e6be9b57 Merge commit 'origin/gallium-0.1' into gallium-tex-surfaces
Conflicts:

	src/mesa/state_tracker/st_atom_sampler.c
	src/mesa/state_tracker/st_cb_texture.c
2008-05-06 07:45:28 +01:00
Brian Paul
cc2af38f2a gallium: fix typos, comments, whitespace 2008-05-02 09:31:38 -06:00
Keith Whitwell
27e46611f0 softpipe: use CPU flags for mapping
But when creating surfaces, adjust incoming flags from GPU->CPU usage.
2008-05-01 12:00:45 +01:00
Keith Whitwell
c9ed86a964 gallium: tex surface checkpoint 2008-05-01 12:00:45 +01:00
Brian Paul
18f4d96265 gallium: replace old PIPE_FORMAT_U_S8 with PIPE_FORMAT_S8_UNORM 2008-04-30 16:51:52 -06:00
Keith Whitwell
09b6686158 softpipe: make NUM_ENTRIES 32 so that div/mods are easier 2008-04-22 11:02:24 +01:00
Brian
4b39ba7216 gallium: set tc->surface_map = NULL after unmapping 2008-03-19 11:14:18 -06:00
Brian
6f715dcc21 gallium: remove pipe_context->texture_create/release/get_tex_surface()
These functions are now per-screen, not per-context.
2008-02-27 14:21:12 -07:00
Brian
4da19dbcaa gallium: remove pipe parameter from pipe_texture_reference()
Added pipe field to pipe_texture (temporary, see comments).
First step toward context-less texture creation...
2008-02-26 19:31:22 -07:00
Brian
d5640a2dbd gallium: new pipe->texture_update() function
Called whenever texture data is changed (glTexImage, glTexSubImage,
glCopyTexSubImage, etc).
2008-02-20 13:24:52 -07:00
Brian
22a0b85eae gallium: use pipe_texture_reference() in sp_tile_cache_set_texture() 2008-02-20 11:15:59 -07:00
José Fonseca
6acd63a498 Code reorganization: update build.
Update the Makefiles and includes for the new paths.

Note that there hasn't been no separation of the Makefiles yet, and make is
jumping all over the place. That will be taken care shortly. But for now, make
should work. It was tested with linux and linux-dri. Linux-cell and linux-llvm
might require some minor tweaks.
2008-02-15 17:50:12 +09:00
José Fonseca
b642730be9 Code reorganization: move files into their places.
This is in a separate commit to ensure renames are properly preserved.
2008-02-15 17:45:40 +09:00