Commit graph

32413 commits

Author SHA1 Message Date
Michal Krol
dbf20a1f0f st/mesa: Cache FBO texture's sampler view object. 2010-03-15 13:22:40 +01:00
Keith Whitwell
08189e6391 nvfx: fix up after merge 2010-03-15 10:27:25 +00:00
Keith Whitwell
506130fff5 r300g: fix up after merge 2010-03-15 10:24:55 +00:00
Keith Whitwell
42910ebe7b Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
	src/gallium/drivers/nv30/nv30_context.h
	src/gallium/drivers/nv30/nv30_state.c
	src/gallium/drivers/nv40/nv40_context.h
	src/gallium/drivers/nv40/nv40_state.c
	src/gallium/drivers/r300/r300_emit.c
2010-03-15 09:44:52 +00:00
Dave Airlie
68e58a96e8 r300g: rebuild screen/winsys interface
This creates a cleaner winsys and drop the simple screen stuff.

It makes r300g use pb_bufmgr structs.

It also tries to avoid overheads from mapping too often.

v5: clean warnings

v6: break out of cache check on first buffer - since most likely
the first busy one implies all after it are busy.

v7: cleanup a bit

v8-merged: drop cman for now to just get all the interface changes in first.
rework to changes that happened upstream

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-15 18:36:47 +10:00
Ben Skeggs
a899c5a76e nv50: reset vbo_fifo before each validate 2010-03-15 16:53:46 +10:00
Luca Barbieri
9b3a908736 nvfx: remove src_native_swz, which was a no-op
src_native_swz was used to translate 0/1 swizzles back when Gallium
supported them.

That support was later removed from Gallium, and the function currently
always returns true.

Remove it.
2010-03-15 00:03:05 -04:00
Luca Barbieri
49f2a89956 nvfx: clean up shader header
Currently the behavior of shader.h depends on some constants that
are defined differently in vertex and fragment programs.

This patch cleans that up by splitting the relevant symbols in
vertex program and fragment program variants
2010-03-15 00:03:05 -04:00
Luca Barbieri
a174db480b nvfx: draw: make swtnl draw_elements actually work.
It was totally broken: the index buffer was passed as NULL!
2010-03-15 00:03:04 -04:00
Luca Barbieri
152dffd3e1 nvfx: draw: emit color as floating point
Don't lose precision by converting to u8.
2010-03-15 00:03:04 -04:00
Luca Barbieri
ac7ae8bc6a nvfx: draw: make perspective corrective texturing work
We must divide everything in the position by w, and emit position as
a 4-component vector.

Not sure why we must divide, but it works (see progs/redbook/checker).
2010-03-15 00:03:04 -04:00
Luca Barbieri
ad2d0c2639 nvfx: draw: create draw vp with ureg
This avoids duplicating the vertex program generation logic and
makes the same code work for both nv30 and nv40.
2010-03-15 00:03:04 -04:00
Luca Barbieri
d40a069206 nvfx: add NOUVEAU_SWTNL to force swtnl at runtime
Replace the FORCE_SWTNL macro with a NOUVEAU_SWTNL environment variable.
2010-03-15 00:03:04 -04:00
Luca Barbieri
dbe63ed3b6 nvfx: move nv04_surface_2d.c into nvfx directory
It is only used on pre-nv50 and nvfx is the only Gallium pre-nv50 driver.
2010-03-15 00:03:04 -04:00
Luca Barbieri
e1580ce4c9 nvfx: fix quads drawing
The primitive splitting code is totally broken and will be rewritten.

Fix the most important bug now though.
2010-03-15 00:03:04 -04:00
Luca Barbieri
0192a4a825 nvfx: fix viewport state after bypass removal for swtnl
The adjustment of nv30/nv40 after the removal of bypass incorrectly
removed the hardware viewport bypass code, which we still need for
swtnl and also forgot to remove NVFX_NEW_RAST from pipe.
2010-03-15 00:03:04 -04:00
Luca Barbieri
f9d09a2e78 nv30, nv40: move last files to nvfx/ and rm -rf nv30 nv40
This is the last nvfx unification patch.

nv[34]0_fragtex.c are moved to the common directory
nv[34]0_shader.h are renamed to nv[34]0_vertprog.h and moved to
the common directory

The separate nv30 and nv40 directories are removed from the build
system
2010-03-15 00:03:04 -04:00
Luca Barbieri
7d210fa05f nv30, nv40: partially non-trivially unify sampler state in nv[34]0_state.c
Many things, like texture wrap modes and min/mag filters are common.

