Commit graph

29168 commits

Author SHA1 Message Date
Luca Barbieri
5f968a64dc util: implement Jose Fonseca's suggestions for u_buffer.h -> u_dynarray.h
Also describe invariants explicitly and use char* for arithmetic.
2010-04-13 06:10:31 +02:00
Corbin Simpson
c2e804a7e1 r300/compiler: Hax around instructions limits in mirroring code.
Stuff's starting to show up in arbnpot.
2010-04-12 18:24:05 -07:00
Dave Airlie
911fa4a4a1 ffvertex: don't touch tex coords if coord replace is enabled.
The fixed function vertex program shouldn't need to deal or touch tex coords
if stuffing is enabled.

Though I'm not 100% this won't break assumption made elsewhere it seems like
the correct thing to do, and makes r300g point sprites a lot easier to implement.

draw: fix point-sprite when vertex program is used.

This commit regressed draw, so fix it as well to help bisection.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:19:39 +10:00
Marek Olšák
745c4b5685 r300g: add generating texture coordinates for point sprites
[airlied -
	Convert sprite coord index to a per-coord enable bit
	set the rasteriser block up correctly for point sprites.

The inputs to the RS hw block change for sprite coords, so fix them up
properly - this fixes piglit point-sprite test.
]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-13 09:18:47 +10:00
José Fonseca
6917ef10f2 progs/gallium: Move into src/gallium/tests
Two reasons:
- progs will eventually have its own repository
- it is just to easy to forget updating the
  code for interface changes when it is outside of src
2010-04-13 07:05:46 +09:00
Luca Barbieri
6cd82eb399 gallium/auxiliary: add dynamically sized buffer/array/vector 2010-04-12 23:50:37 +02:00
Luca Barbieri
70fe9fd007 nvfx: add LRP in vertprog
glsl generates these.
2010-04-12 23:43:40 +02:00
Luca Barbieri
b385a31452 nvfx: add SIN and COS in vertprog 2010-04-12 23:43:39 +02:00
Luca Barbieri
d2e3942531 nvfx: add missing vertprog setcond instructions
Trivially adds SEQ, SGT, SLE, SNE, SFL, STR and SSG which were missing.
2010-04-12 23:43:22 +02:00
Luca Barbieri
6f65dcfb9f nvfx: allocate a bigger block for queries
This patch allocates a bigger chunk of memory to store queries in,
increasing the (hidden) outstanding query limit.
2010-04-12 23:36:21 +02:00
Luca Barbieri
9ad385fef9 nvfx: support an unlimited number of occlusion queries
Currently on nv30/nv40 an assert will be triggered once 32 queries are
outstanding.

This violates the OpenGL/Gallium interface, which requires support for
an unlimited number of fences.

This patch fixes the problem by putting queries in a linked list and
waiting on the oldest one if allocation fails.

nVidia seems to use a similar strategy, but with 1024 instead of 32 fences.
The next patch will improve this.
2010-04-12 23:36:21 +02:00
Vinson Lee
202760b437 r300g: Move declaration before code.
Fixes SCons build.
2010-04-12 12:50:41 -07:00
Luca Barbieri
31268d2107 nvfx: fix TXL opcode value
Was broken during unification
2010-04-12 20:48:52 +02:00
Luca Barbieri
7fc7b75995 nvfx: Add support for two sided color
This patch adds support for two-sided vertex color to nv30/nv40.

When set, the COLOR0/1 fs inputs on back faces will be wired to vs outputs BCOLOR0/1.
This makes OpenGL two sided lighting work, which can be tested with progs/demos/projtex.
2010-04-12 20:46:18 +02:00
Luca Barbieri
a2ddae0fc3 nvfx: fix compile error 2010-04-12 20:43:26 +02:00
Luca Barbieri
6d6acaebad nvfx: don't use hw index buffers on nv3x and nv44
They only apparently work on nv40 grclass cards, and this was the
previous behavior of the driver.

This really needs to be investigated more.
2010-04-12 20:39:09 +02:00
Luca Barbieri
f9397f34b6 nvfx: expose PIPE_FORMAT_B8G8R8X8_UNORM support
This is implemented in nvfx_state_fb and fragtex but was missing
in nvfx_screen.

This allows to avoid glCopyTexSubImage CPU fallbacks and makes Doom 3
much faster as a result.
2010-04-12 20:23:02 +02:00
Luca Barbieri
44ef1577be nvfx: add support for ARB_half_float_vertex 2010-04-12 20:20:02 +02:00
Luca Barbieri
d5dcd4ee35 st/mesa: half float vertex support (unexposed)
This was proposed by Marek Olšák and no one objected, so just
pushing it.

The extension is currently not exposed, because the mechanism to
discover if the driver actually supports this is missing.

We probably should change is_format_supported to handle this too.

This will allow to test Gallium drivers anyway in the meantime.

Based on work by Dave Airlie.

