Commit Graph

17 Commits

Author SHA1 Message Date
Marek Olšák
6b919b1b2d gallium/util: implement layered framebuffer clear in u_blitter
All bound layers (from first_layer to last_layer) should be cleared.

This uses a vertex shader which outputs gl_Layer = gl_InstanceID, so each
instance goes to a different layer. By rendering a quad and setting
the instance count to the number of layers, it will trivially clear all
layers.

This requires AMD_vertex_shader_layer (or PIPE_CAP_TGSI_VS_LAYER), which only
radeonsi supports at the moment. r600 could do this too. Standard DX11
hardware will have to use a geometry shader though, which has higher overhead.
2013-12-03 19:39:13 +01:00
Marek Olšák
17350ea979 gallium/u_blitter: make clearing independent of the number of bound colorbuffers
We can use the fragment shader TGSI property WRITES_ALL_CBUFS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-13 03:54:13 +02:00
Marek Olšák
de1c38299c gallium/util: make WRITES_ALL_CBUFS optional in the passthrough fragment shader
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-13 03:54:13 +02:00
Marek Olšák
355d463f73 gallium/util: fix glClear with MRT by making the FS write to all cbufs
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
825b45366d gallium/u_blitter: implement blitting multisample resources
It can blit only one sample at a time (it should be called in a loop).
2012-08-15 19:20:57 +02:00
Marek Olšák
bdaf0a085b gallium/u_blitter: accelerate stencil-only copying
This doesn't seem to be used by anything yet, but better safe than sorry.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
12fd81f9e7 gallium/u_blitter: accelerate depth-stencil copying using shader stencil export
This fixes stencil buffer write transfers on r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
8a9a37cebe gallium: utility helper functions for stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
5d4d8b6205 u_blitter: interpolate clear color using a GENERIC varying instead of COLOR
There are also some u_simple_shaders changes.

On r300, the TGSI_SEMANTIC_COLOR varying is a fixed-point number clamped
to the range [0,1] and limited to 12 bits of precision. Therefore we can't
use it for passing through a clear color in order to clear high precision
texture formats.

This also makes u_blitter use only one vertex shader instead of two.
2010-11-28 17:45:39 +01:00
Brian Paul
d18fb4822b gallium: add interpolation parameter to simple shader functions
This lets us specify linear interpolation instead of perspective
interpolation for blit operations.  Might be a bit faster.
2010-06-03 08:54:15 -06:00
Marek Olšák
dff4c9ed55 util: add new fragment shaders to simple_shaders
New shaders:
* Fragment shader which writes depth sampled from a texture
* Fragment shader which copies COLOR[0] to multiple render targets

Additional improvements:
* The fragment 'tex' shaders now take a sampler type (TGSI_TEXTURE_*)
  so that they can sample from any type of texture, not only from a 2D one.
2009-12-15 17:59:50 +00:00
Keith Whitwell
862724d3c2 util: add version of u_blit_pixels which takes a writemask
Values outside the writemask are set in the destination to {0,0,0,1}
2009-09-03 16:07:45 -06: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
José Fonseca
85b0c171c0 mesa: Free the util shaders with the gallium's FREE. 2009-02-19 13:29:04 +00:00
Brian
dccbfd8bf0 gallium: return pipe_shader_state from the simple shader functions
Allows us to fix a mem leak (tokens array).
2008-03-27 15:43:32 -06:00
Brian
6a9a3afcf9 gallium: added util_make_fragment_passthrough_shader() 2008-03-20 09:11:27 -06:00
Brian
31970c4633 gallium: utilities for creating simple vertex/fragment shaders 2008-03-18 17:18:10 -06:00