Some others, like annisotropy and lod settings, are not.
2010-03-15 00:03:03 -04:00
Luca Barbieri
5bb68e5d17 nv30, nv40: partially non-trivially unify nv[34]0_fragtex.c
The bulk files cannot be unified, but the frontend can and allows to
share some code and simplify state_emit.c
2010-03-15 00:03:03 -04:00
Luca Barbieri
da5103c3b3 nv30, nv40: unify nv[34]0_context.c
They are now almost identical, except for nv30 vs nv40 fragtex
initialization.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6992be5433 nv30, nv40: fully unify nv[34]0_context.h
Move the remaining content to the common header.
2010-03-15 00:03:03 -04:00
Luca Barbieri
10f464fc10 nv30, nv40: non-trivially unify nv[34]0_screen.c
The files have the same structure but are substantially different.

They are unified with appropriate conditionals.
2010-03-15 00:03:03 -04:00
Luca Barbieri
840c36f5e6 nv30, nv40: non-trivially unify nv[34]0_vertprog.c
vertprog.c is similar but has substantial differences:
1. nv40 supports clip planes
2. nv40 uses a more advanced register allocator
3. Some register setup is different
4. Constants with the same name have different values

This patch unifies the two files.
nv30 gains clip plane support and the nv40 register allocator.

A new NVFX_VP(x) macro is introduced that at runtime resolved to
either the nv30 or the nv40 constant value.

nv30 clip planes are not tested and might not work
2010-03-15 00:03:03 -04:00
Luca Barbieri
c65a8f3ed2 nv30, nv40: partially unify nv[34]0_state.c
state.c is identical except for:
1. Sampler state creation is different
2. nv40 swtnl support
3. Separate blend equations on nv40

This patch unifies nv[34]0_state.c, except the sampler state creation code.
2010-03-15 00:03:03 -04:00
Luca Barbieri
6e1d0fc5eb nv30, nv40: unify nv[34]0_vbo.c
The files are identical, except for swtnl support which is commented
out on nv30 and restart being initialized on nv30 to avoid a compiler
warning.
2010-03-15 00:03:03 -04:00
Luca Barbieri
f9eafeca29 nv30, nv40: non-trivially unify nv[34]0_draw.c
nv30_draw.c is a stub.

This patch makes both nv30 and nv40 use the nv40 swtnl path.

Note that this doesn't actually work on nv30 because the vertex program is
encoded in the nv40-only layout.

However, swtnl was unimplemented before on nv30, so this is not a regression.
Furthermore, a patch to fix this is available near the end of the patchset.
2010-03-15 00:03:03 -04:00
Luca Barbieri
bcb37411fc nv30, nv40: non-trivially unify nv[34]0_fragprog.c
The files are mostly the same except:
1. On NV40, some TGSI instructions are emulated with several hardware ones
2. Some instructions such as DDX/DDY, and STR were missing from nv30
3. NV40 has more sophisticated register management

nv30 now supports all instructions and uses the nv40 register management.
2010-03-15 00:03:02 -04:00
Luca Barbieri
d9e396ce4a nv30, nv40: non-trivially partially unify nv[34]0_shader.h
shader.h is similar, except for the following differences:
1. The instruction sets are not exactly the same, but mostly similar
2. Vertex program fields are in different bit positions

This patch unifies all parts of nv[34]0_shader.h except the vertex
program fields.

Vertex opcodes are also changed so that the constant names includes
SCA if it is a scalar opcode and VEC if it is a vector opcode.
2010-03-15 00:03:02 -04:00
Luca Barbieri
cd0d03adab nv30, nv40: non-trivially unify nv[34]0_state_fb.c
The files are significantly different due to:
1. nv30 support 2 render targets, nv40 4
2. z-buffer pitch is set differently
3. nv30 has a limitation of colour_bits >= zeta_bits. This may not
   actually exist in the driver though
4. nv30 points color0 at depth in the depth-only case
5. nv30 sets NV34TCL_VIEWPORT_TX_ORIGIN to 0. This is probably
   unnecessary

This patch attempts to unify the two files and preserve the existing
behavior.
2010-03-15 00:03:02 -04:00
Luca Barbieri
4d93ef1a01 nv30, nv40: unify nv[34]0_state_viewport.c
The files are identical, except for an extra comment in nv30.
2010-03-15 00:03:02 -04:00
Luca Barbieri
9937116c7b nv30, nv40: unify nv[34]0_query.c
The files are identical except formatting.
2010-03-15 00:03:02 -04:00
Luca Barbieri
8611a31bb4 nv30, nv40: unify nv[34]0_miptree.c
The only difference between nv30 and nv40 is that nv30 allowed swizzling
for more texture types.

