Commit Graph

119 Commits

Author SHA1 Message Date
Michal Krol
63cb6f59ea gallium: Remove bypass_vs_clip_and_viewport from rasteriser state.
Needs testing.
2010-02-22 21:36:22 +01:00
Roland Scheidegger
263406addb gallium: give pipe_stencil_ref its own cso_save/restore functions
seems cleaner, and other dynamic state like viewport is handled that way too
2010-02-11 18:15:10 +01:00
Roland Scheidegger
b75adabc89 gallium: also save/restore stencil_ref in cso_save/restore_depth_stencil_alpha
makes life of state trackers easier
2010-02-11 04:06:01 +01:00
Roland Scheidegger
dfc02e3784 st/mesa: more fixes for stencil ref change.
compiles. Might need to do something to make it possible to save/restore
stencil ref.
2010-02-10 21:14:18 +01:00
José Fonseca
28486880ca gallium: pipe/p_inlines.h -> util/u_inlines.h 2010-02-02 14:42:17 +00:00
Roland Scheidegger
9b346f83a7 Merge commit 'origin/perrtblend'
Conflicts:
	src/gallium/drivers/softpipe/sp_screen.c
	src/gallium/include/pipe/p_defines.h
2010-01-28 17:23:58 +01: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
Roland Scheidegger
bef610f693 gallium: prepare for per-rendertarget blend enables, writemasks, blend funcs
GL 3.0 (EXT_draw_buffers2) and other APIs allow independent blend enables and
write masks per render target, ARB_draw_buffers_blend (and other APIs) also
allow independent blend functions. Things like dithering, logic ops however
are not extended to be per rendertarget, that might be conceptually possible
however it doesn't look like any API wants to expose this.
2010-01-20 18:26:49 +01:00
Vinson Lee
6906bf08cc st/mesa: Remove unnecessary headers from st_cb_clear.c. 2010-01-15 23:02:07 -08:00
Brian Paul
fd5511d27f mesa: implement per-buffer color masking
This is part of the GL_EXT_draw_buffers2 extension and part of GL 3.0.

The ctx->Color.ColorMask field is now a 2-D array.  Until drivers are
modified to support per-buffer color masking, they can just look at
the 0th color mask.

The new _mesa_ColorMaskIndexed() function will be called by
glColorMaskIndexedEXT() or glColorMaski().
2009-12-29 16:17:14 -07:00
Michal Krol
0bed834be4 Move pf_is_depth_and_stencil() to u_format auxiliary module. 2009-12-03 10:20:49 +01:00
Brian Paul
1f196b786d Merge branch 'texformat-rework'
Conflicts:
	src/mesa/drivers/dri/radeon/radeon_fbo.c
	src/mesa/drivers/dri/s3v/s3v_tex.c
	src/mesa/drivers/dri/s3v/s3v_xmesa.c
	src/mesa/drivers/dri/trident/trident_context.c
	src/mesa/main/debug.c
	src/mesa/main/mipmap.c
	src/mesa/main/texformat.c
	src/mesa/main/texgetimage.c
2009-10-28 21:24:11 -06:00
Brian Paul
45e76d2665 mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x).
ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are
all replaced by MESA_FORMAT_x queries.
2009-10-08 20:27:27 -06: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
Keith Whitwell
2420b283b7 mesa/st: recognize no-op scissor state when checking clear_with_quads
Some apps enable scissor but set the rectangle to the dimensions of
the window.  Don't let this force us onto a slower clear path.
2009-07-29 12:48:04 +01:00
José Fonseca
de413b1ba9 mesa: Use new pf_is_depth_and_stencil inline. 2009-06-11 19:02:59 +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
Michel Dänzer
eb168e26aa gallium: Clean up driver clear() interface.
Only allows clearing currently bound buffers, but colour and depth/stencil in
a single call.
2009-04-04 19:01:51 +02:00
Michel Dänzer
ba14b043bc gallium: Add utility helper for packing combined depth/stencil values. 2009-04-04 16:04:59 +02:00
Michel Dänzer
d332f8b4ef gallium: Remove some little-used fields from struct pipe_surface. 2009-03-26 10:53:47 +01: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
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
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
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
Zack Rusin
a7e72231e3 gallium: standardize naming of masks 2009-01-27 12:20:25 -05: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
Brian Paul
80a718a63b Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/gallium/auxiliary/rtasm/rtasm_execmem.c
	src/mesa/shader/slang/slang_emit.c
	src/mesa/shader/slang/slang_log.c
	src/mesa/state_tracker/st_atom_framebuffer.c
2008-11-05 15:58:09 -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
Brian Paul
6c6c2f1d23 gallium: add some checks for null surface pointers in state tracker
Fixes some segfaults in low memory situations.
2008-10-18 09:55:54 -06:00
Brian Paul
79200c9087 gallium: document that clear color is intentionally always PIPE_FORMAT_A8R8G8B8_UNORM 2008-09-05 10:10:55 -06: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
Michal Krol
6c534b830c st: Silence compiler warnings on Windows. 2008-07-15 11:48:59 +02:00
Brian Paul
4b4ac9ed34 gallium: fix mem leaks 2008-05-20 13:49:18 -06:00
Alan Hourihane
54507125e7 Some changed for non-C99 compilers 2008-05-02 10:30:34 +00:00
Brian Paul
99fba5466b gallium: use new buffer wrapper functions in p_inlines.h
This allows us to remove most of the direct references to winsys in the state tracker.
2008-04-30 10:43:59 -06:00
Brian Paul
a770d40c3d gallium: use cso_destroy_vertex/fragment_shader() functions
Also, rearrange the st_destroy_context() code a bit to prevent some
invalid/NULL ptr derefs during tear-down.
2008-04-24 12:15:05 -06:00
Keith Whitwell
01dfa6cde1 use cso fs/vs handle functions 2008-04-21 20:52:54 +01:00
Michel Dänzer
65efe807b9 gallium: Use CSO cache for shaders. 2008-04-21 17:51:39 +01:00
Michel Dänzer
073d9a28c2 gallium: Always pass colour clear value to driver as A8R8G8B8. 2008-04-18 13:38:06 +01:00
Brian
124e1345c9 gallium: set rasterizer.gl_rasterization_rules = 1 in a few more places 2008-04-03 13:16:37 -06:00
Brian Paul
ce5c867cbb gallium: streamline viewport/raster/shader state for clearing with quads
Move init of these items to new st_init_clear().
2008-04-03 12:54:32 -06:00
Brian Paul
c4f8c8b304 gallium: remove the temporary/test TEST_DRAW_PASSTHROUGH code 2008-04-03 12:44:58 -06:00
Brian Paul
4f67a3f7d3 gallium: use identity viewport fix broken clear_with_quad() path
Since bypass_clipping is set and we're specifying quad vertexes in window
coords, setup identity viewport.
2008-04-03 12:42:26 -06:00
Brian
6f8286163c gallium: Update calls to the simple shader functions 2008-03-27 15:43:32 -06:00
Brian
c2044eaca9 gallium: in clear_with_quad() check fb orientation, invert Y if needed 2008-03-20 15:04:08 -06:00
Brian
e1406c8d23 gallium: create one vertex buffer and re-use, also enable bypass_clipping
Quad clears should be a little more efficient now.
2008-03-20 10:46:44 -06:00