Commit Graph

93 Commits

Author SHA1 Message Date
Brian Paul
e90bc2e2ce st/mesa: move per-fragment shader fields to local vars 2010-02-14 21:57:14 -07:00
Brian Paul
b9b4e7724e st/mesa: rename state -> tgsi, updated comments 2010-02-12 15:42:10 -07:00
Brian Paul
dd98a979b6 st/mesa: remove special-case cyl-wrap code
Cylinder wrap mode works with perspective interpolation now.
2010-02-09 15:32:56 +01:00
Brian Paul
ae4dde6598 st/mesa: check for PROG_PARAM_BIT_CYL_WRAP flag 2010-02-09 15:32:43 +01:00
Brian Paul
f1d544d6a6 st/mesa: 'fix' point coord semantic info
This fixes the progs/glsl/pointcoord.c demo.  But this isn't a proper fix.
We really need a TGSI_SEMANTIC_POINT_COORD label so that the draw module
can determine which fragment input / vertex output slot needs to be set
up with the point coordinate info.  We've been using generic slot 0 so far.

This would also require telling the draw module about fragment shaders
(something it doesn't have at this time).
2010-02-05 10:00:00 -07:00
Keith Whitwell
e1906ae98e st/mesa: remove duplicate calculation of fp input mapping
This was being calculated the same way in two different places.
Now just do it in st_translate_fragment_program().
2010-02-01 20:42:34 +00:00
Keith Whitwell
d51b04320d st/mesa: remove dead stfp input_map array
Was being calculated and not used.  Also was probably incorrect...
2010-02-01 20:33:53 +00:00
Jakob Bornecrantz
b01ffb12ed Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
	src/gallium/auxiliary/util/Makefile
	src/gallium/drivers/r300/r300_state_derived.c
2010-01-14 22:31:04 +00:00
Vinson Lee
252812bf15 st/mesa: Remove unnecessary header from st_program.c. 2010-01-13 23:28:00 -08:00
Roland Scheidegger
35e8283c69 Merge branch 'gallium-edgeflags'
Conflicts:
	src/mesa/state_tracker/st_draw.c
2009-12-22 20:54:26 +01:00
Brian Paul
9eb7fc6661 Merge branch 'mesa_7_7_branch'
Conflicts:
	src/mesa/main/version.h
	src/mesa/state_tracker/st_atom_shader.c
2009-12-21 18:35:54 -07:00
Roland Scheidegger
9d938e29f2 fix debug output mising from edgeflag changes 2009-12-18 16:09:32 +01:00
Roland Scheidegger
890809d71b gallium: fix mesa to tgsi translation for edgeflags
test apps (progs/trivial/tri-edgeflags and similar) seem to work now
2009-12-18 15:54:28 +01:00
Roland Scheidegger
50caff5675 gallium: edgeflags change fixes
use correct number of vertex inputs
fix not running pipeline in case of edgeflags
changes to mesa to tgsi translation still very broken
2009-12-16 22:12:16 +01:00
Roland Scheidegger
a0127b6ced gallium: more work for edgeflags changes
fixes, cleanups, etc.
not working yet
2009-12-14 18:36:33 +01:00
Keith Whitwell
a08e348a84 gallium: first steps to treat edgeflags as regular vertex element
The idea here is to eliminate the set_edgeflags() call in pipe_context
by treating edgeflags as a regular vertex element.

Edgeflags provoke special treatment in hardware, which means we need to
label them in some way, in this case we'll be passing them through the
vertex shader and labelling the vertex shader output with a new TGSI
semantic (TGSI_SEMANTIC_EDGEFLAG).
2009-12-09 19:03:10 +01:00
Keith Whitwell
325f045c04 st/mesa: move assert on nr vs insns until after pos_invarient expansion
It is possible to have a 1-instruction vertex shader before expanding
pos_invarient.  Not sure what this assert achieved, but at least move
it where it is correct.
2009-12-18 18:39:44 +00:00
Brian Paul
8468234bfa st/mesa: fix up comment 2009-12-07 08:59:38 -07:00
Roland Scheidegger
4dcdf3b9c6 Merge commit 'origin/st-shader-varients'
Conflicts:
	src/mesa/state_tracker/st_atom_shader.c
	src/mesa/state_tracker/st_program.c
2009-11-26 01:15:25 +01:00
Ian Romanick
5606dfb572 Merge branch 'outputswritten64'
Add a GLbitfield64 type and several macros to operate on 64-bit
fields.  The OutputsWritten field of gl_program is changed to use that
type.  This results in a fair amount of fallout in drivers that use
programs.

No changes are strictly necessary at this point as all bits used are
below the 32-bit boundary.  Fairly soon several bits will be added for
clip distances written by a vertex shader.  This will cause several
bits used for varyings to be pushed above the 32-bit boundary.  This
will affect any drivers that support GLSL.

At this point, only the i965 driver has been modified to support this
eventuality.

I did this as a "squash" merge.  There were several places through the
outputswritten64 branch where things were broken.  I foresee this
causing difficulties later for bisecting.  The history is still
available in the branch.

Conflicts:
	src/mesa/drivers/dri/i965/brw_wm.h
2009-11-17 16:25:38 -08:00
Brian Paul
133501bef2 mesa: fix assorted compiler warnings 2009-11-17 16:16:30 -07:00
Keith Whitwell
07fafc7c93 mesa/st: refactor vertex and fragment shader translation
Translate vertex shaders independently of fragment shaders.

Previously tried to make fragment shader semantic indexes always start
at zero and exclude holes.  This was unnecessary but meant that vertex
shader translation had to be adjusted to take this into account.

Now use a fixed scheme for labelling special FS input semantics
(color, etc), and another fixed scheme for the generics.

With this, vertex shaders can be translated independently of the bound
fragment shader, assuming mesa has done its own job and ensured that
the vertex shader provides at least the inputs the fragment shader is
looking for.  The state-tracker didn't attempt to do anything about
this previously, so it shouldn't be needed now.
2009-11-15 11:23:30 -08:00
Keith Whitwell
9953fe4cb4 mesa/st: don't calculate unused output_flags data either 2009-11-15 11:23:29 -08:00
Keith Whitwell
0ffdd1c1e8 mesa/st: don't calculate unused input_flags data 2009-11-15 11:23:29 -08:00
Keith Whitwell
b44b70dc11 mesa/st: don't calculate unused vs input semantic tags 2009-11-15 11:23:29 -08:00
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