Commit Graph

69 Commits

Author SHA1 Message Date
Eric Anholt
11c581c6ce swrast: Implement ARB_fragment_coord_conventions but don't enable.
This brings swrast's support up to the state of gallium, and fixes the
default center behavior of fragment.position.xy in piglit
fp-arb-fragment-coord-conventions-none.

The extension is not enabled currently because the GLSL part of the
extension isn't supported, so piglit
glsl-arb-fragment-coord-conventions-define fails as would any serious
test of the GLSL part.
2010-01-26 13:30:26 -08:00
Vinson Lee
831764fa75 swrast: Remove unnecessary header from s_fragprog.c. 2010-01-12 23:54:15 -08: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
7549a8397b Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-24 10:52:15 -06:00
Brian Paul
2acd5de226 swrast: add lod bias when texture sampling
Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1.  But the LOD still
seems off by -1 or so.
May be an issue with the params passed to _swrast_compute_lambda()
2009-09-23 13:36:44 -06:00
Brian Paul
ad935c3f47 swrast: fix typo in partial derivatives parameter passing 2009-09-23 13:36:43 -06: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
bd9b2be828 mesa: texture combine clean-ups
Use MAX_COMBINER_TERMS instead of 4.
Rename some vars.
Update comments.
2009-04-01 20:20:03 -06:00
Brian Paul
de2afd8688 swrast: do texture sampling/combining in floating point
The code's cleaner and a step toward supporting float-valued texture sampling.
Some optimizations for common cases can be added and re-enabled...
2009-04-01 20:17:19 -06:00
Brian Paul
548be3846d mesa: remove some last remnants of GL_MESA_program_debug 2009-03-11 20:08:37 -06: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
88f3656ea7 swrast: use ASSIGN_4V() macro 2009-02-09 14:00:47 -07:00
Brian Paul
1df62651b2 swrast: return (0,0,0,1) when sampling incomplete textures, not (0,0,0,0)
Fixes piglit shaders/fp-incomplete-tex test.
2009-02-06 10:47:31 -07:00
Brian Paul
54c62ba5c3 mesa: implement texture swizzling in swrast
And enable GL_EXT_texture_swizzle for software drivers.
2009-01-28 10:31:05 -07:00
Brian Paul
be1a76f88f mesa: if texObj is NULL in fetch_texel_*(), return black. 2009-01-28 09:16:11 -07:00
Brian Paul
3a428aca93 mesa: added comment about gl_PointCoord 2008-08-11 15:12:42 -06:00
Brian Paul
c71fa34728 added null texObj ptr check (bug 15567) 2008-07-08 15:11:53 -06:00
Brian Paul
ade508312c Updated GLSL uniform/sampler handling from gallium-0.1 branch
Previously, the shader linker combined the uniforms used by the vertex and
fragment shaders into a combined set of uniforms.  This made the implementation
of glUniform*() simple, but was rather inefficient otherwise.  Now each shader
gets its own set of uniforms (no more modelview matrix showing up in the
fragment shader uniforms, for example).

cherry-picked by hand from gallium-0.1 branch
2008-05-14 16:09:46 -06:00
Brian
ff73c783cc Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.
These fields are no longer indexed by shader output.  Now, we just have
a simple array of renderbuffer pointers.

If the shader writes to gl_FragData[i], send those colors to the N
_ColorDrawBuffers.  Otherwise, replicate the single gl_FragColor (or
the fixed-function color) to the N _ColorDrawBuffers.

A few more changes and simplifications can follow from this...
2008-01-06 10:43:20 -07:00
Brian
02afd45d3b fix span->facing computation and gl_FrontFacing initialization 2007-12-04 14:07:08 -07:00
Brian
fcd7c37fd3 fix broken two-sided stencil 2007-11-30 13:01:57 -07:00
Brian
999b55663a Consolidate texture fetch code and use partial derivatives when possible. 2007-11-23 12:01:57 -07:00
Brian
827e72de75 clamp lambda to Min/MaxLod 2007-11-20 08:24:46 -07:00
Brian
e48f0b09ab Implement gl_PointCoord attribute for GLSL fragment shaders.
Contains the normalized fragment position within a point sprite.
2007-10-24 11:37:05 -06:00
Brian
c223c6b663 Be more consistant with paths in #includes. Eventually, eliminate a bunch of -I flags. 2007-07-04 13:15:20 -06:00
Brian
0fbc4c51a0 Rework _mesa_update_texture_compare_function() to only be called during
state validation/update.