Changes by me:
1. Fix assertion in st
2. Change to use unpadded Gallium formats
2010-04-12 20:19:56 +02:00
Luca Barbieri
f9c665e9e6 nvfx: allocate buffers in GART if !NOUVEAU_SWTNL
Should improve performance and fix serious regressions on AGP cards.
2010-04-12 18:53:30 +02:00
Luca Barbieri
8f0d5382e3 nvfx: move check for NOUVEAU_SWTNL 2010-04-12 18:06:06 +02:00
Luca Barbieri
f647f46e03 nvfx: remove #include "nouveau_stateobj.h"
No longer used, finally!
2010-04-12 12:21:25 +02:00
Luca Barbieri
330925d911 nvfx: rework validation logic to use code and avoid stateobjs
This makes the code faster due to the lack of indirect calls and also
makes it much easier to understand what is actually going on.
2010-04-12 12:21:25 +02:00
Luca Barbieri
26e40448be nvfx: add NVFX_NEW_{FRAG,VERT}CONST 2010-04-12 12:13:23 +02:00
Luca Barbieri
5eb6b1a981 nvfx: so->RING_3D: vertprog
We could use an sb here instead, but there is no obvious performance
advantage, and perhaps there could be a disadvantage.
2010-04-12 12:13:23 +02:00
Luca Barbieri
f768528af5 nvfx: so->RING_3D: sr 2010-04-12 12:13:17 +02:00
Luca Barbieri
4b3b54d746 nvfx: so->sb: blend 2010-04-12 12:13:17 +02:00
Luca Barbieri
180654d2bb nvfx: so->sb: zsa 2010-04-12 12:13:17 +02:00
Luca Barbieri
cbe8ed435a nvfx: so->sb: rasterizer 2010-04-12 12:13:17 +02:00
Luca Barbieri
c8201c833c nvfx: so->RING_3D: screen 2010-04-12 12:13:17 +02:00
Luca Barbieri
4dbd029a76 nvfx: so->RING_3D: viewport 2010-04-12 12:13:17 +02:00
Luca Barbieri
f8f29e6191 nvfx: so->RING_3D: stipple 2010-04-12 12:13:17 +02:00
Luca Barbieri
5c89cb0f6c nvfx: so->RING_3D: scissor 2010-04-12 12:13:16 +02:00
Luca Barbieri
6558797f99 nvfx: so->RING_3D: blend 2010-04-12 12:13:16 +02:00
Luca Barbieri
f320176b71 nvfx: so->RING_3D: fb 2010-04-12 12:13:16 +02:00
Luca Barbieri
b3cc1adc14 nvfx: so->RING_3D: fragprog 2010-04-12 12:13:16 +02:00
Luca Barbieri
631f6f5616 nvfx: so->RING_3D: fragtex 2010-04-12 12:13:16 +02:00
Luca Barbieri
f5b6cc6699 nvfx: so->RING_3D: vbo 2010-04-12 12:13:16 +02:00
Luca Barbieri
c0341b22ca nvfx: stop using flush_notify
Rather than emitting relocations on flush notifications, emit them
in nvfx_state_start.
2010-04-12 12:13:16 +02:00
Luca Barbieri
188b579e30 nouveau: add state buffers, lightweight replacement for state objects
Just a dumb buffer, allowed by the RING_3D/fixed subchannel binding and
no support for relocations.

This is *much* faster than state objects.
2010-04-12 12:13:16 +02:00
Luca Barbieri
d75f99ab0c nouveau: don't autobind in state objects relocations
Autobinding creates additional pushbuffer usage which may not be
accounted in callers, and is also slow.

The next relocations patch depends on this for correctness.

Assert instead if the objects are not bound, which should happen at
screen creation time.
2010-04-12 12:13:15 +02:00
Luca Barbieri
e0af5c9b54 nouveau: bind the 3D engine to subchannel 7 and add RING_3D
RING_3D creates a method start for subchannel 7.

Bind the 3D engine to a fixed subchannel to make it work

This is much faster than the old BEGIN_RING, since we don't need
to waste cycles trying to "autobind" stuff, when a fast static binding
is perfectly good.

Subchannel 7 is chosen because the kernel takes up the lowest ones.
2010-04-12 12:13:15 +02:00
Luca Barbieri
507dc546c3 nvfx: avoid flushes in primitives
Currently we miscalculate the space needed to push vertices, causing
flushes where they should not happen.

Use a much more conservative estimate to fix it.

It will be done better in the future (e.g. using the nv50 primitive
splitter).
2010-04-12 12:13:15 +02:00
Corbin Simpson
f0b8677d57 r300/compiler: Comment code, add much better mirror maths. 2010-04-12 03:03:37 -07:00
Luca Barbieri
a57dcef636 nvfx: fix bind flags 2010-04-12 11:49:09 +02:00
Corbin Simpson
d5af1dce8f r300/compiler: Implement texcoord repeat and mirror for NPOT. 2010-04-11 23:39:24 -07:00
Corbin Simpson
f95ff1cf48 r300g: Setup external state for wrap modes. 2010-04-11 23:39:24 -07:00
Corbin Simpson
8f37f910bf r300g: Cleanup fragment program external state setup. 2010-04-11 23:39:23 -07:00
Corbin Simpson
484079d724 r300/compiler: Add NPOT compatibility fields to external state.
Completely unused for now.
2010-04-11 23:38:24 -07:00
José Fonseca
d67e3487ac llvmpipe: Respect pipe_sampler_view::format. 2010-04-12 15:32:23 +09:00