Commit Graph

48 Commits

Author SHA1 Message Date
Roland Scheidegger
ac400ffce6 gallium: interface cleanups, remove nblocksx/y from pipe_texture and more
This patch removes nblocksx, nblocksy arrays from pipe_texture (can be
recalculated if needed). Furthermore, pipe_format_block struct is gone
completely (again, contains just derived state).
nblocksx, nblocksy, block are also removed from pipe_transfer, together with
the format enum (can be obtained from the texture associated with the transfer).
2009-11-30 20:29:18 +01:00
Brian Paul
57e3eb1b17 Merge branch 'mesa_7_6_branch' 2009-10-10 09:25:34 -06:00
Brian Paul
768481ed40 softpipe: revert 564df9dc5f
This change silenced valgrind warnings but broke progs/tests/drawbuffers.
The problem is we don't know the surface's state when we start caching it
(it may or may not be initialized/cleared/etc).  So "clearing" it here was
presumptuous.  Leaving the code in place (but disabled) for reference and
when using valgrind.

Fixes bug 24401
2009-10-10 09:18:14 -06:00
Brian Paul
124f5875ea Merge branch 'mesa_7_6_branch'
Conflicts:

	Makefile
	configs/default
	docs/relnotes.html
	src/gallium/drivers/softpipe/sp_context.c
	src/gallium/drivers/softpipe/sp_tile_cache.c
	src/mesa/main/version.h
2009-09-29 09:46:49 -06:00
Brian Paul
564df9dc5f softpipe: initialize the clear_flags bitvector in sp_create_tile_cache()
This silences tons of valgrind warnings in programs that don't call
glClear(), such as progs/demos/gamma.
2009-09-29 08:51:00 -06:00
Brian Paul
de25f82067 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-09-23 11:00:04 -06:00
Brian Paul
e41707beca softpipe: added max texture/surface size sanity check 2009-09-23 10:50:38 -06:00
Brian Paul
84b956c29b softpipe: increase MAX_WIDTH/HEIGTH 4096 to match max texture size 2009-09-23 10:46:27 -06:00
Keith Whitwell
7670102468 Merge branch 'tex-tilecache' into softpipe-opt
Conflicts:
	src/gallium/drivers/softpipe/sp_state_derived.c
	src/gallium/drivers/softpipe/sp_state_sampler.c
	src/gallium/drivers/softpipe/sp_tex_sample.c
	src/gallium/drivers/softpipe/sp_tex_sample.h
	src/gallium/drivers/softpipe/sp_tile_cache.c
2009-08-23 10:23:46 +01:00
Brian Paul
3adc8c3779 softpipe: minor code refactoring to remove softpipe/tile cache dependencies
The tile cache code now has no hard dependencies on softpipe.
2009-08-21 14:01:58 -06:00
Keith Whitwell
c84abe36a9 softpipe: fix typo in clear_tile 2009-08-18 16:55:10 +01:00
Keith Whitwell
80c78472ad softpipe: split texture and surface tile caches
These do similar jobs but with largely disjoint code.  Will want
to evolve them separately going forward.
2009-08-18 16:55:10 +01:00
Keith Whitwell
19097907ef softpipe: also shortcircuit non-texture tile lookups 2009-07-23 09:35:33 +01:00
Keith Whitwell
f911c3b989 softpipe: shortcircuit repeated lookups of the same tile
The sp_tile_cache is often called repeatedly to look up the same
tile.  Add a cache (to the cache) of the single tile most recently
retreived and make a quick inline check to see if this matches the
subsequent request.

Add a tile_address bitfield struct to make this check easier.
2009-07-22 15:08:42 +01:00
Keith Whitwell
b5d583efef softpipe: make some small steps to flush texture cache less frequently
No performance gain yet, but the code is a bit cleaner.
2009-07-22 12:48:00 +01:00
Keith Whitwell
aa5db68438 softpipe: remove backwards dependency from tilecache to softpipe
The tile cache is a utility, it shouldn't know anything about the
entity which is making use of it (ie softpipe).

Remove softpipe parameter to all the tilecache function calls, and
also remove the need to keep a softpipe pointer in the sampler structs.
2009-07-22 12:47:59 +01:00
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