mesa.git
16 years agomesa: fix vertex array validation test for attribute 0 (vert pos)
Brian Paul [Thu, 3 Jul 2008 01:18:10 +0000 (19:18 -0600)]
mesa: fix vertex array validation test for attribute 0 (vert pos)

We don't actually need vertex array[0] enabled when using a vertex
program/shader.

cherry-picked from master

16 years agogallium: replace an assertion with "if (!texobj) continue"
Brian Paul [Thu, 3 Jul 2008 01:11:49 +0000 (19:11 -0600)]
gallium: replace an assertion with "if (!texobj) continue"

It's possible to call update_samplers() between the time a fragment shader
is bound and when a texture image is defined (such as glClear).  This
fixes the case where we don't have a complete texture object yet.

16 years agogallium: fix a bug in vertex program output mapping
Brian Paul [Thu, 3 Jul 2008 01:07:11 +0000 (19:07 -0600)]
gallium: fix a bug in vertex program output mapping

Need to translate VERT_RESULT_PSIZ, BFC0, BFC1 to TGSI shader output slots
after all other attributes have been handled.  This fixes a bug where
generic vertex program outputs (varying vars) could get mapped to the
same slot at point size or back-face colors.

16 years agogallium: nr_attrs was off by one, updated comments, minor code movement
Brian Paul [Thu, 3 Jul 2008 01:05:18 +0000 (19:05 -0600)]
gallium: nr_attrs was off by one, updated comments, minor code movement

16 years agomesa: additional GLSL built-in constants
Brian Paul [Wed, 2 Jul 2008 23:10:42 +0000 (17:10 -0600)]
mesa: additional GLSL built-in constants

16 years agomesa: when linking a shader program, make sure all the shaders compiled OK
Brian Paul [Wed, 2 Jul 2008 23:08:47 +0000 (17:08 -0600)]
mesa: when linking a shader program, make sure all the shaders compiled OK

cherry-picked from master

16 years agomesa: added some debug code (disabled)
Brian Paul [Wed, 2 Jul 2008 23:08:28 +0000 (17:08 -0600)]
mesa: added some debug code (disabled)

cherry-picked from master

16 years agomesa: fix error codes in _mesa_shader_source(), _mesa_get_shader_source()
Brian Paul [Wed, 2 Jul 2008 23:08:09 +0000 (17:08 -0600)]
mesa: fix error codes in _mesa_shader_source(), _mesa_get_shader_source()

If the 'shader' parameter is wrong, need to either generate GL_INVALID_VALUE
or GL_INVALID_OPERATION.  It depends on whether 'shader' actually names a
'program' or is a totally unknown ID.
There might be other cases to fix...

cherry-picked from master

16 years agomesa: regenerated file
Brian Paul [Wed, 2 Jul 2008 23:06:26 +0000 (17:06 -0600)]
mesa: regenerated file

16 years agomesa: added some missing equal() notEqual() intrinsics
Brian Paul [Wed, 2 Jul 2008 23:05:56 +0000 (17:05 -0600)]
mesa: added some missing equal() notEqual() intrinsics

cherry-picked from master

16 years agomesa: disable some debug assertions
Brian Paul [Wed, 2 Jul 2008 18:47:18 +0000 (12:47 -0600)]
mesa: disable some debug assertions

We can sometimes fail these assertions because of how swizzled storage
works.  Will revisit someday.

16 years agomesa: regenerated files
Brian Paul [Wed, 2 Jul 2008 18:46:18 +0000 (12:46 -0600)]
mesa: regenerated files

16 years agomesa: fix all(bvec2) function typo, add missing bvec2/3/4() constuctors
Brian Paul [Wed, 2 Jul 2008 18:45:55 +0000 (12:45 -0600)]
mesa: fix all(bvec2) function typo, add missing bvec2/3/4() constuctors

cherry-picked from master

16 years agogallium: replace 128 with MAX_LABELS
Brian Paul [Wed, 2 Jul 2008 18:41:18 +0000 (12:41 -0600)]
gallium: replace 128 with MAX_LABELS

16 years agomesa: added _mesa_print_swizzle() debugging helper
Brian Paul [Wed, 2 Jul 2008 18:40:03 +0000 (12:40 -0600)]
mesa: added _mesa_print_swizzle() debugging helper

