Commit Graph

68 Commits

Author SHA1 Message Date
Keith Whitwell
b02ef740b9 mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the
state tracker without modifying sources...
2009-10-05 15:51:55 +01:00
José Fonseca
734a498ed4 mesa: Ensure TGSI tokens are freed with gallium's free.
To avoid breaking the gallium's builtin malloc debugging.
2009-09-21 20:12:03 +01:00
Keith Whitwell
4295b34d25 st/mesa: convert to new tgsi_ureg mechanism for shader emit
Should be easier to read and work with than the older ways of emitting
TGSI tokens.

Also, emit simpler TGSI than previously:
  - translate away source and dest extended modifiers
  - translate away the SWZ opcode
2009-09-14 17:09:15 +01:00
Brian Paul
9d0b8d72d8 mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputs
Previously, the FOGC attribute contained the fragment fog coord, front/back-
face flag and the gl_PointCoord.xy values.  Now each of those things are
separate fragment program attributes.  This simplifies quite a few things in
Mesa and gallium.

Need to test i965 driver and fix up point coord handling in the gallium/draw
module...
2009-07-29 20:07:41 -06:00
Brian Paul
3e8832d24b st/mesa: add some array index bounds assertions 2009-07-16 08:44:51 -06:00
Jakob Bornecrantz
28471cfa97 Merge branch 'mesa_7_5_branch' 2009-07-04 07:43:01 +02:00
Zack Rusin
a4d952358d gallium: more fog extraction fixes
fix the cases when fog coord/front face/point coord are used in the same
shader.
2009-07-06 21:35:15 -04:00
Jakob Bornecrantz
862488075c Merge branch 'mesa_7_5_branch'
Conflicts:
	src/mesa/main/dlist.c
	src/mesa/vbo/vbo_save_api.c
2009-07-03 18:53:58 +02:00
Zack Rusin
1c04731b87 gallium: fix the front face semantics
mesa allocates both frontface and pointcoord registers within the fog
coordinate register, by using swizzling. to make it cleaner and easier
for drivers we want each of them in its own register. so when doing
compilation from the mesa IR to tgsi allocate new registers for both
and add new semantics to the respective declarations.
2009-07-01 10:45:55 -04:00
Brian Paul
509d9eb686 st/mesa: additional debug code (disabled) 2009-06-12 08:16:18 -06:00
Brian Paul
b6753adbc7 st/mesa: remove invalid assertion
It's legal for ARB_vertex_program programs to not write to result.position.
The results are undefined in that case.  This assertion was causing us to
abort/exit though.
2009-06-08 10:46:46 -06:00
José Fonseca
42678dba94 mesa: Allocate tokens from the heap.
The recent increase ST_MAX_SHADER_TOKENS to 8K causes stack overflows on
windows.