This patch preserves the existing behavior, using conditional code.

Note however that this does not make sense, since all texture types can
be swizzled on nv40 and probably on nv30 too.

However, the handling of swizzled surfaces in the current 2D code is
partially broken, so it's best not to touch this.

A whole rewrite of the 2D code will be submitted, which will solve this
problem.
2010-03-15 00:03:02 -04:00
Luca Barbieri
e392e0b148 nv30, nv40: unify nv[34]0_state_stipple.c
The files are identical, except for the fact that the nv40 version
forgets to unreference the stateobj.

Unified to the correct nv30 version.
2010-03-15 00:03:02 -04:00
Luca Barbieri
64d882637d nv30, nv40: unify identical nv[34]0_state_zsa.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
938c6905cf nv30, nv40: unify identical nv[34]0_state_scissor.c 2010-03-15 00:03:02 -04:00
Luca Barbieri
ada801222b nv30, nv40: unify identical nv[34]0_state_rasterizer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
0b55e1cd17 nv30, nv40: unify identical nv[34]0_state_blend.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
778c64da97 nv30, nv40: non-trivially unify nv[34]0_state_emit.c
The files are the same except for swtnl support on nv40 and for
texture cache flushing on nv40.

Unify them, and use a macro to define 4 versions of render_states,
for all combinations of nvfx and hwtnl/swtnl.
2010-03-15 00:03:01 -04:00
Luca Barbieri
d084d189d0 nv30, nv40: unify identical nv[34]0_transfer.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
c5c7b69bda nv30, nv40: unify identical nv[34]0_clear.c 2010-03-15 00:03:01 -04:00
Luca Barbieri
6321a18331 nvfx: add nvfx directory to build system
Will be used to hold source files unified between nv30 and nv40.

Eventually all nv30 and nv40 code will be moved there and the
nv30 and nv40 directories will be removed.
2010-03-15 00:03:01 -04:00
Luca Barbieri
6518a1c853 nv30, nv40: add is_nv4x member to context and screen structs
This will make it faster to check for nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
b8e56d4cdd nv30, nv40: unify all structures and headers, except shaders
This patch unifies nv[34]0_screen.h, nv[34]0_context.h and
nv[34]0_state.h

The unified files are put in a new "nvfx" directory.

nv30_context.h and nv40_context.h still exist to hold the function
prototypes and include nvfx_context.h

nv[34]0_screen.h and nv[34]0_state.h are deleted, replaced by the
unified versions.

nv40 includes some extra fields for swtnl and user clip planes
support.

These fields will be unused on nv30 until that functionality gets
added to it too (by unification with nv40).
2010-03-15 00:03:01 -04:00
Luca Barbieri
d673c92810 nouveau: s/rankine/eng3d/g; s/curie/eng3d/g
Result of running:
perl -i -p -e 's/rankine/eng3d/g; s/curie/eng3d/g;' nv[34]0/*.[ch]

This will allow to more easily unify nv30 and nv40.
2010-03-15 00:03:01 -04:00
Luca Barbieri
1771d8f8f4 nv30: remove unused on_hw field and constant fp_reg_control field
This makes nv30_state.h equivalent to nv40_state.h
2010-03-15 00:03:00 -04:00
Luca Barbieri
5f71414fc9 nv40: use NV34TCL_ constants where available
It was decided to just use the NV34TCL_ constants for constants
common between nv30 and nv40, and deprecate the NV40TCL_ versions.

This patch changes the nv40 driver to use NV34TCL_ constants for
common functionality.

This reduces differences between nv30 and nv40 to ease further
unification.
2010-03-15 00:03:00 -04:00
Vinson Lee
883aa5974b r300g: Remove unnecessary headers. 2010-03-14 16:43:01 -07:00
George Sapountzis
631a1a9ac8 dri/common: mv __driUtilMessage to utils.c
allows to link with xmlconfig without dri_util, and has nothing drm-specific.
2010-03-15 01:17:18 +02:00
George Sapountzis
7a62c60ca9 dri/swrast: add comment in case it's not clear 2010-03-15 01:17:18 +02:00
George Sapountzis
e557c2e14f dri/swrast: drop mtypes.h from dri_sw 2010-03-15 01:17:18 +02:00