summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_fragprog.c
AgeCommit message (Collapse)Author
2007-03-24r300: Fix texture coordinate calculation for rectangle texturesNicolai Haehnle
R300 hardware takes texcoords in the range 0..1 even for rectangle textures. Previously, the necessary texcoord conversion was applied to the texture coordinate during vertex processing in a render stage. This is obviously wrong when fragment programs are used, which can calculate arbitrary coordinates for TEX instructions. Therefore, we now inject an appropriate MUL instruction before a TEX that reference a rectangle texture.
2007-03-21merge from masterBrian
2007-03-21r300: Remove the program-global const_sin indexNicolai Haehnle
The index is no longer necessary to share constants between multiple SIN/COS/SCS instructions inside a single fragment program, and storing a tiny implementation detail like this in the fragment_program structure itself was just nasty.
2007-03-19r300: Cleanup fragment program constant allocation, share constantsNicolai Haehnle
The constant/parameter allocation was significantly simplified, removing one unnecessary copy operation of parameters. The dirty state tracking is unchanged and far from optimal, since all state is always re-fetched. Constants and parameters are now emitted only once, which significantly reduces the resource pressure on larger programs.
2007-03-19r300: Fix special case (tmp.x <= 0) in fragment program LIT instructionNicolai Haehnle
Also, fix a typo in a related comment.
2007-03-19r300: Clear fragment program instruction slots on first useNicolai Haehnle
Make sure that instruction slots are fully initialized with NOPs during find_and_prepare_slot(). This fixes a bug when a fragment program was translated more than once (e.g. due to a second call to glProgramStringARB). This partially fixes glean/fragProg1.
2007-03-19r300: Dump fragment program after translation if RADEON_DEBUG=pixel is setNicolai Haehnle
2007-03-19r300: Whitespace cleanup (remove trailing spaces)Nicolai Haehnle
2007-03-19r300: Fix WRITEMASK handling when writing to result.depthNicolai Haehnle
This is a necessary change to emit the right instructions when writing to result.depth. However, even with this test, Z-write doesn't work properly, and I don't fully understand why. In addition to this, we'll at least have to disable early-Z, but even that doesn't seem to be enough.
2007-03-19r300: Streamlined fragment program LIT implementationNicolai Haehnle
Fix a bug in the LIT implementation (clamp exponent to 128, not 0.5) and change the implementation around. In theory, the new implementation needs as little as 5 instruction slots. Unfortunately, the dependency analysis in find_and_replace_slot is not strong enough to look at individual components of a register yet.
2007-03-19r300: Fix fragment program reorderingNicolai Haehnle
Do not move an instruction that writes to a temp forward past an instruction that reads the same temporary.
2007-03-19r300: Fragment program dumps format tex instructionsNicolai Haehnle
2007-03-19r300: Fix hw fragment program dumpNicolai Haehnle
Dumps of fragment programs were incorrect when the program consisted of multiple nodes. Also, improved the formatting a bit.
2007-03-19r300: Fix fragment program instruction pairing and register allocationNicolai Haehnle
There were a number of bugs related to the pairing of vector and scalar operations where swizzles ended up using the wrong source register, or an instruction was moved forward and ended up overwriting an aliased register. The new algorithm for register allocation is quite conservative and may run out of registers before necessary. On the plus side, It Just Works. Pairing is done whenever possible, and in more cases than before, so in practice this change should be a net win.
2007-03-15r300: Added _mesa_copy_instructions.Oliver McFadden
2007-03-15r300: Use _mesa_alloc_instructions/_mesa_init_instructions instead of malloc.Oliver McFadden
Note that insert_wpos in r300_vertexprog.c is still a little flaky and could be improved.
2007-03-15r300: Updated R300 to use the new SWIZZLE macros.Oliver McFadden
2007-03-15Committed Rune Petersen's fragment.position patch (Bug #10024) plus a few smallOliver McFadden
corrections.
2007-03-09Merge branch 'origin' into glsl-compiler-1Brian
Conflicts: src/mesa/main/context.c
2007-03-01Optimize cos&sin instruction a bit more.Rune Petersen
2007-02-23Update DRI drivers for new glsl compiler.Brian
Mostly: - update #includes - update STATE_* token code
2007-02-14r300: Fix cos & add scs to fragment program.Rune Peterson
So this do : - Fixes COS. - Does range reductions for SIN & COS. - Adds SCS. - removes the optimized version of SIN & COS. - tweaked weight (should help on precision). - fixed a copy paste typo in emit_arith().
2007-02-12r300: Add proper support for sin/cos instruction in fragment programRune Peterson
Getting proper SIN and COS wasn't as easy as it appeared. I had to make make some changes to the fragment program code. general FP changes: - support HHH swizzle for vector instructions. - don't copy a source to a temp when it is not XYZW swizzled, but combine the two and have the swizzle resolve any issues. (saves temps/instructions with more elaborate shader code) - fix overflow in cnstv[].
2007-01-11Fix typo from commit 1d312ae0137eb39bf74fac91eb97ed25c289a4ca .Jerome Glisse
2007-01-04r300: Correct bug introduced by fragprog rework.Jerome Glisse
Thx for Tilman who spoted the bugs.
2006-12-25Rework r300 fragprog avoid using bitfield structure.Jerome Glisse
It seems that bitfield structure lead to some strange problem on 64bits arch, don't want to waste time debugging strange things like that so converted pfs_reg_t structure to a GLuint and use good old masking and shifting spell. (cherry picked from 2a7de9d095d8e60da12b11aaa1efe664b87b11d3 commit)
2006-11-20Disable fragment program debug messages.Rune Petersen
2006-11-17fragment.position supportRune Petersen
World position is calculated in the vertex shader and passed to the fragment shader via an unused texcoord.
2006-11-05Add sin instruction to fragment program.Jerome Glisse
There is a bug somewhere in fragment program. tri-cos and tri-sin show the bug. Also we should not emit multiple time the same constant. for sin,cos,lit have to fix that.
2006-11-04Add cos instruction and remove left over debug.Jerome Glisse
2006-11-01Add LIT instruction to fragment program.Jerome Glisse
2006-08-31re-apply shader fix.Rune Petersen
appears to have been reverted by mistake.
2006-07-20Some structure renaming. Prefix vertex/fragment-related structs withBrian Paul
"gl_" to match other structs.
2006-07-15A small logic error.Rune Petersen
We need to call do_swizzle() when the scaler _or_ vector unit have a swizzle other 000/ZERO/111/ONE. This ensures that the gloss on banners in ut2004 is not angel-dependent (since when was banners glossy?).
2006-05-23init mask=0 to silence warningBrian Paul
2006-03-29FP textures and fixes (Ewald Snel)Brian Paul
2006-03-13Clean build.Aapo Tahkola
2006-01-27remove broken non arb fp pathAapo Tahkola
2006-01-21Do individual negetation in swizzling, thus we canJerome Glisse
save one instruction in some case.
2006-01-21Indent & wrap around 80Jerome Glisse
2006-01-21Add individual component negation.Jerome Glisse
2006-01-13namespace pollution fixes (Tilman Sauerbeck)Aapo Tahkola
2006-01-09Missing patch from Ben Skeggs:Aapo Tahkola
Lots of changes, and fixes for some badness on my behalf. 1. Disposable data used during fp compile is now per-context, rather than per-program to save memory. 2. Track usage of INPUT/TEMP registers from Mesa program, free them when no longer required so the hw temps can be re-used. 3. Changed LAST_NODE to OUTPUT_COLOR (see r300_reg.h) 4. Implemented remaining ARB_f_p instructions, with the exception of the trig/LIT opcodes. 5. Treat ZERO/ONE swizzles the same way as other native swizzles. 6. emit_arith changes, basically a complete re-write. Should produce cleaner instructions, but no real functional changes. internal reg -> hw reg routines shared with emit_tex. A bit messy still.
2006-01-09Fix node setup(from Ben Skeggs)Aapo Tahkola
2005-11-20Make Saturate a 2-bit field again, renamed to SaturateMode with threeBrian Paul
possible values: SATURATE_OFF, SATURATE_ZERO_ONE and SATURATE_PLUS_MINUS_ONE.
2005-11-19remove #include arbfragparse.hBrian Paul
2005-11-12Move stuff common to vertex/fragment_program into the base class, including:Brian Paul
Instructions, InputsRead, OutputsWritten, and Parameters. Also, added debug functions: _mesa_print_instruction(), _mesa_print_program_parameters() and revamp _mesa_print_program().
2005-11-07s/_mesa_debug_fp_inst/_mesa_print_program/Brian Paul
2005-11-05Unify vertex/fragment program instuctions.Brian Paul
Based on patch by Ian (#4967) but also unify instruction opcodes.
2005-10-31fix problems found with gcc 2.96 (bug 4934)Brian Paul