Commit Graph

74 Commits

Author SHA1 Message Date
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
Brian
85e4ec6d11 gallium: use the utility pasthrough shaders
This avoids the Mesa->TGSI translation step.
2008-03-20 09:13:51 -06:00
Brian
7d95efde0a gallium: implement CSO save/restore functions for use by meta operations (blit, gen-mipmaps, quad-clear, etc)
Also, additional cso_set_*() functions for viewport, framebuffer, blend color,
etc. state.
2008-03-19 11:14:18 -06:00
Brian
bab9209e12 gallium: restore additional state after clearing with quad 2008-03-18 17:18:10 -06:00
Brian
f1cfb1e367 gallium: use new color packing utility functions 2008-03-18 09:24:01 -06:00
Brian
5bae5871f0 gallium: for TEST_DRAW_PASSTHROUGH, pass inClipCoords=FALSE to st_draw_vertices()
When pass-through mode is fully supported we'll clean this up more.
2008-03-13 17:06:13 -06:00
Brian
3e625ce18e gallium: add some temporary code for testing draw module vertex passthrough
Set TEST_DRAW_PASSTHROUGH=1, run progs/trivial/clear-scissor
2008-03-13 15:08:18 -06:00
Brian
d91e62e9c6 gallium: in clear_stencil_buffer() check surface format to determine stencil clear value
... as we do for the Z and Z+stencil cases
2008-03-12 18:24:46 -06:00
Brian
339e7ec680 gallium: rework CSO-related code in state tracker
Use the code in cso_context.c rather than st_cache.c.
Basically, binding of state objects now goes through the CSO module.
But Vertex/fragment shaders go through pipe->bind_fs/vs_state() since they're
not cached by the CSO module at this time.

Also, update softpipe driver to handle NULL state objects in various places.
This happens during context destruction.  May need to update other drivers...
2008-03-11 18:55:58 -06:00
Keith Whitwell
10d83df3a9 gallium: State tracker cleanups wrt clears. 2008-02-28 09:07:03 +00:00
Keith Whitwell
cf5ef20f43 gallium: Cleanups related to clears. 2008-02-14 16:53:51 +00:00
Brian
9677336845 gallium: rename st_fragment_program's fs field to cso to match st_vertex_program 2008-02-12 16:10:11 -07:00
Brian
0b64ee6960 gallium: added inClipCoords param to st_draw_vertices() to indicate coord system of vertices
Also, export st_make_passthrough_vertex_shader() from st_cb_drawpixels.c
2008-02-08 15:13:48 -07:00
Brian
16ed55c641 gallium: check if surface has defined status in check_clear_depth_with_quad()
This was part of Keith's patch from Friday.
2008-01-28 09:23:50 -07:00
Brian
ac95fee4ff Fix problems with vertex shaders and the private draw module.
The CSO returned by pipe->create_vs_state() can't be passed to the
private draw module.  That was causing glRasterPos to blow up.
Add a 'draw_shader' field to st_vertex_program for use with the private
draw module.
Change st_context->state.vs type from cso_vertex_shader to st_vertex_program.
2008-01-14 19:13:34 -07:00
Keith Whitwell
bfe79babf9 gallium: incorporate alpha state into depth_stencil state object. 2007-12-17 16:14:29 +00:00
Brian
54fc80ab31 Define PIPE_FORMAT_ tokens as an enum set, rather than #defines.
This makes debugging a _lot_ easier.
In gdb, "print format" used to display 613570600, now you see PIPE_FORMAT_A8R8G8B8_UNORM.
2007-12-07 16:46:30 -07:00
Brian
d3e05111c8 Replace "duplicate" formats 2007-12-07 16:15:14 -07:00
Brian
146483d541 added PIPE_FORMAT_U_B8_G8_R8_A8 case in color_value() 2007-12-05 14:54:19 -07:00
Brian
0191570f02 initial support for PIPE_FORMAT_Z24_S8 2007-11-20 08:30:10 -07:00
Brian
c0b2714945 simplify depth_value(), return proper value for Z16 format 2007-11-08 14:40:29 -07:00
Brian
187b631b6b Float->uint conversion for PIPE_FORMAT_U_Z32 resulted in overflow in depth_value(). Special-case it. 2007-11-07 14:40:38 -07:00
Brian
ef6940f172 Move mesa_to_tgsi.[ch] to state_tracker 2007-10-27 09:03:15 -06:00
Brian
616112ea2e silence warning 2007-10-25 20:32:45 -06:00
Brian
f953c223df remove #include vf.h 2007-10-17 16:23:25 -06:00
Brian
2dd27cfdd9 Fix viewport Z scale/bias to get the right Z values from drawing the quad. 2007-10-17 11:24:06 -06:00
Brian
45700ac280 use new st_clear_accum_buffer() function 2007-10-16 18:45:42 -06:00
Michel Dänzer
e9df20c2fa Some minor cleanups. 2007-10-03 20:37:59 +02:00
Brian
636480cc9c Instead of linked program pairs, keep a list of vertex programs translated for each fragment program. 2007-09-28 15:39:39 -06:00
Brian
0dfa5506a3 st_draw_vertices() no longer needs attribs[] array parameter 2007-09-25 16:56:35 -06:00
Brian
40c543eb71 Translate mesa vertex/fragment programs to TGSI programs at same time to do proper linking.
Previously, programs were translated independently during validation.
The problem is the translation to TGSI format, which packs shader
input/outputs into continuous slots, depends on which vertex program is
being paired with which fragment shader.  Now, we look at the outputs
of the vertex program in conjunction with the inputs of the fragment shader
to be sure the attributes match up correctly.

