Commit Graph

85 Commits

Author SHA1 Message Date
Brian Paul
0c728030ed st/mesa: added some bitmap debug code (disabled) 2010-02-18 16:58:39 -07:00
Vinson Lee
218590f707 st/mesa: Silence uninitialized variable warning in st_cb_bitmap.c. 2010-02-10 18:37:46 -08:00
José Fonseca
45dac0d82a Merge branch 'gallium-embedded' 2010-02-03 18:54:13 +00:00
José Fonseca
28486880ca gallium: pipe/p_inlines.h -> util/u_inlines.h 2010-02-02 14:42:17 +00:00
Keith Whitwell
e1906ae98e st/mesa: remove duplicate calculation of fp input mapping
This was being calculated the same way in two different places.
Now just do it in st_translate_fragment_program().
2010-02-01 20:42:34 +00:00
Brian Paul
cd8614b028 Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/auxiliary/draw/draw_context.c
	src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
	src/gallium/auxiliary/pipebuffer/Makefile
	src/gallium/auxiliary/pipebuffer/SConscript
	src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
	src/gallium/auxiliary/tgsi/tgsi_scan.c
	src/gallium/drivers/i915/i915_surface.c
	src/gallium/drivers/i915/i915_texture.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
	src/gallium/drivers/llvmpipe/lp_texture.c
	src/gallium/drivers/softpipe/sp_prim_vbuf.c
	src/gallium/state_trackers/xorg/xorg_dri2.c
	src/gallium/winsys/drm/intel/gem/intel_drm_api.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c
	src/mesa/state_tracker/st_cb_clear.c
2010-01-22 12:17:02 -07:00
José Fonseca
8410f7cde3 mesa: Use pipe_buffer_write_nooverlap where appropriate. 2010-01-21 15:18:40 -08:00
Vinson Lee
e1d4781cd4 st/mesa: Remove unnecessary headers from st_cb_bitmap.c. 2010-01-16 00:08:54 -08:00
Roland Scheidegger
4dcdf3b9c6 Merge commit 'origin/st-shader-varients'
Conflicts:
	src/mesa/state_tracker/st_atom_shader.c
	src/mesa/state_tracker/st_program.c
2009-11-26 01:15:25 +01:00
Brian Paul
133501bef2 mesa: fix assorted compiler warnings 2009-11-17 16:16:30 -07:00
Keith Whitwell
07fafc7c93 mesa/st: refactor vertex and fragment shader translation
Translate vertex shaders independently of fragment shaders.

Previously tried to make fragment shader semantic indexes always start
at zero and exclude holes.  This was unnecessary but meant that vertex
shader translation had to be adjusted to take this into account.

Now use a fixed scheme for labelling special FS input semantics
(color, etc), and another fixed scheme for the generics.

With this, vertex shaders can be translated independently of the bound
fragment shader, assuming mesa has done its own job and ensured that
the vertex shader provides at least the inputs the fragment shader is
looking for.  The state-tracker didn't attempt to do anything about
this previously, so it shouldn't be needed now.
2009-11-15 11:23:30 -08:00
Keith Whitwell
918199fb0f mesa/st: don't reuse vertex buffers for bitmap, clear quads
Currently using max_slots > 1 will cause synchronous rendering
if the driver flushes its command buffers between one bitmap and the
next.

Need to improve buffer_write to allow NO_WAIT (as well as no_flush)
updates to buffers where we know there is no conflict with previous
data.
2009-10-02 19:03:15 +01:00
Brian Paul
1b448c7a5c mesa: consolidate PBO map/unmap helpers
Instead of _mesa_map_readpix_pbo() use _mesa_map_pbo_source().

Instead of _mesa_map_drawpix_pbo() and _mesa_map_bitmap_pbo() use
_mesa_map_pbo_dest().
2009-09-03 11:45:17 -06:00
Brian Paul
d5b6dd0001 st/mesa: use new _mesa_expand_bitmap() function 2009-09-01 17:39:32 -06:00
Brian Paul
4eb7256854 st/mesa: flush bitmap cache if Z value changes
When adding a new bitmap to the cache we have to check if the Z value is
changing and flush first if it is.

This is a modified version of a patch from Justin Dou <justin.dou@intel.com>
2009-08-24 13:04:50 -06:00
Jakob Bornecrantz
439c42ae8b st: Wait to create bitmap transfer until needed 2009-04-19 16:24:41 +01:00
Thomas Hellstrom
e50dd26ca6 gallium: Create OGL state tracker wrappers for various CPU access operations.
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>
2009-04-17 13:18:05 +02:00
Brian Paul
7db7ff878d mesa: merge the prog_src_register::NegateBase and NegateAbs fields
There's really no need for two negation fields.  This came from the
GL_NV_fragment_program extension.  The new, unified Negate bitfield applies
after the absolute value step.
2009-04-14 22:14:30 -06:00
Brian Paul
f122015674 st: remove comp_byte parameter to st_texture_create()
We can determine if the texture is compressed by checking the format.
2009-04-09 15:02:47 -06:00
Keith Whitwell
683e7091a9 gallium: consolidate bypass_vs and bypass_clipping flags
The draw module provides a similar interface to the driver which
is retained as various bits of hardware may be able to take on
incremental parts of the vertex pipeline.  However, there's no
need to advertise all this complexity to the state tracker.