Failure to allocate is not being propagated to the caller. This is not
a regression since the previous _mesa_malloc result wasn't being
checked as well. Unfortunately it is not easy to fix, as the callers of
these functions do not have failure propagation mechanism either, and
so on. So leaving a just fixme note for now.
2009-06-08 16:56:41 +01:00
Brian Paul
d37795c453 st/mesa: increase ST_MAX_SHADER_TOKENS to 8k 2009-06-04 13:10:31 -06:00
Keith Whitwell
afc0c59dbd mesa/st: translate VERT_ATTRIB_GENERIC8..15 in st_translate_vertex_program
It seems quake4 can hit these attributes sometimes.
2009-04-28 18:15:17 +01:00
José Fonseca
af9d202b26 mesa: TGSI translation of multiple render targets. 2009-04-15 20:08:33 +01:00
Alan Hourihane
a97c846d61 gallium: when using gl_PointCoord ensure we use the correct attribute. 2009-04-08 16:39:17 +01:00
Brian Paul
8d475822e6 mesa: rename, reorder FRAG_RESULT_x tokens
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/
s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/
Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it.
Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-28 11:49:46 -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
Brian Paul
d917ad5dbd gallium: assorted state tracker fixes for > 8 texture samplers 2009-01-02 16:54:11 -07:00
Brian Paul
c5b52b5e0e mesa: pass shader centroid/invariant info through to the TGSI shader 2008-11-24 14:36:00 -07:00
Brian Paul
678f80b347 gallium: added st_print_shaders() function to help w/ debugging 2008-11-06 15:00:01 -07:00
Brian Paul
13a8c18d3d gallium: rename tgsi_translate_mesa_program() to st_translate_mesa_program() 2008-09-26 07:25:36 -06:00
Brian Paul
4ee8d1ad67 gallium: fix fog vs. pointcoord attribute handling in mesa->TGSI conversion 2008-09-17 16:49:26 -06: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
Brian Paul
e3f3e22cf7 gallium: fix vertex program output translation/mapping bug
In some cases, the vertex program output's semantic info didn't match up
with the fragment program's input semantic info.  This info is now explicitly
passed into the st_translate_fragment_program() function.
2008-08-18 16:10:01 -06:00
Brian Paul
a0a6144809 gallium: added comment 2008-08-11 15:21:40 -06:00
José Fonseca
c208a2c791 Merge tgsi/exec and tgsi/util directories. 2008-07-28 12:42:13 +09:00
Brian Paul
00eb309c31 gallium: move, increase ST_MAX_SHADER_TOKENS 2008-07-03 17:21:22 -06:00
Brian Paul
d378f7b3df mesa: point size arrays 2008-06-25 08:45:14 -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
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
Ben Skeggs
f3a62372bf handle IsPositionInvariant flag 2008-04-01 08:59:41 -06:00
Brian
a35c1ca3ad gallium: fix a few more shader-related mem leaks 2008-03-22 10:29:30 -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
6acd63a498 Code reorganization: update build.
Update the Makefiles and includes for the new paths.

Note that there hasn't been no separation of the Makefiles yet, and make is
jumping all over the place. That will be taken care shortly. But for now, make
should work. It was tested with linux and linux-dri. Linux-cell and linux-llvm
might require some minor tweaks.
2008-02-15 17:50:12 +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
633e1133ae gallium: fix problem in which texcoords and varying vars got mapped to the same slot
This fixes the glsl/bump.c and glsl/texdemo1.c programs
2008-01-31 14:35:25 -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
Brian
c61b32777b new assertions 2007-12-19 13:16:36 -07:00
Brian
d0a63de378 turn off TGSI_DEBUG 2007-12-18 16:01:53 -07:00
Brian
e785f190f0 Don't always declare frag shader INPUT[0] as fragment position.
We were doing this for the sake of softpipe and the tgsi intergrepter since
we always need the fragment position and W-coordinate information in order
to compute fragment interpolants.
But that's not appropriate for hardware drivers.
The tgsi interpreter now get x,y,w information from a separate tgsi_exec_vector
variable setup by softpipe.
The new pipe_shader_state->input_map[] defines how vert shader outputs map
to frag shader inputs.  It may go away though, since one can also examine
the semantic label on frag shader input[0] to figure things out.
2007-12-14 11:00:46 -07:00
Brian
6070a0eb2b include tgsi_dump.h 2007-12-07 16:22:39 -07:00
Michal Krol
abd5e8e41d gallium: reorg tgsi directories. 2007-11-23 13:28:16 +00:00
Zack Rusin
7ff0df6c2b Renaming llvmtgsi to gallivm. Taking first steps on the way to supporting
fragment shaders through llvm.
2007-11-02 07:15:17 -04:00
Zack Rusin
25b17b213b Refactor the LLVM code a bit.
Move the CPU vertex shader execution code to the draw
module, remove traces of LLVM from the state tracker,
abstract execution engine for the purposes of the draw module.
2007-10-29 16:14:10 +00:00
Brian
ef6940f172 Move mesa_to_tgsi.[ch] to state_tracker 2007-10-27 09:03:15 -06:00
Zack Rusin
02cf317ed6 Add copyright headers and do some cleanups. 2007-10-24 12:48:06 -04:00
Zack Rusin
d76a7b61bb Cleanup some code. 2007-10-24 11:21:05 -04:00