summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_fragprog.c
AgeCommit message (Collapse)Author
2009-04-14mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul
There's really no need for two negation fields. This came from the GL_NV_fragment_program extension. The new, unified Negate bitfield applies after the absolute value step.
2009-02-28mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul
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-14r300: Redirect constant TEX coordinatesNicolai Haehnle
R3xx/R5xx fragment program texture constants must come from a hardware register instead of the constant file, so we redirect if necessary during the native rewrite phase. The symptoms of this bug started appearing when the Mesa fixed function texenvprogram code started using STATE_CURRENT_ATTRIB constants for texture coordinates when the corresponding attributes were constant across all vertices. Signed-off-by: Nicolai Haehnle <nhaehnle@gmail.com>
2008-09-18mesa: added "main/" prefix to includes, remove some -I paths from ↵Brian Paul
Makefile.template
2008-07-27r300: Implement ARB_shadow_ambient; add STATE_SHADOW_AMBIENTNicolai Haehnle
2008-07-12r300_fragprog: Use nqssa+dce and program_pair for emitNicolai Haehnle
Share almost all code with r500_fragprog now. This also fixes Piglit's texrect-many test, which means that the compiz bicubic plugin should work with hardware acceleration now.
2008-07-06r300_fragprog: Emulate trigonometric functions in radeon_program_aluNicolai Haehnle
2008-07-06r300: Allow adding parameters during fragprog transform, share LIT codeNicolai Haehnle
2008-07-05r300: Correctly scan for used temporary registersNicolai Haehnle
This fixes a regression introduced by dea8719f0...
2008-07-05r300: Remove clause stuff for now in favour of a cloned generic gl_programNicolai Haehnle
2008-07-04r300: Fix depth texture in compare modeNicolai Haehnle
Missed the homogenous divide of R by Q before...
2008-06-14r300: Add radeonTransformALU and fix a bug in r300_fragprog DPHNicolai Haehnle
This new generic transform replaces "special" instructions by more generic variants. Hopefully, we will be able to share this code between r300 and r500.
2008-06-14r300_fragprog: Use less complex instructionsNicolai Haehnle
MOV, ADD and MUL do not fit the hardware as well as MAD, but they are less complex and thus leave more room for future optimizations.
2008-06-14r300: Implement GL_ARB_shadow and GL_EXT_shadow_funcsNicolai Haehnle
2008-06-14r300: Add radeonCompilerDump for debuggingNicolai Haehnle
2008-06-14r300_fragprog: Refactor TEX transformationNicolai Haehnle
Streamlining source and destination registers, as well as texcoord scaling for RECT textures is now done in a radeon_program based transformation. The idea is that this will allow us to optimize away unnecessary indirections more easily.
2008-06-14r300: Add radeon_program and trivial refactoring of r300_fragprog to use itNicolai Haehnle
The idea/hope is that radeon_program will serve as an intermediate representation for r3xx up to r6xx fragment and vertex programs. Right now, it is nothing more than a simplistic wrapper around Mesa's prog_instruction, together with the notion of clauses, taken from r6xx docs. The clauses will eventually be used to represent the nodes that are used in r300 family fragment programs.
2008-06-14r300: Do not include r300_fragprog.h from r300_context.h and other cleanupsNicolai Haehnle
2008-06-14r300_fragprog: Remove dead declarations, move NOP declarations into sourceNicolai Haehnle
2008-06-14r300_fragprog: Refactoring and cleanupNicolai Haehnle
Refactor so that r300_pfs_compile_state "owns"/holds a pointer to r300_fragment_program instead of the other way round. This is more natural from an object orientation point of view. Move the compiled hardware state into r300_fragment_program_code, in anticipation of on-the-fly program recompilation based on external OpenGL state.
2008-06-14r300_fragprog: Remove dead codeNicolai Haehnle
2008-06-13r300/r500: Separate fragprog compiler structuresNicolai Haehnle
r500 code still used r300_pfs_compile_state, which contains some fields that really only make sense on r3xx type hardware. In order to allow both fragprog implementations to go forward without disturbing each other, I've pushed this structure down into the respective r[3|5]00_fragprog.c
2008-06-01r300: Writing to result.depth in fragment programs (R3xx; only stub for R5xx)Nicolai Haehnle
Setup fg_depth_src for depth writing programs and change early Z (ztop) semantics. Piglit's version of glean/fragprog test passes now (unlike Glean, its dependency on EXT_fog_coord, which we don't support, is optional). R3xx only at the moment, but should be straightforward to adapt to R5xx (I don't own an R5xx, and I don't want to break anything.)
2008-06-01[r300] Fix KIL instruction and swizzling of texture coordinatesNicolai Haehnle
The KIL instruction only works if at least one texture unit is enabled in hardware. Texture instructions do not support swizzles, negations etc. natively, so we now emit an explicit swizzling etc. operation when the texture coordinate requires it. This fixes the Piglit fp-kil test.
2008-05-13R300: cleanup FS code and fill in missing detailsAlex Deucher
2008-05-02Initial r5xx fragment program compiler support.Corbin Simpson
Includes fallback shader and a handful of working opcodes.
2008-03-30r300: Take PROGRAM_CONSTANT into account.Markus Amsler
This bug was introduced by commit 978145a075255ae153ee05c2a037400e61558079.
2007-10-07r300: fragprog tex instruction now take writemask into acount.Jerome Glisse
2007-05-11r300: Use __FUNCTION__ not __func__.Oliver McFadden
Just for consistency; most of the code already uses __FUNCTION__.
2007-05-09r300: Added some more Doxygen documentation and made some functions static.Oliver McFadden
2007-05-09r300: Added a few more Doxygen comments.Christoph Bill
2007-05-09r300: Converted "rp" variables (r300_fragment_program) to "fp".Oliver McFadden
2007-05-09r300: Fixed indenting from previous commitOliver McFadden
d28f6d91760374e2eb71b541b0f259f81dd73c69.
2007-05-09r300: Fixed some more function names.Oliver McFadden
Note there might be some calls to the old function names in conditionally disabled code, but I think I've got them all.
2007-05-09r300: Last of the indent changes. :)Oliver McFadden
2007-05-09r300: Indented r300_fragprog.[ch].Oliver McFadden
2007-03-26r300: Fix warnings that were introduced by the glsl mergeNicolai Haehnle
2007-03-26merge of glsl-compiler-1 branchBrian
2007-03-25r300: Fix regression: unnecessary node indirectionNicolai Haehnle
The texture_rectangle fix introduced a bug where every texture instruction caused a new indirection.
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.