mesa.git
16 years agor500: need to re-setup inst offset/end for translated programs
Dave Airlie [Tue, 27 May 2008 07:39:35 +0000 (17:39 +1000)]
r500: need to re-setup inst offset/end for translated programs

this fixes texenv

16 years agor500: reset fp/fp_const counts
Dave Airlie [Tue, 27 May 2008 07:11:04 +0000 (17:11 +1000)]
r500: reset fp/fp_const counts

16 years agor300/r500: emit flush inside vap_cntl state atom
Dave Airlie [Tue, 27 May 2008 07:08:03 +0000 (17:08 +1000)]
r300/r500: emit flush inside vap_cntl state atom

Not sure if this is a good or bad plan, it certainly doesn't make things worse here.

16 years agor500: hopefully fix 4096 texture harder
Dave Airlie [Tue, 27 May 2008 05:29:39 +0000 (15:29 +1000)]
r500: hopefully fix 4096 texture harder

16 years agor5xx: Fix FP temp counting.
Corbin Simpson [Tue, 27 May 2008 05:12:24 +0000 (22:12 -0700)]
r5xx: Fix FP temp counting.
One of the ref counters wasn't being added to the temp counter.
Yet another product of late-night coding...

16 years agor500: remove debugging
Dave Airlie [Tue, 27 May 2008 02:46:44 +0000 (12:46 +1000)]
r500: remove debugging

16 years agor300/r500: fix r500 fragment program texture unit references
Dave Airlie [Tue, 27 May 2008 02:45:15 +0000 (12:45 +1000)]
r300/r500: fix r500 fragment program texture unit references

16 years agor500: initial support for tmu mappings
Dave Airlie [Tue, 27 May 2008 00:59:42 +0000 (10:59 +1000)]
r500: initial support for tmu mappings

16 years agor5xx: Enhance emit_mov().
Corbin Simpson [Mon, 26 May 2008 23:00:05 +0000 (16:00 -0700)]
r5xx: Enhance emit_mov().
Now we can add arbitrary sources and swizzles. Will make many things smoother.

16 years agor5xx: Moar LIT.
Corbin Simpson [Mon, 26 May 2008 22:18:41 +0000 (15:18 -0700)]
r5xx: Moar LIT.
Still not working, but getting closer.

16 years agor5xx: First stab at LIT.
Corbin Simpson [Mon, 26 May 2008 19:35:39 +0000 (12:35 -0700)]
r5xx: First stab at LIT.

16 years agoReplace copyright on r500_fragprog.c
Corbin Simpson [Mon, 26 May 2008 05:50:00 +0000 (22:50 -0700)]
Replace copyright on r500_fragprog.c
Huh, could have sworn I already did this once before...
Maybe I forgot to commit it?

16 years agor5xx: Unbreak texture swizzling.
Corbin Simpson [Mon, 26 May 2008 02:53:48 +0000 (19:53 -0700)]
r5xx: Unbreak texture swizzling.

16 years agor5xx: Massive MAD cleanup.
Corbin Simpson [Sun, 25 May 2008 18:46:16 +0000 (11:46 -0700)]
r5xx: Massive MAD cleanup.
Common uses of MAD now use emit_mad(), the two common negation masks work,
and fixed a few off-by-one errors.

16 years agor5xx: Negation masks for every inst except SWZ.
Corbin Simpson [Sun, 25 May 2008 18:35:54 +0000 (11:35 -0700)]
r5xx: Negation masks for every inst except SWZ.
Yay?

16 years agor5xx: More emit_alu().
Corbin Simpson [Sun, 25 May 2008 18:35:20 +0000 (11:35 -0700)]
r5xx: More emit_alu().
Converted ADD.