16 years agomesa: fix issues around multisample enable
Roland Scheidegger [Wed, 2 Jul 2008 18:08:27 +0000 (20:08 +0200)]
mesa: fix issues around multisample enable

multisample enable is enabled by default, however gl mandates multisample
rendering rules only apply if there's also a multisampled buffer.

16 years agogallium: Allow draw module to work on non-x86 platforms again.
Michel Dänzer [Wed, 2 Jul 2008 10:10:15 +0000 (12:10 +0200)]
gallium: Allow draw module to work on non-x86 platforms again.

16 years agopipebuffer: Debug buffer manager to detect buffer under- and overflows.
José Fonseca [Wed, 2 Jul 2008 03:24:19 +0000 (12:24 +0900)]
pipebuffer: Debug buffer manager to detect buffer under- and overflows.

It should detect both cpu and gpu buffer overflows.

16 years agopipebuffer: Verify usage flag consistency. Minor cleanups.
José Fonseca [Wed, 2 Jul 2008 03:22:51 +0000 (12:22 +0900)]
pipebuffer: Verify usage flag consistency. Minor cleanups.

16 years agomesa: fix a GLSL vector subscript/writemask bug
Brian Paul [Wed, 2 Jul 2008 00:40:23 +0000 (18:40 -0600)]
mesa: fix a GLSL vector subscript/writemask bug

This fixes a failure for cases like:
   vec4 v;
   v[1] *= 2.0;

The v[1] actually acts like a writemask, equivalent to v.y
The fix is a bit convoluted, but will do for now.

cherry-picked from master

16 years agomesa: move some functions
Brian Paul [Wed, 2 Jul 2008 00:39:46 +0000 (18:39 -0600)]
mesa: move some functions

cherry-picked from master

16 years agomesa: make _slang_swizzle_swizzle() non-private
Brian Paul [Wed, 2 Jul 2008 00:39:22 +0000 (18:39 -0600)]
mesa: make _slang_swizzle_swizzle() non-private

cherry-picked from master

16 years agomesa: better function inlining in the presence of 'return' statements
Brian Paul [Tue, 1 Jul 2008 17:48:57 +0000 (11:48 -0600)]
mesa: better function inlining in the presence of 'return' statements

Before, the presence of a 'return' statement always prevented inlining
a function.  This was because we didn't want to accidentally return from
the _calling_ function.  We still need the semantic of 'return' when inlining
but we can't always use unconditional branches/jumps (GPUs don't always
support arbitrary branching).

Now, we allow inlining functions w/ return if the return is the last
statement in the function.  This fixes the common case of a function
that returns a value, such as:

vec4 square(const in vec4 x)
{
   return x * x;
}

which effectively compiles into:

vec4 square(const in vec4 x)
{
   __retVal = x * x;
   return;
}

The 'return' can be no-op'd now and we can inline the function.

cherry-picked from master

16 years agomesa: add/fix some IrInfo entries for debugging purposes
Brian Paul [Tue, 1 Jul 2008 17:48:27 +0000 (11:48 -0600)]
mesa: add/fix some IrInfo entries for debugging purposes

cherry-picked from master

16 years agoi915: Last reference to surface -> pitch
Jakob Bornecrantz [Tue, 1 Jul 2008 13:52:37 +0000 (15:52 +0200)]
i915: Last reference to surface -> pitch

16 years agogallium: Use the inline keyword on C++.
José Fonseca [Tue, 1 Jul 2008 13:04:58 +0000 (22:04 +0900)]
gallium: Use the inline keyword on C++.

16 years agoscons: Output mapfile on windows ddk profile builds.
José Fonseca [Tue, 1 Jul 2008 13:04:01 +0000 (22:04 +0900)]
scons: Output mapfile on windows ddk profile builds.

16 years agog3dvl: Use block and stride instead of cpp and pitch.
Younes Manton [Mon, 30 Jun 2008 23:26:22 +0000 (19:26 -0400)]
g3dvl: Use block and stride instead of cpp and pitch.

16 years agog3dvl: Simplify shader code.
Younes Manton [Mon, 30 Jun 2008 00:52:58 +0000 (20:52 -0400)]
g3dvl: Simplify shader code.

