summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
Commit message (Collapse)AuthorAgeFilesLines
* r300c/compiler: remove the compiler tooMarek Olšák2011-10-281-678/+0
| | | | Gallium has a fork of this.
* r300/compiler: implement TXD and TXL opcodesMarek Olšák2011-05-071-0/+18
|
* r300/compiler: Rewrite register allocatorTom Stellard2011-04-301-3/+6
| | | | | | | The new allocator uses ra and does swizzle packing. Also, a data structure (struct rc_variable) and associated functions have been added for generating UD and DU chains.
* r300/compiler: implement the CND opcodeMarek Olšák2011-04-051-0/+2
| | | | No one uses it now, but I will need it for a lowering pass.
* r300/compiler: set the MSB of ADDR for inline constantsMarek Olšák2011-04-051-2/+5
| | | | The docs say so.
* r300/compiler: Use a 4-bit writemask in pair instructionsTom Stellard2011-03-181-1/+2
| | | | | | | We now use a 4-bit writemask for all instruction types, which makes it easier to write generic helper functions to manipulte writemasks. NOTE: This is a candidate for the 7.10 branch.
* r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500Marek Olšák2011-03-121-1/+1
| | | | | | | | | | The docs say it can be set for direct texture lookups, but even that causes problems. This fixes the wireframe bug: https://bugs.freedesktop.org/show_bug.cgi?id=32688 NOTE: This is a candidate for the 7.9 and 7.10 branches.
* r300/compiler: Standardize the number of bits used by swizzle fieldsTom Stellard2011-01-291-1/+1
| | | | | | | | | | | | | | Swizzles are now defined everywhere as a field with 12 bits that contains 4 channels worth of meaningful information. Any channel that is unused is set to RC_SWIZZLE_UNUSED. This change is necessary because rgb instructions and alpha instructions were initializing channels that would never be used (channel 3 for rgb and channels 1-3 for alpha) with 0 (aka RC_SWIZZLE_X). This made it impossible to use generic helper functions for swizzles, because sometimes a channel value of 0 meant unused and other times it meant RC_SWIZZLE_X. All hacks that tried to guess how many channels were relevant have also been removed.
* r300/compiler: Track readers through branches in rc_get_readers()Tom Stellard2010-11-211-4/+1
|
* r300/compiler: Use zero as the register index for unused sourcesTom Stellard2010-11-211-0/+3
| | | | | | | | | This fixes an invalid "Too many hardware temporaries used" error in the case where a source reads from a temporary register with an index greater than max_temp_regs and then the source is marked as unused before the register allocation pass. NOTE: This is a candidate for the 7.9 branch.
* r300/compiler: Move declaration before code.Vinson Lee2010-09-291-4/+10
| | | | | | | | | | | | Fixes these GCC warnings on linux-x86 build. r500_fragprog_emit.c: In function ‘emit_paired’: r500_fragprog_emit.c:237: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘emit_tex’: r500_fragprog_emit.c:367: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘emit_flowcontrol’: r500_fragprog_emit.c:415: warning: ISO C90 forbids mixed declarations and code r500_fragprog_emit.c: In function ‘r500BuildFragmentProgramHwCode’: r500_fragprog_emit.c:633: warning: ISO C90 forbids mixed declarations and code
* r300/compiler: Fix segfault in error pathTom Stellard2010-09-281-1/+1
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=30415 NOTE: This is a candidate for the 7.9 branch.
* r300/compiler: Refactor the pair instruction data structuresTom Stellard2010-09-201-1/+1
| | | | | | | | | | | Use rc_pair_ prefix for all pair instruction structs Create a named struct for pair instruction args Replace structs radeon_pair_instruction_{rgb,alpha} with struct radeon_pair_sub_instruction. These two structs were nearly identical and were creating a lot of cut and paste code. These changes are the first step towards removing some of that code.
* r300/compiler: Enable presubtract sourcesTom Stellard2010-09-101-0/+37
| | | | | | | The r300 compiler can now emit instructions that select from the presubtract source. A peephole optimization has been added to convert instructions like: ADD Temp[0].x, none.1, -Temp[1].x into the INV (1 - src0) presubtract operation.
* r300/compiler: refactor fragment shader compilationMarek Olšák2010-09-041-1/+2
| | | | This cleans up the mess in r3xx_compile_fragment_program.
* r300/compiler: add new compiler parameter max_alu_instsMarek Olšák2010-09-041-5/+5
|
* r300/compiler: put emulate_loop_state in radeon_compilerMarek Olšák2010-09-041-5/+5
|
* r300/compiler: remove an unused variableMarek Olšák2010-08-121-1/+0
|
* r300/compiler: Implement the CONT opcode.Tom Stellard2010-08-111-3/+16
|
* r300/compiler: r500 hw support for break and continue in loops.Tom Stellard2010-08-031-38/+76
| | | | | | | The BGNLOOP and ENDLOOP instructions are now being used correctly, which makes break and continue possible. The deadcode pass has been modified to handle breaks, and the compiler is more careful about which loops are unrolled.
* r300/compiler: Use hardware flow control instructions for loops on r500.Tom Stellard2010-07-031-19/+81
|
* r300/compiler: print opcode names instead of numbersMarek Olšák2010-06-031-4/+4
|
* r300/compiler: Use memory_pool_array_reserve in r500-fragprog_emitNicolai Hähnle2010-04-191-17/+2
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/compiler: Unbreak DDX/DDY.Corbin Simpson2010-03-301-2/+21
| | | | Fixes progs/glsl/deriv.
* r300/compiler: fix assertion failure in the r500-fragprog emission pathMarek Olšák2010-03-211-3/+2
|
* r300/compiler: Assert that array index is not negative.Vinson Lee2010-02-261-0/+2
|
* r300/compiler: r500-fs: Properly set HW register swizzles.Corbin Simpson2010-02-101-2/+13
| | | | Fixes fallout from 9a1bf52c.
* r300compiler, r300 classic, r300g: Add support for MRTs in the frag shader.Corbin Simpson2010-02-021-0/+3
| | | | This maybe breaks the vert compiler. Hopefully not.
* r300/compiler: Emit flow control instructions and ALU result writes on R500Nicolai Hähnle2009-10-041-8/+172
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/compiler: Refactor the radeon_pair code to support control flow ↵Nicolai Hähnle2009-10-041-27/+40
| | | | | | instructions Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Remove all Mesa dependencies from the shader compilerNicolai Hähnle2009-08-301-48/+48
| | | | | | | | In particular, this removes the dependency on prog_instruction, which unfortunately creates some code duplication, but also opens a path towards adding some hardware-specific things in there. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/compiler: Remove inst_offset from r500_fragment_program_codeNicolai Hähnle2009-07-301-1/+0
| | | | | | | | The field is not used, and in any case it would be more interesting to manipulate from *outside* the compiler if we ever wanted to load several fragment programs at the same time or something. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/fragprog: No longer rely on hardcoded FRAG_RESULT_xxx constantsNicolai Hähnle2009-07-271-1/+1
| | | | | | | | | Also, this makes radeon_program_pair depend on the r300 fragment program compiler. Since we now know that r600+ no longer use the same pairing style in their ALU, we can stop pretending that program_pair is useful for anything but r300-r500 fragment programs. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Allow compiler to add constants in a cleaner wayNicolai Hähnle2009-07-271-28/+0
| | | | | | | | Adding constants is used in a number of non-native instruction rewrites, and it required us to keep copies of modified gl_programs around. This is a first step towards ending this. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/compiler: Lay groundwork for better error handlingNicolai Hähnle2009-07-271-12/+11
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Introduce rc_program and use it in radeon_pairNicolai Hähnle2009-07-271-1/+1
| | | | | | | The goal is to convert both Mesa and TGSI programs into an intermediate format that happens to be convenient for us. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Add radeon_compiler as a base for compilation-related tasksNicolai Hähnle2009-07-271-1/+1
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Further reduce dependency between compiler and classic driverNicolai Hähnle2009-07-271-4/+4
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Remove GLcontext requirement from radeon_program_pairNicolai Hähnle2009-07-271-1/+1
| | | | Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300/program_pair: Introduce driver-specific texture instruction structureNicolai Hähnle2009-07-271-11/+11
| | | | | | | This is to prepare more experimentation and possible internal changes in the compiler. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
* r300: Detangle fragment program compiler from driver-specific structureNicolai Hähnle2009-07-271-0/+329
This is in preparation of sharing the fragment program compiler with Gallium: Compiler code is moved into its own directory and modified so that it no longer depends on driver structures. Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>