16 years agor5xx: Add emit_mad() for FP.
Corbin Simpson [Sun, 25 May 2008 18:07:51 +0000 (11:07 -0700)]
r5xx: Add emit_mad() for FP.
If it uses MAD, emit it with emit_mad()!
(Now available at your local grocer's. Multiply and add responsibly.)

16 years agor5xx: Consolidate FP tex insts.
Corbin Simpson [Sat, 24 May 2008 18:30:57 +0000 (11:30 -0700)]
r5xx: Consolidate FP tex insts.
They're all the same, really.

16 years agor5xx: Fix SGE/SLT.
Corbin Simpson [Sat, 24 May 2008 16:17:28 +0000 (09:17 -0700)]
r5xx: Fix SGE/SLT.

16 years agor5xx: Remove some debugging cruft.
Corbin Simpson [Fri, 23 May 2008 09:05:24 +0000 (02:05 -0700)]
r5xx: Remove some debugging cruft.

16 years agor500: missed a couple of inst4s.
Dave Airlie [Sat, 24 May 2008 08:18:18 +0000 (18:18 +1000)]
r500: missed a couple of inst4s.

16 years agor500: add depth output write
Dave Airlie [Sat, 24 May 2008 08:12:26 +0000 (18:12 +1000)]
r500: add depth output write

Not sure how well this works yet, but we need to set the alpha to w_omask

16 years agor5xx: Clean up some compiler warnings.
Corbin Simpson [Fri, 23 May 2008 07:16:49 +0000 (00:16 -0700)]
r5xx: Clean up some compiler warnings.

16 years agor5xx: Move dumb_shader.
Corbin Simpson [Fri, 23 May 2008 07:14:31 +0000 (00:14 -0700)]
r5xx: Move dumb_shader.
Was getting ticked having to scroll around it, lawl.

16 years agor5xx: Add OPCODE_DST.
Corbin Simpson [Fri, 23 May 2008 07:12:37 +0000 (00:12 -0700)]
r5xx: Add OPCODE_DST.
Works completely, swizzles and everything.

16 years agor5xx: More trig work.
Corbin Simpson [Thu, 22 May 2008 09:34:57 +0000 (02:34 -0700)]
r5xx: More trig work.
SCS now works. COS/SIN have slight issues still.

16 years agor500: bump state atom size up for fp and fp constants
Dave Airlie [Thu, 22 May 2008 07:09:30 +0000 (17:09 +1000)]
r500: bump state atom size up for fp and fp constants

16 years agor5xx: Fixed LRP.
Corbin Simpson [Thu, 22 May 2008 06:35:43 +0000 (23:35 -0700)]
r5xx: Fixed LRP.
Works perfectly. It's a complex one, though, so it might fail in weird ways...

16 years agor5xx: Change debug info for readability.
Corbin Simpson [Thu, 22 May 2008 06:33:13 +0000 (23:33 -0700)]
r5xx: Change debug info for readability.
It's weird seeing the compiled program before the assembly, that's all.

16 years agor5xx: Initial (broken) OPCODE_LRP.
Corbin Simpson [Wed, 21 May 2008 20:51:32 +0000 (13:51 -0700)]
r5xx: Initial (broken) OPCODE_LRP.
Will compile, run, and not eat your kids, but the math is wrong.

16 years agor5xx: Add OPCODE_POW.
Corbin Simpson [Wed, 21 May 2008 15:24:28 +0000 (08:24 -0700)]
r5xx: Add OPCODE_POW.
Necessary for Google Earth, among other things.

16 years agor500: print out opcode string
Dave Airlie [Wed, 21 May 2008 06:00:18 +0000 (16:00 +1000)]
r500: print out opcode string

16 years agor500: set the RS unit register for R500 not R300 dangnammit..
Dave Airlie [Wed, 21 May 2008 02:14:42 +0000 (12:14 +1000)]
r500: set the RS unit register for R500 not R300 dangnammit..

So this appears to be my BUG. damn it to hell.

also fix sec color to be more like spec says.

16 years agor500: finish main texture instruction decoding
Dave Airlie [Wed, 21 May 2008 00:49:26 +0000 (10:49 +1000)]
r500: finish main texture instruction decoding

16 years agor5xx: Count refs so we don't have to guess on temp reg allocation.
Corbin Simpson [Tue, 20 May 2008 16:47:50 +0000 (09:47 -0700)]
r5xx: Count refs so we don't have to guess on temp reg allocation.
As a bonus, we can now have multiple temp temps, by slot.

16 years agor5xx: Fixup SOP insts.
Corbin Simpson [Tue, 20 May 2008 06:55:59 +0000 (23:55 -0700)]
r5xx: Fixup SOP insts.
Use the correct swizzle for alpha/SOP stuff.

16 years agor5xx: New fix for COS/SIN/SCS.
Corbin Simpson [Mon, 19 May 2008 19:26:04 +0000 (12:26 -0700)]
r5xx: New fix for COS/SIN/SCS.
Not perfect yet, but getting better.

16 years agor300/r500: fixup some of the register write sizes
Dave Airlie [Tue, 20 May 2008 06:30:36 +0000 (16:30 +1000)]
r300/r500: fixup some of the register write sizes

16 years agor300: some ctrl-m's wierd.
Dave Airlie [Tue, 20 May 2008 06:02:19 +0000 (16:02 +1000)]
r300: some ctrl-m's wierd.

16 years agor300/r500: fix RS col fmt bits
Dave Airlie [Tue, 20 May 2008 05:59:56 +0000 (15:59 +1000)]
r300/r500: fix RS col fmt bits

16 years agor5xx: Fixup emit_tex, add debugging info, enable temp temps.
Corbin Simpson [Mon, 19 May 2008 18:01:00 +0000 (11:01 -0700)]
r5xx: Fixup emit_tex, add debugging info, enable temp temps.
emit_tex now chases itself with an OUT if needed.
Added airlied's dump_program, with some fixes.

16 years agor500: add more input srcs
Dave Airlie [Mon, 19 May 2008 11:58:28 +0000 (21:58 +1000)]
r500: add more input srcs

16 years agor500: fix swz gets and some returns
Dave Airlie [Mon, 19 May 2008 11:40:40 +0000 (21:40 +1000)]
r500: fix swz gets and some returns

16 years agor500: add mask debugging
Dave Airlie [Mon, 19 May 2008 11:11:55 +0000 (21:11 +1000)]
r500: add mask debugging

16 years agor500: add fragment program debug dumper
Dave Airlie [Mon, 19 May 2008 10:24:09 +0000 (20:24 +1000)]
r500: add fragment program debug dumper

16 years agor5xx: Fix magic offsets for output fifo write masks.
Corbin Simpson [Mon, 19 May 2008 07:00:08 +0000 (00:00 -0700)]
r5xx: Fix magic offsets for output fifo write masks.
Well, this sure explains a lot.

16 years agor5xx: Swap sources for CMP.
Corbin Simpson [Mon, 19 May 2008 06:52:54 +0000 (23:52 -0700)]
r5xx: Swap sources for CMP.
Follows the same pattern as the op on r3xx/r4xx. Thanks airlied.

16 years agor5xx: Fix typo of epic proportions.
Corbin Simpson [Mon, 19 May 2008 06:35:07 +0000 (23:35 -0700)]
r5xx: Fix typo of epic proportions.

16 years agor5xx: ALU/OUT fixups.
Corbin Simpson [Mon, 19 May 2008 05:38:28 +0000 (22:38 -0700)]
r5xx: ALU/OUT fixups.
Lots of small changes. Intentionally breaks some tex stuffs.

16 years agor300: fixup US_OUT_FMT bits
Dave Airlie [Sun, 18 May 2008 07:58:29 +0000 (17:58 +1000)]
r300: fixup US_OUT_FMT bits

16 years agor500: you can have a single texcoord
Dave Airlie [Sun, 18 May 2008 05:24:38 +0000 (15:24 +1000)]
r500: you can have a single texcoord

16 years agor5xx: Add OPCODE_KIL.
Corbin Simpson [Sat, 17 May 2008 20:38:35 +0000 (13:38 -0700)]
r5xx: Add OPCODE_KIL.

16 years agor5xx: Added OPCODE_DPH.
Corbin Simpson [Sat, 17 May 2008 19:45:46 +0000 (12:45 -0700)]
r5xx: Added OPCODE_DPH.
Like DP4, but with one swizzle change.

16 years agor5xx: Fix FRC.
Corbin Simpson [Sat, 17 May 2008 16:27:35 +0000 (09:27 -0700)]
r5xx: Fix FRC.
This makes tri-frc work.
(Remind me again why I'm allowed near a compiler, lawl.)

16 years agor5xx: Fix SCS.
Corbin Simpson [Fri, 16 May 2008 18:46:26 +0000 (11:46 -0700)]
r5xx: Fix SCS.
Output instructions need to be marked OUT so they can write to the fifo.
Also, negation doesn't work with SWZ yet.

16 years agor5xx: Add OPCODE_SWZ.
Corbin Simpson [Thu, 15 May 2008 17:51:52 +0000 (10:51 -0700)]
r5xx: Add OPCODE_SWZ.
It's so easy!

16 years agor5xx: Add OPCODE_SCS.
Corbin Simpson [Thu, 15 May 2008 17:29:38 +0000 (10:29 -0700)]
r5xx: Add OPCODE_SCS.
It's disabled, though, because it doesn't work. I'll figure it out later...

16 years agor5xx: Adding more opcodes.
Corbin Simpson [Thu, 15 May 2008 07:49:32 +0000 (00:49 -0700)]
r5xx: Adding more opcodes.
EX2, FRC, LG2, SIN, RCP, and RSQ, if you care.
All of these except FRC are like COS. This pretty much rounds out the set of
opcodes which can be done in one ALU inst.

16 years agor5xx: First swing at OPCODE_COS.
Corbin Simpson [Thu, 15 May 2008 07:18:08 +0000 (00:18 -0700)]
r5xx: First swing at OPCODE_COS.

16 years agor5xx: Unbreak MAX and MIN.
Corbin Simpson [Thu, 15 May 2008 07:11:10 +0000 (00:11 -0700)]
r5xx: Unbreak MAX and MIN.
Both of them had faulty copypasta.

16 years agor500: set fragprog end to correct place
Dave Airlie [Sat, 17 May 2008 03:31:14 +0000 (13:31 +1000)]
r500: set fragprog end to correct place

16 years agor300: SC register naming cleanup
Alex Deucher [Sat, 17 May 2008 00:40:47 +0000 (10:40 +1000)]
r300: SC register naming cleanup

16 years agor500: write out the correct FP registers
Alex Deucher [Sat, 17 May 2008 00:27:11 +0000 (10:27 +1000)]
r500: write out the correct FP registers

16 years agor500: default rsunit swizzle like fglrx
Dave Airlie [Thu, 15 May 2008 10:38:41 +0000 (20:38 +1000)]
r500: default rsunit swizzle like fglrx

16 years agor500: shift tex src properly
Dave Airlie [Thu, 15 May 2008 06:24:54 +0000 (16:24 +1000)]
r500: shift tex src properly

16 years agor500: fixup r500 rs unit texture coordinate counting
Dave Airlie [Thu, 15 May 2008 05:05:40 +0000 (15:05 +1000)]
r500: fixup r500 rs unit texture coordinate counting

16 years agor500: remove some debugging
Dave Airlie [Thu, 15 May 2008 04:54:51 +0000 (14:54 +1000)]
r500: remove some debugging

16 years agor500: split output/pixel masks and emit in the correct places
Dave Airlie [Thu, 15 May 2008 04:52:39 +0000 (14:52 +1000)]
r500: split output/pixel masks and emit in the correct places

16 years agor3/500: emit RS state before VAP
Dave Airlie [Thu, 15 May 2008 04:51:50 +0000 (14:51 +1000)]
r3/500: emit RS state before VAP

16 years agor500: fixup the program allocations to be the correct sizes
Dave Airlie [Thu, 15 May 2008 03:48:31 +0000 (13:48 +1000)]
r500: fixup the program allocations to be the correct sizes

16 years agor300: set screen so that context init can find out chip ids
Dave Airlie [Thu, 15 May 2008 03:47:47 +0000 (13:47 +1000)]
r300: set screen so that context init can find out chip ids

16 years agor500: add cmp support in theory
Dave Airlie [Thu, 15 May 2008 03:24:01 +0000 (13:24 +1000)]
r500: add cmp support in theory

16 years agor500: some trivial fixups to get tri working.
Dave Airlie [Thu, 15 May 2008 03:21:50 +0000 (13:21 +1000)]
r500: some trivial fixups to get tri working.

the counter was being used one instruction over the end

16 years agor500: we just need to emit a colour for clear drop tex instruction
Dave Airlie [Thu, 15 May 2008 01:46:23 +0000 (11:46 +1000)]
r500: we just need to emit a colour for clear drop tex instruction

16 years agoR300: clean up GA registers
Alex Deucher [Tue, 13 May 2008 20:12:57 +0000 (16:12 -0400)]
R300: clean up GA registers

16 years agoR3xx: clean up ZB registers
Alex Deucher [Tue, 13 May 2008 19:46:23 +0000 (15:46 -0400)]
R3xx: clean up ZB registers

16 years agoR300: clean up CB registers
Alex Deucher [Tue, 13 May 2008 18:32:30 +0000 (14:32 -0400)]
R300: clean up CB registers

16 years agoR300: clean up Fog registers
Alex Deucher [Tue, 13 May 2008 18:02:29 +0000 (14:02 -0400)]
R300: clean up Fog registers

16 years agoR500: fixup r300EmitClearState() FP for r5xx
Alex Deucher [Tue, 13 May 2008 17:38:30 +0000 (13:38 -0400)]
R500: fixup r300EmitClearState() FP for r5xx

16 years agoR300: cleanup FS code and fill in missing details
Alex Deucher [Tue, 13 May 2008 12:37:58 +0000 (08:37 -0400)]
R300: cleanup FS code and fill in missing details

16 years agoR3xx: more PVS cleanup
Alex Deucher [Tue, 13 May 2008 10:09:55 +0000 (06:09 -0400)]
R3xx: more PVS cleanup

16 years agoMerge branch 'r500-support' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa...
Alex Deucher [Mon, 12 May 2008 15:58:35 +0000 (11:58 -0400)]
Merge branch 'r500-support' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into r500-support

16 years agoR500: add support for 4k textures
Alex Deucher [Mon, 12 May 2008 15:57:08 +0000 (11:57 -0400)]
R500: add support for 4k textures

16 years agor500: cleanup r500 RS setup
Dave Airlie [Wed, 7 May 2008 05:59:21 +0000 (15:59 +1000)]
r500: cleanup r500 RS setup

16 years agor500: for rectangular textures set to unscaled coordinates.
Dave Airlie [Wed, 7 May 2008 05:16:27 +0000 (15:16 +1000)]
r500: for rectangular textures set to unscaled coordinates.

16 years agor5xx: Fix FP inputs. (For good?)
Corbin Simpson [Wed, 7 May 2008 07:06:26 +0000 (00:06 -0700)]
r5xx: Fix FP inputs. (For good?)
FP inputs are now counted and mapped correctly, and temps
are allocated tightly and correctly.

16 years agor5xx: Fix false error with DP3/DP4.
Corbin Simpson [Wed, 7 May 2008 06:36:50 +0000 (23:36 -0700)]
r5xx: Fix false error with DP3/DP4.
DP3/DP4 only takes two arguments, but tried to load three, causing
a false fallback to the dumb shader.

16 years agor5xx: Index inputs and temps.
Corbin Simpson [Wed, 7 May 2008 05:18:28 +0000 (22:18 -0700)]
r5xx: Index inputs and temps.
This is not the same as r3xx indexing. It only tries to protect inputs on
the pixel stack from getting clobbered by temps or texs.

Texs don't need special treatment since they read from special input regs
and write to the same temp regs as ALU/FC instructions.

16 years agor5xx: FP: Add OPCODE_TXB.
Corbin Simpson [Wed, 7 May 2008 01:14:21 +0000 (18:14 -0700)]
r5xx: FP: Add OPCODE_TXB.
Tex lookup with biased LOD. Should magically work.

16 years agor5xx: FP: Make MOV/ABS look pretty.
Corbin Simpson [Wed, 7 May 2008 00:21:30 +0000 (17:21 -0700)]
r5xx: FP: Make MOV/ABS look pretty.
We can't really do anything like emit_alu, so we're doing emit_mov instead.

16 years agor5xx: Emit an OUT instruction at the end of execution.
Corbin Simpson [Tue, 6 May 2008 19:44:53 +0000 (12:44 -0700)]
r5xx: Emit an OUT instruction at the end of execution.
This should make TEX/TXP work right. (Note: "Should" is not "does.")

16 years agor5xx: We update max_temp_idx now, so no need to hard-code it.
Corbin Simpson [Tue, 6 May 2008 19:42:40 +0000 (12:42 -0700)]
r5xx: We update max_temp_idx now, so no need to hard-code it.
This roughly doubles the speed of glxgears (GINAB) by allowing
more pixels to run concurrently.

16 years agor5xx: Fix typo.
Corbin Simpson [Tue, 6 May 2008 19:18:07 +0000 (12:18 -0700)]
r5xx: Fix typo.
Gotta be more careful with my cut'n'paste, lawl.

16 years agor5xx: Use max_temp_idx.
Corbin Simpson [Tue, 6 May 2008 18:57:24 +0000 (11:57 -0700)]
r5xx: Use max_temp_idx.

16 years agor500: consolidate tex instructions
Dave Airlie [Mon, 5 May 2008 08:42:27 +0000 (18:42 +1000)]
r500: consolidate tex instructions

you cannot change a tex into an output so this means we have to actually
do another instruction after this one to mov if its an output

16 years agor500: mov cleanup macros
Dave Airlie [Mon, 5 May 2008 08:15:40 +0000 (18:15 +1000)]
r500: mov cleanup macros

16 years agor500: make tri-param work
Dave Airlie [Mon, 5 May 2008 08:05:59 +0000 (18:05 +1000)]
r500: make tri-param work

This makes constant work which are 32-bit on r500 unlike r300.

Switch MOV to using MAD no idea if we might have negative things MAX 0,-5 is
likely to do the wrong thing..

16 years agor500: make sure we emit max temp atom.
Dave Airlie [Mon, 5 May 2008 06:41:07 +0000 (16:41 +1000)]
r500: make sure we emit max temp atom.

We don't appear to update max_temp_idx yet anywhere though

16 years agor300: fix swtcl texrect path properly.
Dave Airlie [Mon, 5 May 2008 13:49:50 +0000 (23:49 +1000)]
r300: fix swtcl texrect path properly.

We really need to update the shader state so the texrect parameters work.

This should fix compiz looking crappy on rs480 and rs690

16 years agor300: Set correct VAP_CNTL per vertex program.
Markus Amsler [Sat, 3 May 2008 16:55:45 +0000 (12:55 -0400)]
r300: Set correct VAP_CNTL per vertex program.

adapted from Markus' patch on bug 15386 with updates for non-TCL
and R500.