There are basically two modes now - normal and passthrough/screen-coords.
2009-03-13 16:42:57 +00:00
Keith Whitwell
fa0f48504a gallium: no need to keep a copy of shader tokens in state tracker
Any driver who needs a copy of the shader tokens must organize to
do so itself.  This has been the case for a long time, but there
was still defensive code in the state tracker, which is now removed.

Any bugs resulting from this need to be fixed in the offending driver...
2009-03-13 16:24:22 +00:00
Keith Whitwell
fe60dbc536 st: also check for a8 texture support in bitmap code 2009-03-09 15:20:11 +00:00
José Fonseca
50e38b0878 mesa: Clear cache->trans after destroying the transfer. 2009-03-04 16:43:13 +00: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
Keith Whitwell
93d101f0c3 mesa/st: support l8 as well as i8 in bitmap code
Also don't send the partial program fragment down to hardware -- the
program will never be used in that form.
2009-02-24 12:14:50 +00:00
José Fonseca
693fac8ae2 gallium: Add pipe_buffer_write/read inlines.
Saves code, and will simplify future interface changes.
2009-02-24 11:30:25 +00:00
José Fonseca
85b0c171c0 mesa: Free the util shaders with the gallium's FREE. 2009-02-19 13:29:04 +00:00
Keith Whitwell
59d54334c9 Merge branch 'master' into gallium-texture-transfer
Conflicts:

	src/mesa/state_tracker/st_cb_accum.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2009-02-16 19:50:48 +00:00
Brian Paul
f1a59a6dd7 mesa: use new ST_CALLOC_STRUCT() macro in gallium state tracker 2009-02-12 10:14:36 -07:00
Brian Paul
1a2f4dd876 mesa: consistantly use mesa memory-functions in gallium state tracker
Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc.
Still using CALLOC_STRUCT() at this point.
2009-02-12 10:11:55 -07: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
Alan Hourihane
8abc860bd4 Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/gallium/winsys/gdi/SConscript
2008-12-15 11:22:19 +00:00
Keith Whitwell
d2c2e9316d gallium: avoid mapping same vertex buffer in subsequent frames
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-12-12 16:57:39 +00:00
Alan Hourihane
5b71472389 Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/gallium/auxiliary/tgsi/tgsi_sse2.c
2008-11-28 16:18:36 +00:00
Brian Paul
277089b81a gallium: fix glBitmap color bug
By time we get around to rendering the cached bitmap, the current color may
have changed.  Need to make sure we load the constant slot with the cached
color.
2008-11-26 07:08:19 -07:00
José Fonseca
1c6fe6564b softpipe: Don't call pipe_buffer_destroy directly.
Use pipe_buffer_reference instead.
2008-11-03 22:35:24 +09:00
José Fonseca
f637a96e85 gallium: Have pipe_buffer_* receive a pipe_screen instead of a pipe_context.
We want to use the pipe_buffer_* inlines everywhere, but a pipe context
is not always available nor is it needed.
2008-09-03 11:53:39 +09: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
José Fonseca
8aafc03b26 gallium: Finer grained is_format_supported. 2008-07-19 12:32:29 +09:00
Brian Paul
2212c214f1 gallium: fix surface memleak in bitmap code
Found w/ tunnel2.c demo.
2008-07-03 10:12:37 -06:00
José Fonseca
4ddd659679 gallium: Drop pipe_texture->cpp and pipe_surface->cpp.
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-27 19:37:56 +09:00
José Fonseca
5c1a78b7a8 mesa: More signed/unsigned float/integer fixes. 2008-06-24 13:12:41 +09:00
Brian Paul
318f00ae9f gallium: need to flush bitmap cache when raster color changes 2008-06-17 12:20:22 -06:00
José Fonseca
53174afeeb mesa: Apply MSVC portability fixes from Alan Hourihane. 2008-05-31 18:55:40 +09:00
Michel Dänzer
44a7bd0019 gallium: Always unreference bitmap cache texture before resetting the cache.
Fixes assertion failure with tunnel2 demo.
2008-05-27 17:00:59 +01:00
Brian Paul
8f792a0707 Merge branch 'gallium-0.1' into gallium-tex-surfaces 2008-05-20 15:12:50 -06:00
Brian Paul
ac09b0e0eb gallium: fix shader mem leak 2008-05-20 15:11:53 -06:00
Brian Paul
de03e8e960 gallium: remove dead code 2008-05-19 16:07:10 -06:00
Brian Paul
655374bda7 gallium: remove dead code 2008-05-19 16:05:41 -06:00
Brian Paul
b4219e35e2 gallium: fix glBitmap surface memleak in context tear-down 2008-05-16 16:11:00 -06:00