Commit Graph

34 Commits

Author SHA1 Message Date
Brian Paul
33f3938d2d gallium: fix some bitmap frag shader issues
If texturing happens to be enabled when glBitmap() is called, need to be
careful about choosing a sampler unit, etc.
2008-04-22 18:43:05 -06:00
Brian Paul
b456f1374f gallium: st_translate_fragment_program() is void now
The return value was never used.
2008-04-22 14:44:07 -06:00
Keith Whitwell
01dfa6cde1 use cso fs/vs handle functions 2008-04-21 20:52:54 +01:00
Brian Paul
22a3d02254 gallium: free bitmap fragment shaders, misc clean-up 2008-03-24 11:56:05 -06:00
Brian Paul
fa9e7e9a8d gallium: remove semantic info from pipe_shader_state
Brian's patch to clean up the shader interfaces.
2008-03-13 18:10:26 +00: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
Brian
ecd50ef58b gallium: remove input_map[] from pipe_shader_state 2008-02-26 08:43:07 -07:00
José Fonseca
f430d95a36 Use gallium's rtasm module. 2008-02-19 14:01:49 +09: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
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
Michal Krol
abd5e8e41d gallium: reorg tgsi directories. 2007-11-23 13:28:16 +00:00
Brian
fa7a589876 Size of input_to_index array should be VERT_ATTRIB_MAX.
This fixes an out of bounds array write that was causing the glsl/bump demo to render incorrectly.
2007-10-10 10:33:38 -06:00
Michel Dänzer
344464bf2e Track fragment and vertex shader code generation via pipe shader state objects.
Unfortunately, the generated fragment shader code is effectively unusable until
it handles quad->mask.
2007-10-03 20:33:23 +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
Zack Rusin
a1a989f0be Redoing the way we handle vertex shaders for the draw module. 2007-09-28 12:29:22 -04:00
Zack Rusin
901577e07f Revert "Redoing the way we handle vertex shaders for the draw module."
This reverts commit 6dcfddb8e2.
2007-09-28 12:28:16 -04:00
Zack Rusin
6dcfddb8e2 Redoing the way we handle vertex shaders for the draw module. 2007-09-28 09:12:20 -04:00
Keith Whitwell
65e3af51ef Enable codegen based whenever __i386__ is defined. 2007-09-27 07:56:23 +01: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
michal
c0dd02219d Enable SSE2 for FS. 2007-09-24 12:32:26 +01: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
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
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
Keith Whitwell
07d97e80e6 checkpoint in constant tracking rework 2007-08-25 22:01:32 +01:00
michal
4fd7bc00f0 Hook-up SSE2 to VS. 2007-08-24 17:51:12 +01:00
Keith Whitwell
c89502bb4e Fixup include paths after rename 2007-08-24 10:01:20 +01:00
Brian
c0bb4ba9e6 Rework of shader constant buffers.
They're now totally independent of the actual shaders.
Also, implemented in terms of pipe_buffer_handles/objects.
2007-08-22 12:26:46 -06:00
Brian
de653b4c9b Begin added vertex shader state/support.
Renamed pipe_fs_state to pipe_shader_state since it can be used for both
vertex and fragment shader info.
2007-08-16 13:33:43 -06:00
Brian
6da9234fd4 New st_init_*_functions() to initialize the driver functions table.
We need to do these initializations before initializing the Mesa context
because context init involves creating texture/program/etc objects.
2007-08-06 20:53:28 +01:00
Brian
43d7c1fe9d Basic fragment programs run now.
Handling of constants might change.  For now, the st_fragment_program struct
contains a pipe_constant_buffer (not a pointer).
2007-07-24 12:27:38 -06:00
Keith Whitwell
4824c342c8 Trigger tgsi compilation for fragment programs.
Not sure the generated program looks correct though...
2007-07-19 20:24:55 +01:00
Keith Whitwell
6393cda676 Renamed softpipe directories and files to something less confusing.
softpipe/state_tracker --> state_tracker/
softpipe/              --> pipe/
softpipe/generic       --> pipe/softpipe/

I don't think pipe is a great name, but I disliked all the others too.
Luckily it's fairly easy to rename with git, so this can be revisited
later.
2007-06-14 18:11:48 +01:00