16 years agog3dvl: Support for field and frame based MC for progressive pictures.
Younes Manton [Sun, 29 Jun 2008 00:16:01 +0000 (20:16 -0400)]
g3dvl: Support for field and frame based MC for progressive pictures.

MC support for frame and field based motion prediction. Also various bug
fixes, clean up.

16 years agog3dvl: Work around SP tex cache bug, specify resource usage flags.
Younes Manton [Thu, 19 Jun 2008 02:21:11 +0000 (22:21 -0400)]
g3dvl: Work around SP tex cache bug, specify resource usage flags.

16 years agog3dvl: Get rid of some Valgrind errors.
Younes Manton [Tue, 17 Jun 2008 03:18:20 +0000 (23:18 -0400)]
g3dvl: Get rid of some Valgrind errors.

Get rid of some Valgrind memory leak and uninitialized var errors.

16 years agogles: Don't define GLAPIENTRY here.
José Fonseca [Mon, 30 Jun 2008 03:49:14 +0000 (12:49 +0900)]
gles: Don't define GLAPIENTRY here.

16 years agonouveau: oops, bump the drm patchlevel back down again
Ben Skeggs [Sun, 29 Jun 2008 06:02:01 +0000 (16:02 +1000)]
nouveau: oops, bump the drm patchlevel back down again

16 years agonv50: fixes after rebase + commits note on the code that was just pushed.
Ben Skeggs [Sun, 29 Jun 2008 05:59:24 +0000 (15:59 +1000)]
nv50: fixes after rebase + commits note on the code that was just pushed.

OK, seems a lot of people have been getting the idea that nouveau is
dying lately - I decided to commit some of the work I've been doing lately
to prove them wrong :)  Progress on my side is slow due to lack of time
mainly, but I'm still around.

Firstly, don't even bother trying to use gallium on G8x/G9x yet, it won't
work.  I've deliberately left all the necessary winsys changes out of the
commits for a very good reason - I don't know what we're going to need from
the DRM exactly yet and don't want to be continually breaking interfaces
as I discover additional requirements.  On my side, I think I've gone
through about 3 different DRM interface changes, and have just discovered
that I may need more yet.  It'd be very annoying for everyone who uses
nouveau to keep things in sync.  Once I've got it sorted - I'll commit a
lot of cool stuff. Stay tuned.

Also, don't look at the shader code.. it's horribly nasty and full of hacks,
I used it as an opportunity to learn G8x GPU programs at the same time.
New semi-decent code is in works, and will follow at some point. :)

16 years agonv50: reverse stencil sides, header is wrong
Ben Skeggs [Tue, 24 Jun 2008 20:07:02 +0000 (06:07 +1000)]
nv50: reverse stencil sides, header is wrong

16 years agonv50: fix line stipple
Ben Skeggs [Tue, 24 Jun 2008 20:01:30 +0000 (06:01 +1000)]
nv50: fix line stipple

16 years agonv50: don't multiply polygon offset units by 2.0 like on nv40
Ben Skeggs [Tue, 24 Jun 2008 19:58:35 +0000 (05:58 +1000)]
nv50: don't multiply polygon offset units by 2.0 like on nv40

16 years agonv50: maybe some scissor fixes..
Ben Skeggs [Tue, 24 Jun 2008 19:17:08 +0000 (05:17 +1000)]
nv50: maybe some scissor fixes..

16 years agonv50: vpt translate/scale backwards
Ben Skeggs [Tue, 24 Jun 2008 19:11:46 +0000 (05:11 +1000)]
nv50: vpt translate/scale backwards

16 years agonv50: whoops
Ben Skeggs [Tue, 24 Jun 2008 18:57:27 +0000 (04:57 +1000)]
nv50: whoops

16 years agonv50: rework miptree/texture/texsurf code a bit
Ben Skeggs [Tue, 24 Jun 2008 18:53:34 +0000 (04:53 +1000)]
nv50: rework miptree/texture/texsurf code a bit

16 years agonv50: turn on depth test/write again, not 100% but winsys handles it better
Ben Skeggs [Tue, 24 Jun 2008 17:56:57 +0000 (03:56 +1000)]
nv50: turn on depth test/write again, not 100% but winsys handles it better