Note that we're still temporarily skipping the test for an active fragment
program.  Need to fix shadow2D() ...
2007-06-11 17:16:18 -06:00
Brian
0186f1bc83 Temporarily disable the calls to _mesa_update_texture_compare_function().
This fixes the depth-peel regression reported by Brad King.
2007-06-11 16:04:36 -06:00
Ian Romanick
7b559a9102 Add support for GL_ARB_fragment_program_shadow. 2007-06-07 13:58:50 -07:00
Ian Romanick
84d1b24647 Fix ARB_fp spec conformance bug WRT shadow sampling.
The ARB_fp (and other assembly-level fragment program specs) say that the
depth comparison function is always GL_NONE in fragment program mode.
2007-06-07 13:38:06 -07:00
Brian
eab6e16522 remove some unneeded code in init_machine() 2007-05-11 15:12:40 -06:00
Brian
60d136f63c changes to get DDX/DDY working again 2007-05-02 18:45:44 -06:00
Brian
af0ae93863 only load front/back face attrib if using a shader (bug 10788) 2007-04-28 08:51:23 -06:00
Brian
ced6f76404 undo a test/debug change 2007-04-21 10:05:05 -06:00
Brian
8b5fce6bcc Put gl_program_machine into swrast structure rather than using a local variable.
Basically an easy way to make sure the memory gets initialized once (to zero)
to avoid lots of valgrind warnings.
2007-04-19 14:24:10 -06:00
Brian
17ad1d12eb Check if FRAG_RESULT_COLR is written and update span->interpMask, arrayMask.
Also, fix an assertion.
2007-03-13 10:53:16 -06:00
Brian
1c09bcfdda Implement support for GL_ARB_draw_buffers with GL_MAX_DRAW_BUFFERS > 1.
GL_MAX_DRAW_BUFFERS is currently 4.
Added gl_FragData[] output for fragment programs.
In _swrast_write_rgba_span() loop over the color outputs/renderbuffers.
2007-03-11 17:00:39 -06:00
Brian
10b5895597 Implement gl_FrontFacing for fragment shaders.
For the time being, we put the gl_FrontFacing value in the FOGC.Y input
register.  Combining FOGC and FrontFacing in one register is a bit of a
hack and may need to be changed someday.
2007-03-10 11:30:19 -07:00
Brian
4e53ce81cf remove unneeded includes 2007-02-25 20:05:22 -07:00
Brian
8b34b7da41 remove 'maxInst' parameter from _mesa_execute_program() 2007-02-25 18:26:50 -07:00
Brian
085d7d59f0 remove unused 'element' parameter from _mesa_execute_program() 2007-02-25 18:23:37 -07:00
Brian
f6803de739 Use the new unified vertex/fragment program interpreter from prog_execute.c.
Currently, DDX, DDY don't work.
2007-02-22 16:08:01 -07:00
Brian
3ed1acd13c use MAX_PROGRAM_ENV_PARAMS 2007-02-22 14:57:40 -07:00
Brian
501ee87180 Lots of changes to prog_print.c code.
Mainly, allow printing programs in either ARB, NV or "debug" formats.
2007-02-17 09:15:00 -07:00
Brian
34af2b7194 consolidate BRA with BRK, CONT 2007-02-08 14:10:19 -07:00
Brian
97125fb370 Simplify code with eval_condition(). Implement conditional BRK. 2007-02-08 13:22:31 -07:00
Brian
4aa487e796 Use IR_LOOP to represent do-while and for-loops.
Also, start moving high vs. low-level instruction selection into slang_emit.c
2007-02-07 15:12:13 -07:00
Brian
1f99a7514e BRK and CONT work the same 2007-02-06 22:34:09 -07:00
Brian
f22ed0986a Implement CONT, improve BRK.
IR_LOOP's BranchNode ptr is the head of a linked list of CONT and BRK nodes.
After emitting loop, walk over the linked list, filling in the CONT/BRK
instruction's BranchTarget field (location of the ENDLOOP instruction, or
one past).
2007-02-06 22:31:19 -07:00
Brian
2755c798f3 BRK instruction's BranchTarget field now used for efficiently breaking out of loops.
BRK's BranchTarget field actually points to the top of the loop, not the
bottom, since we don't know the later's location yet.  In the interpreter,
basically do an indirect jump to update the PC.
2007-02-05 18:01:02 -07:00
Brian
8608079647 Use IR node's BranchNode field for IF/ELSE/ENDIF instructions.
This allows us to back-patch the IF/ELSE instruction's BranchTarget field
to point to the location of the ELSE/ENDIF instructions.  No longer have to
search for ELSE/ENDIF in the interpreter.  Also makes it trivial to translate
IF/ELSE instructions into conditional/unconditional BRA instructions.
2007-02-05 17:18:10 -07:00