The new 'linked_program_pair' class keeps track of the associations
between vertex and fragment shaders.  It's also the place where the TGSI
tokens are kept since they're no longer per-program state but per-linkage.

Still a few loose ends, like implementing some kind of hash/lookup table
for linked_program_pairs.
2007-09-25 14:29:11 -06:00
Brian
46f606e971 reenable some clear code that was temporarily disabled 2007-09-21 11:55:28 -06:00
Zack Rusin
6cb87cf26f Make the alpha test state a cso. 2007-09-21 07:00:20 -04:00
Brian
086734502a Checkpoint: vertex attribute clean-up.
Remove/disable the attrib/slot mapping arrays in a few places.
Work in progress...
2007-09-20 13:43:23 -06:00
Zack Rusin
a6c0c5532f Convert depth_stencil state to the new semantics. 2007-09-20 08:35:10 -04:00
Zack Rusin
daf5b0f41b Switch fragment/vertex shaders to the new caching semantics.
Allow driver custom allocation within cached objects. The shaders
are currently twiced (by cso layer and by the program itself).
2007-09-20 07:50:33 -04:00
Brian
37cf13ed9a Checkpoint: replacement of TGSI_ATTRIB_x tokens with input/output semantics.
TGSI_ATTRIB_x tokens still present and used in a few places.
Expanded set of TGSI_SEMANTIC_x tokens for describing the meaning
of inputs/outputs.  These tokens are in a crude state ATM.
Lots of #if 0 / disabled code to be removed yet, etc...
Softpipe and i915 drivers should be in working condition but not heavily tested.
2007-09-19 18:53:59 -06:00
Zack Rusin
fe555c39bb Convert the rasterizer cso to the new semantics.
Basically make cso hold the driver specific struct, while
managing the template.
2007-09-19 14:01:18 -04:00
Zack Rusin
c0bf732208 Redo the cso cache to map driver data in a lot more pleasing way.
Drivers can now create whatever they want from the state template. We
use cso_state object to store the template (necessary during lookups),
and the driver data. Convert blend state to the new semantics.
2007-09-19 13:12:09 -04:00
Zack Rusin
f22e920f47 Finish up conversions of shaders to immutable objects.
Create/Delete calls should be split since in create we'll be
compiling them so we want to know which one it is (vertex/fragment).
2007-09-19 06:46:32 -04:00
Brian
bb611c5f1f Checkpoint: rework shader input/output register mapping.
This is a step toward removing TGSI_ATTRIB_ tokens.
Basically, when translating Mesa programs to TGSI programs, pass in input and
output register re-maps, plus interpolation info.
There's some known breakage (cubemap.c) so more to be done...
2007-09-18 19:38:35 -06:00
Zack Rusin
ccd63b54cf Convert shader to an immutable state object. 2007-09-18 13:24:44 -04:00
Zack Rusin
294401814d converting the setup state to immutable object and renaming it to rasterizer state 2007-09-18 07:18:12 -04:00
Zack Rusin
d6ac959833 Combing depth and stencil objects and making them immutable.
Converting depth and stencil objects into a single state object
(d3d10 like) and making it immutable.
2007-09-18 06:31:22 -04:00
Zack Rusin
e16c045b83 Implementing a better hash, removing state_tracker dependency from the cache.
Replacing mesa's main hash with one that handles collisions, moving state_tracker
related caching to the state tracker to keep cso cache independent of it. Cleanups.
2007-09-18 06:31:22 -04:00
Zack Rusin
9780327c5d First stab at immutable state objects (create/bind/delete)
We want our state objects to be immutable, handled via the
create/bind/delete calls instead of struct propagation.
Only implementing the blend state to see how it would look like
and work.
2007-09-18 06:31:22 -04:00