16 years agonv50: maintain pipe surface status field
Ben Skeggs [Mon, 23 Jun 2008 13:43:34 +0000 (23:43 +1000)]
nv50: maintain pipe surface status field

16 years agonv50: remove some debug
Ben Skeggs [Mon, 23 Jun 2008 13:42:53 +0000 (23:42 +1000)]
nv50: remove some debug

16 years agonv50: simplify emit_interp a bit
Ben Skeggs [Wed, 18 Jun 2008 03:23:00 +0000 (13:23 +1000)]
nv50: simplify emit_interp a bit

16 years agonv50: make sure static buffers (constbuf, tex control etc) get on reloc list
Ben Skeggs [Tue, 17 Jun 2008 13:55:23 +0000 (23:55 +1000)]
nv50: make sure static buffers (constbuf, tex control etc) get on reloc list

16 years agonv50: R32_FLOAT vbo format
Ben Skeggs [Tue, 17 Jun 2008 13:52:41 +0000 (23:52 +1000)]
nv50: R32_FLOAT vbo format

16 years agonv50: move surface_map/unmap into nv50_surface.c
Ben Skeggs [Tue, 17 Jun 2008 13:43:38 +0000 (23:43 +1000)]
nv50: move surface_map/unmap into nv50_surface.c

16 years agonv50: some people are just born stupid.. really..
Ben Skeggs [Mon, 16 Jun 2008 15:51:13 +0000 (01:51 +1000)]
nv50: some people are just born stupid.. really..

16 years agonv50: make TEX a halfie
Ben Skeggs [Mon, 16 Jun 2008 15:36:36 +0000 (01:36 +1000)]
nv50: make TEX a halfie

16 years agonv50: get tri-scissor-tri working
Ben Skeggs [Mon, 16 Jun 2008 12:34:50 +0000 (22:34 +1000)]
nv50: get tri-scissor-tri working

16 years agonv50: separate state validation and upload, similar to nv40
Ben Skeggs [Mon, 16 Jun 2008 12:24:16 +0000 (22:24 +1000)]
nv50: separate state validation and upload, similar to nv40

16 years agonv50: fix blend colour
Ben Skeggs [Mon, 16 Jun 2008 12:06:54 +0000 (22:06 +1000)]
nv50: fix blend colour

16 years agonv50: use stateobjs for sampler/image_control uploads
Ben Skeggs [Mon, 16 Jun 2008 12:02:02 +0000 (22:02 +1000)]
nv50: use stateobjs for sampler/image_control uploads

16 years agonv50: hack of a TEX opcode
Ben Skeggs [Mon, 16 Jun 2008 08:56:39 +0000 (18:56 +1000)]
nv50: hack of a TEX opcode

16 years agonv50: hacks for stuff I don't really get yet
Ben Skeggs [Mon, 16 Jun 2008 08:03:29 +0000 (18:03 +1000)]
nv50: hacks for stuff I don't really get yet

16 years agonv50: abuse constbuf upload for program upload
Ben Skeggs [Mon, 16 Jun 2008 06:29:40 +0000 (16:29 +1000)]
nv50: abuse constbuf upload for program upload

16 years agonv50: a couple more bits'n'pieces
Ben Skeggs [Mon, 16 Jun 2008 02:55:53 +0000 (12:55 +1000)]
nv50: a couple more bits'n'pieces

16 years agonv50: disable inline IMMD for now, IMMD+pred == BANG!
Ben Skeggs [Sun, 15 Jun 2008 05:53:22 +0000 (15:53 +1000)]
nv50: disable inline IMMD for now, IMMD+pred == BANG!

fixes progs/fp/lit.txt

16 years agonv50: simplify interp crap a bit...
Ben Skeggs [Sun, 15 Jun 2008 05:49:25 +0000 (15:49 +1000)]
nv50: simplify interp crap a bit...

hopefully there wasn't a good reason I went the route I did.. can't recall..

16 years agonv50: do tsc/tic upload + stub out shader TEX stuff
Ben Skeggs [Fri, 13 Jun 2008 02:09:46 +0000 (12:09 +1000)]
nv50: do tsc/tic upload + stub out shader TEX stuff

16 years agonv50: disable ztest for now - it doesn't work still
Ben Skeggs [Fri, 13 Jun 2008 01:50:13 +0000 (11:50 +1000)]
nv50: disable ztest for now - it doesn't work still

16 years agonv50: flag to indicate to winsys we want a surface for use as a zeta buffer
Ben Skeggs [Fri, 13 Jun 2008 00:58:27 +0000 (10:58 +1000)]
nv50: flag to indicate to winsys we want a surface for use as a zeta buffer

NVIDIA love to make life difficult.. we need different flags in PTEs for
zeta.. yay.. not.

16 years agonv50: comment on a so-far unseen bug
Ben Skeggs [Thu, 12 Jun 2008 13:49:26 +0000 (23:49 +1000)]
nv50: comment on a so-far unseen bug

16 years agonv50: another vbo format
Ben Skeggs [Thu, 12 Jun 2008 04:47:17 +0000 (14:47 +1000)]
nv50: another vbo format

16 years agonv50: fix blend cso
Ben Skeggs [Thu, 12 Jun 2008 04:40:20 +0000 (14:40 +1000)]
nv50: fix blend cso

16 years agonv50: valgrind complaint
Ben Skeggs [Thu, 12 Jun 2008 04:21:28 +0000 (14:21 +1000)]
nv50: valgrind complaint

16 years agonv50: draw_elements() - inline only for the moment
Ben Skeggs [Thu, 12 Jun 2008 04:15:38 +0000 (14:15 +1000)]
nv50: draw_elements() - inline only for the moment

16 years agonv50: support a couple more common VBO formats
Ben Skeggs [Thu, 12 Jun 2008 03:59:51 +0000 (13:59 +1000)]
nv50: support a couple more common VBO formats

16 years agonv50: remove some cruft, don't upload program unless really needed
Ben Skeggs [Thu, 12 Jun 2008 03:50:56 +0000 (13:50 +1000)]
nv50: remove some cruft, don't upload program unless really needed

16 years agonv50: more efficient const upload + fixes (fp/* works now!)
Ben Skeggs [Thu, 12 Jun 2008 03:11:41 +0000 (13:11 +1000)]
nv50: more efficient const upload + fixes (fp/* works now!)

16 years agonv50: use constbuf segment 0 for everything - I can't make the others work..
Ben Skeggs [Thu, 12 Jun 2008 02:39:35 +0000 (12:39 +1000)]
nv50: use constbuf segment 0 for everything - I can't make the others work..

16 years agonv50: allow relocating a shader's constants at upload time
Ben Skeggs [Thu, 12 Jun 2008 02:26:43 +0000 (12:26 +1000)]
nv50: allow relocating a shader's constants at upload time

16 years agonv50: carry instructions around in nv50_program_exec, not a flat array
Ben Skeggs [Thu, 12 Jun 2008 02:16:43 +0000 (12:16 +1000)]
nv50: carry instructions around in nv50_program_exec, not a flat array

16 years agonv50: get vp working again, fp is broken regardless somehow..
Ben Skeggs [Wed, 11 Jun 2008 05:28:41 +0000 (15:28 +1000)]
nv50: get vp working again, fp is broken regardless somehow..

g8x sucks :)

16 years agonv50: rename nv50_state.h to nv50_program.h
Ben Skeggs [Wed, 11 Jun 2008 04:59:19 +0000 (14:59 +1000)]
nv50: rename nv50_state.h to nv50_program.h

16 years agonv50: move magics take 2
Ben Skeggs [Wed, 11 Jun 2008 03:24:32 +0000 (13:24 +1000)]
nv50: move magics take 2

16 years agoRevert "nv50: move some magics"
Ben Skeggs [Wed, 11 Jun 2008 03:15:23 +0000 (13:15 +1000)]
Revert "nv50: move some magics"

This reverts commit 0a38de30429d3075fc6dfc9ff3729c5ca11f0c2f.

16 years agonv50: move some magics
Ben Skeggs [Wed, 11 Jun 2008 03:00:20 +0000 (13:00 +1000)]
nv50: move some magics

16 years agonv50: various fixes + SCS
Ben Skeggs [Mon, 9 Jun 2008 09:50:17 +0000 (19:50 +1000)]
nv50: various fixes + SCS

16 years agonv50: LRP
Ben Skeggs [Mon, 9 Jun 2008 08:01:03 +0000 (18:01 +1000)]
nv50: LRP

16 years agonv50: quick hack so progs/fp/fp-tri works for the moment
Ben Skeggs [Mon, 9 Jun 2008 07:36:22 +0000 (17:36 +1000)]
nv50: quick hack so progs/fp/fp-tri works for the moment

16 years agonv50: fix SGE/SLT when sources need swapping
Ben Skeggs [Mon, 9 Jun 2008 06:41:08 +0000 (16:41 +1000)]
nv50: fix SGE/SLT when sources need swapping

16 years agonv50: support the other TGSI_UTIL_SIGN modes
Ben Skeggs [Mon, 9 Jun 2008 06:35:07 +0000 (16:35 +1000)]
nv50: support the other TGSI_UTIL_SIGN modes

16 years agonv50: note some things discovered during renouveau session
Ben Skeggs [Mon, 9 Jun 2008 06:26:51 +0000 (16:26 +1000)]
nv50: note some things discovered during renouveau session

16 years agonv50: use emit_flop() instead of building RCP manually on interp
Ben Skeggs [Mon, 9 Jun 2008 03:31:42 +0000 (13:31 +1000)]
nv50: use emit_flop() instead of building RCP manually on interp

16 years agonv50: remove NV50_PROG_{VERTEX,FRAGMENT}
Ben Skeggs [Mon, 9 Jun 2008 03:09:55 +0000 (13:09 +1000)]
nv50: remove NV50_PROG_{VERTEX,FRAGMENT}

16 years agonv50: delayed write of fragprog result regs until end of program
Ben Skeggs [Mon, 9 Jun 2008 03:07:38 +0000 (13:07 +1000)]
nv50: delayed write of fragprog result regs until end of program

16 years agonv50: fix src1 & src2 == const
Ben Skeggs [Sun, 8 Jun 2008 05:51:54 +0000 (15:51 +1000)]
nv50: fix src1 & src2 == const

16 years agonv50: note a critical bug
Ben Skeggs [Sun, 8 Jun 2008 04:12:01 +0000 (14:12 +1000)]
nv50: note a critical bug

16 years agonv50: hehe, damage from tex-surfaces.. surface_fill() reenabled now :)
Ben Skeggs [Sun, 8 Jun 2008 02:27:36 +0000 (12:27 +1000)]
nv50: hehe, damage from tex-surfaces.. surface_fill() reenabled now :)

16 years agonv50: obey writemask in a couple of places
Ben Skeggs [Sun, 8 Jun 2008 01:23:06 +0000 (11:23 +1000)]
nv50: obey writemask in a couple of places

16 years agonv50: LIT - sort-of
Ben Skeggs [Sat, 7 Jun 2008 09:54:04 +0000 (19:54 +1000)]
nv50: LIT - sort-of

*somehow* we have the exact same bug here as on nv4x, the difference being
on nv4x the hw actually has a LIT opcode.. NVIDIA doesn't have the bug on
either arch FWIW.

16 years agonv50: obey per-source abs (TGSI_UTIL_SIGN_CLEAR)
Ben Skeggs [Sat, 7 Jun 2008 07:42:00 +0000 (17:42 +1000)]
nv50: obey per-source abs (TGSI_UTIL_SIGN_CLEAR)

16 years agonv50: create emit_pow() - emit_lit() will need to use it
Ben Skeggs [Sat, 7 Jun 2008 07:36:10 +0000 (17:36 +1000)]
nv50: create emit_pow() - emit_lit() will need to use it

16 years agonv50: oops, copy+pasto
Ben Skeggs [Sat, 7 Jun 2008 06:51:07 +0000 (16:51 +1000)]
nv50: oops, copy+pasto

16 years agonv50: POW!
Ben Skeggs [Sat, 7 Jun 2008 06:08:36 +0000 (16:08 +1000)]
nv50: POW!

16 years agonv50: fixes + untested _SAT modifier
Ben Skeggs [Sat, 7 Jun 2008 06:01:06 +0000 (16:01 +1000)]
nv50: fixes + untested _SAT modifier

16 years agonv50: handle 0/1 SWZ
Ben Skeggs [Sat, 7 Jun 2008 05:21:05 +0000 (15:21 +1000)]
nv50: handle 0/1 SWZ