mesa.git
15 years agomesa: don't normalize spot light direction until validation time
Brian Paul [Fri, 3 Apr 2009 15:55:10 +0000 (09:55 -0600)]
mesa: don't normalize spot light direction until validation time

In glLight() we're only supposed to transform the direction by the modelview
matrix, not normalized it too.

15 years agopython/regress: vertex shader srcmod swz test does not use TEMP[0].
Michal Krol [Fri, 3 Apr 2009 15:55:21 +0000 (17:55 +0200)]
python/regress: vertex shader srcmod swz test does not use TEMP[0].

15 years agotgsi/exec: Actually enable switch-case for FLR.
Michal Krol [Fri, 3 Apr 2009 15:25:29 +0000 (17:25 +0200)]
tgsi/exec: Actually enable switch-case for FLR.

15 years agoi965: remove unused var
Brian Paul [Fri, 3 Apr 2009 15:08:00 +0000 (09:08 -0600)]
i965: remove unused var

15 years agoglx: remove unused local var in determineTextureFormat()
Brian Paul [Fri, 3 Apr 2009 15:06:24 +0000 (09:06 -0600)]
glx: remove unused local var in determineTextureFormat()

15 years agomesa: replace assertion with conditional in _mesa_opcode_string()
Brian Paul [Fri, 3 Apr 2009 15:00:06 +0000 (09:00 -0600)]
mesa: replace assertion with conditional in _mesa_opcode_string()

15 years agoi965: more const buffer debug code
Brian Paul [Fri, 3 Apr 2009 14:59:38 +0000 (08:59 -0600)]
i965: more const buffer debug code

15 years agoi965: added brw_same_reg()
Brian Paul [Thu, 2 Apr 2009 20:33:45 +0000 (14:33 -0600)]
i965: added brw_same_reg()

15 years agoi965: s/GL_FALSE/BRW_COMPRESSION_NONE/
Brian Paul [Thu, 2 Apr 2009 17:45:17 +0000 (11:45 -0600)]
i965: s/GL_FALSE/BRW_COMPRESSION_NONE/

15 years agoi965: another checkpoint commit of new constant buffer support
Brian Paul [Wed, 1 Apr 2009 19:36:48 +0000 (13:36 -0600)]
i965: another checkpoint commit of new constant buffer support

Everything is in place now for using a true constant buffer for GLSL fragment
shaders.  Still some bugs to find though.

15 years agoi965: fix response length param in brw_dp_READ_4()
Brian Paul [Wed, 1 Apr 2009 18:57:06 +0000 (12:57 -0600)]
i965: fix response length param in brw_dp_READ_4()

We were accidentally clobbering the next register.

15 years agoi965: change args to get_src_reg() to prep for new constant buffer support
Brian Paul [Wed, 1 Apr 2009 18:25:34 +0000 (12:25 -0600)]
i965: change args to get_src_reg() to prep for new constant buffer support

15 years agoi965: check-point commit of new constant buffer support
Brian Paul [Tue, 31 Mar 2009 23:06:22 +0000 (17:06 -0600)]
i965: check-point commit of new constant buffer support

Currently, shader constants are stored in the GRF (loaded from the CURBE
prior to shader execution).  This severly limits the number of constants
and temps that we can support.

This new code will support (practically) unlimited size constant buffers
and free up registers in the GRF.  We allocate a new buffer object for the
constants and read them with "Read" messages/instructions.  When only a
small number of constants are used, we can still use the old method.

The code works for fragment shaders only (and is actually disabled) for now.
Need to do the same thing for vertex shaders and need to add the necessary
code-gen to fetch the constants which are referenced by the shader
instructions.

15 years agoi965: remove unused code for sampling a constant buffer
Brian Paul [Tue, 31 Mar 2009 22:57:39 +0000 (16:57 -0600)]
i965: remove unused code for sampling a constant buffer

15 years agoi965: code to setup a constant buffer sampler
Brian Paul [Tue, 31 Mar 2009 22:56:55 +0000 (16:56 -0600)]
i965: code to setup a constant buffer sampler

This code won't actually be used and will be removed in a subsequent commit.
Just committing for posterity.

15 years agoi965: do negation and Abs in get_src_reg_imm()
Brian Paul [Tue, 31 Mar 2009 20:25:32 +0000 (14:25 -0600)]
i965: do negation and Abs in get_src_reg_imm()

Fixes regression seen with progs/glsl/bump.c

15 years agoi965: comments
Brian Paul [Tue, 31 Mar 2009 16:53:56 +0000 (10:53 -0600)]
i965: comments

15 years agoi965: code to debug/dump instruction immediates
Brian Paul [Tue, 31 Mar 2009 16:53:37 +0000 (10:53 -0600)]
i965: code to debug/dump instruction immediates

15 years agoi965: minor code movement, new comment
Brian Paul [Tue, 31 Mar 2009 16:53:02 +0000 (10:53 -0600)]
i965: minor code movement, new comment

15 years agoi965: added new brw_dp_READ_4() function
Brian Paul [Tue, 31 Mar 2009 16:50:55 +0000 (10:50 -0600)]
i965: added new brw_dp_READ_4() function

Used to read float[4] vectors from the constant buffer/surface.

15 years agoi965: new and updated comments
Brian Paul [Tue, 31 Mar 2009 16:49:41 +0000 (10:49 -0600)]
i965: new and updated comments

15 years agomesa: more error message info
Brian Paul [Fri, 27 Mar 2009 20:49:01 +0000 (14:49 -0600)]
mesa: more error message info

15 years agomesa: clean up formatting and use 'return' instead of 'break' consistantly
Brian Paul [Thu, 26 Mar 2009 00:16:35 +0000 (18:16 -0600)]
mesa: clean up formatting and use 'return' instead of 'break' consistantly

15 years agoi965: comments for brw_SAMPLE()
Brian Paul [Wed, 25 Mar 2009 00:05:53 +0000 (18:05 -0600)]
i965: comments for brw_SAMPLE()

15 years agoi965: comments for sampling code
Brian Paul [Wed, 25 Mar 2009 00:05:29 +0000 (18:05 -0600)]
i965: comments for sampling code

15 years agoi965: add support for float literal instruction operands
Brian Paul [Tue, 24 Mar 2009 23:29:40 +0000 (17:29 -0600)]
i965: add support for float literal instruction operands

Call the get_src_reg_imm() function when it's permissible to generate a
literal value src register.

15 years agoi965: remove 'nr' param from get_src/dst_reg() functions
Brian Paul [Tue, 24 Mar 2009 22:33:48 +0000 (16:33 -0600)]
i965: remove 'nr' param from get_src/dst_reg() functions

The value was always 1.

15 years agoi965: fix comment typo
Brian Paul [Tue, 24 Mar 2009 20:48:53 +0000 (14:48 -0600)]
i965: fix comment typo

15 years agoi965: comments, clean-up in prepare_wm_surfaces()
Brian Paul [Tue, 24 Mar 2009 16:35:40 +0000 (10:35 -0600)]
i965: comments, clean-up in prepare_wm_surfaces()

15 years agoi965: remove unneeded #includes
Brian Paul [Tue, 24 Mar 2009 15:54:48 +0000 (09:54 -0600)]
i965: remove unneeded #includes

15 years agoi965: formatting clean-ups
Brian Paul [Tue, 24 Mar 2009 15:44:10 +0000 (09:44 -0600)]
i965: formatting clean-ups

15 years agoi965: comments, whitespace changes
Brian Paul [Tue, 24 Mar 2009 15:42:09 +0000 (09:42 -0600)]
i965: comments, whitespace changes

15 years agoi965: rename scratch_buffer -> scratch_bo to be consistant with other buffers
Brian Paul [Mon, 23 Mar 2009 20:43:51 +0000 (14:43 -0600)]
i965: rename scratch_buffer -> scratch_bo to be consistant with other buffers

15 years agoi965: fix indentation
Brian Paul [Mon, 23 Mar 2009 20:40:51 +0000 (14:40 -0600)]
i965: fix indentation

15 years agoi965: whitespace changes, comments
Brian Paul [Mon, 23 Mar 2009 15:56:33 +0000 (09:56 -0600)]
i965: whitespace changes, comments

15 years agotgsi/text: Allow optional component selection for indirect registers.
Michal Krol [Fri, 3 Apr 2009 15:06:36 +0000 (17:06 +0200)]
tgsi/text: Allow optional component selection for indirect registers.

15 years agopython/regress: vertex shader FRC test does not use IN[1].
Michal Krol [Fri, 3 Apr 2009 14:37:34 +0000 (16:37 +0200)]
python/regress: vertex shader FRC test does not use IN[1].

15 years agopython/regress: Add relative addressing tests.
Michal Krol [Fri, 3 Apr 2009 14:36:20 +0000 (16:36 +0200)]
python/regress: Add relative addressing tests.

15 years agoutil/debug: Initialise local variables.
Michal Krol [Fri, 3 Apr 2009 12:58:39 +0000 (14:58 +0200)]
util/debug: Initialise local variables.

15 years agotgsi/text: Allow `-|src|` variant of `-(|src|)`.
Michal Krol [Fri, 3 Apr 2009 12:54:20 +0000 (14:54 +0200)]
tgsi/text: Allow `-|src|` variant of `-(|src|)`.

15 years agomesa: ensure pbo stencil buffers are mapped before use
Alan Hourihane [Fri, 3 Apr 2009 11:49:05 +0000 (12:49 +0100)]
mesa: ensure pbo stencil buffers are mapped before use

15 years agopython/regress: Add vertex shader source modifier tests.
Michal Krol [Fri, 3 Apr 2009 06:26:53 +0000 (08:26 +0200)]
python/regress: Add vertex shader source modifier tests.

15 years agonv50: fix viewport state update
Christoph Bumiller [Tue, 31 Mar 2009 22:37:36 +0000 (08:37 +1000)]
nv50: fix viewport state update

15 years agomesa: fix TexParameter functions
Roland Scheidegger [Thu, 2 Apr 2009 21:38:34 +0000 (23:38 +0200)]
mesa: fix TexParameter functions

premature return in TexParameterf caused mesa to never call Driver.TexParameter
breaking drivers relying on this (fix bug #20966).
While here, also fix using ctx->ErrorValue when deciding to call
Driver.TexParameter. Errors are sticky and uncleared errors thus would cause
this to no longer get called. Since we thus need return value of
set_tex_parameter[if] can also optimize this to only call when value changed.

15 years agomesa: don't call ctx->Driver.ReadPixels() if width or height is zero
Brian Paul [Thu, 2 Apr 2009 19:05:55 +0000 (13:05 -0600)]
mesa: don't call ctx->Driver.ReadPixels() if width or height is zero

15 years agomesa: don't call ctx->Driver.Draw/CopyPixels() if width or height is zero
Brian Paul [Thu, 2 Apr 2009 19:05:22 +0000 (13:05 -0600)]
mesa: don't call ctx->Driver.Draw/CopyPixels() if width or height is zero

15 years agoglsl: fix segfault in linker when vertex or fragment shader was missing
Brian Paul [Thu, 2 Apr 2009 17:15:53 +0000 (11:15 -0600)]
glsl: fix segfault in linker when vertex or fragment shader was missing

15 years agoprogs: Ignores
Jakob Bornecrantz [Thu, 2 Apr 2009 14:59:29 +0000 (16:59 +0200)]
progs: Ignores

15 years agopython/regress: Do not generate HTML summary for vertex shader test.
Michal Krol [Thu, 2 Apr 2009 10:19:44 +0000 (12:19 +0200)]
python/regress: Do not generate HTML summary for vertex shader test.

15 years agoglx: MakeCurrent fixes.
Thomas Hellstrom [Thu, 2 Apr 2009 09:00:41 +0000 (11:00 +0200)]
glx: MakeCurrent fixes.

1) If MakeContextCurrent is called with (NULL, None, None), Don't
   send the request to the X server if the current context is direct.
2) Return BadMatch in some error cases according to the glx spec.
3) If MakeContextCurrent is called for a context which is current in
   another thread, return BadAccess according to the glx spec.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
15 years agodri glx: Fix dri_util::driBindContext
Thomas Hellstrom [Thu, 2 Apr 2009 08:36:40 +0000 (10:36 +0200)]
dri glx: Fix dri_util::driBindContext

1) Don't error-check here. It's done in glx makeCurrent.
2) Allow ctx and the dri drawables to be NULL for future use. This is
   currently blocked in glx makeCurrent.
3) Avoid updating dri drawables unless they are completely uninitialized.
   Since the updating was done outside of the lock, the driver need to
   verify and redo it anyway.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
15 years agodri glx: Propagate driver MakeCurrent errors.
Thomas Hellstrom [Thu, 2 Apr 2009 08:30:30 +0000 (10:30 +0200)]
dri glx: Propagate driver MakeCurrent errors.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
15 years agopython/regress: Do not create zbuf for vertex shader test.
Michal Krol [Thu, 2 Apr 2009 07:59:04 +0000 (09:59 +0200)]
python/regress: Do not create zbuf for vertex shader test.

15 years agopython/regress: Add more vertex shader test cases.
Michal Krol [Thu, 2 Apr 2009 07:39:40 +0000 (09:39 +0200)]
python/regress: Add more vertex shader test cases.

15 years agoswrast: remove unused integer lerp functions
Brian Paul [Fri, 13 Mar 2009 03:22:45 +0000 (21:22 -0600)]
swrast: remove unused integer lerp functions

15 years agomesa: get rid of gl_texture_object::_BorderChan
Brian Paul [Thu, 12 Mar 2009 01:09:19 +0000 (19:09 -0600)]
mesa: get rid of gl_texture_object::_BorderChan

15 years agodri: use BorderColor instead of _BorderChan
Brian Paul [Thu, 12 Mar 2009 01:03:30 +0000 (19:03 -0600)]
dri: use BorderColor instead of _BorderChan

15 years agoswrast: remove old texture_apply() code; always use texture combine code
Brian Paul [Wed, 11 Mar 2009 02:14:32 +0000 (20:14 -0600)]
swrast: remove old texture_apply() code; always use texture combine code

15 years agoswrast: fix bad optimization check
Brian Paul [Wed, 11 Mar 2009 01:29:45 +0000 (19:29 -0600)]
swrast: fix bad optimization check

15 years agoswrast: remove unused parameter
Brian Paul [Tue, 10 Mar 2009 03:24:48 +0000 (21:24 -0600)]
swrast: remove unused parameter

15 years agoswrast: minor improvements, clean-ups in texcombine code
Brian Paul [Tue, 10 Mar 2009 03:20:25 +0000 (21:20 -0600)]
swrast: minor improvements, clean-ups in texcombine code

15 years agomesa: simplify ycbcr->rgb conversion code
Brian Paul [Tue, 10 Mar 2009 02:51:21 +0000 (20:51 -0600)]
mesa: simplify ycbcr->rgb conversion code

15 years agomesa: convert more texture fetch functions to return GLfloat
Brian Paul [Tue, 10 Mar 2009 02:34:24 +0000 (20:34 -0600)]
mesa: convert more texture fetch functions to return GLfloat

15 years agomesa: switch texel fetch functions from GLchan to GLfloat
Brian Paul [Mon, 9 Mar 2009 02:53:41 +0000 (20:53 -0600)]
mesa: switch texel fetch functions from GLchan to GLfloat

15 years agoswrast: use float4_array typedef to simplify the code a bit
Brian Paul [Mon, 9 Mar 2009 01:08:43 +0000 (19:08 -0600)]
swrast: use float4_array typedef to simplify the code a bit

15 years agomesa: texture combine clean-ups
Brian Paul [Sun, 8 Mar 2009 23:58:54 +0000 (17:58 -0600)]
mesa: texture combine clean-ups

Use MAX_COMBINER_TERMS instead of 4.
Rename some vars.
Update comments.

15 years agoswrast: refactor depth/shadow sampling code
Brian Paul [Sun, 8 Mar 2009 20:39:09 +0000 (14:39 -0600)]
swrast: refactor depth/shadow sampling code

15 years agoswrast: general clean-up of texture combine code
Brian Paul [Sun, 8 Mar 2009 20:38:37 +0000 (14:38 -0600)]
swrast: general clean-up of texture combine code

15 years agoswrast: do texture sampling/combining in floating point
Brian Paul [Sun, 8 Mar 2009 19:49:57 +0000 (13:49 -0600)]
swrast: do texture sampling/combining in floating point

The code's cleaner and a step toward supporting float-valued texture sampling.
Some optimizations for common cases can be added and re-enabled...

15 years agodemos: added progs/glsl/linktest.c to test linking of separate compilation units
Brian Paul [Thu, 2 Apr 2009 01:53:40 +0000 (19:53 -0600)]
demos: added progs/glsl/linktest.c to test linking of separate compilation units

15 years agoglsl: implement compiling/linking of separate compilation units
Brian Paul [Thu, 2 Apr 2009 01:50:28 +0000 (19:50 -0600)]
glsl: implement compiling/linking of separate compilation units

A shader program may consist of multiple shaders (source code units).
If we find there are unresolved functions after compiling the unit that
defines main(), we'll concatenate all the respective vertex or fragment
shaders then recompile.

This isn't foolproof but should work in most cases.

15 years agomesa: use correct tex unit lod bias for TXB instruction
Brian Paul [Thu, 2 Apr 2009 00:50:07 +0000 (18:50 -0600)]
mesa: use correct tex unit lod bias for TXB instruction

15 years agoswrast: fix glDrawBuffer(GL_FRONT_AND_BACK)
Brian Paul [Thu, 2 Apr 2009 00:44:15 +0000 (18:44 -0600)]
swrast: fix glDrawBuffer(GL_FRONT_AND_BACK)

We weren't putting the right colors into the back buffer in this mode.

15 years agomesa: fix a recursive display list problem
Brian Paul [Wed, 1 Apr 2009 23:34:16 +0000 (17:34 -0600)]
mesa: fix a recursive display list problem

This fixes an issue when compiling glCallList() into another display list
when the mode is GL_COMPILE_AND_EXECUTE.

Before, the call to glCallList() called _mesa_save_CallList() which called
neutral_CallList() which then called _mesa_save_CallList() again.  In the
end, the parent display list contained two calls to the child display list
instead of one.

Let's be on the lookout for regressions caused by this change for a while
before we cherry-pick this elsewhere.

15 years agor300-gallium: Translate vertex shader magic numbers.
Corbin Simpson [Wed, 1 Apr 2009 22:52:32 +0000 (15:52 -0700)]
r300-gallium: Translate vertex shader magic numbers.

15 years agor300-gallium: Fix compiler warnings.
Corbin Simpson [Wed, 1 Apr 2009 22:24:28 +0000 (15:24 -0700)]
r300-gallium: Fix compiler warnings.

"const" is the right keyword, but I can't do that without adding a bunch
of really annoying and ugly const casts everywhere, and frankly,
that's really stupid, so instead, just don't make them const.

15 years agor300-gallium: Add vertex shader for surface_copy.
Corbin Simpson [Wed, 1 Apr 2009 22:14:19 +0000 (15:14 -0700)]
r300-gallium: Add vertex shader for surface_copy.

15 years agoutil: Fix x86_64 build.
José Fonseca [Wed, 1 Apr 2009 21:05:07 +0000 (22:05 +0100)]
util: Fix x86_64 build.

15 years agoutil: Lookup symbol names from addresses.
José Fonseca [Wed, 1 Apr 2009 20:00:59 +0000 (21:00 +0100)]
util: Lookup symbol names from addresses.

Nice for stack backtraces.

Windows-only for now.

15 years agotgsi: Fix structure members initialisation.
Michal Krol [Wed, 1 Apr 2009 20:06:53 +0000 (22:06 +0200)]
tgsi: Fix structure members initialisation.

15 years agopython/regress: Add vertex shader LRP test.
Michal Krol [Wed, 1 Apr 2009 14:05:29 +0000 (16:05 +0200)]
python/regress: Add vertex shader LRP test.

15 years agopython/regress: Add vertex shader FRC test.
Michal Krol [Wed, 1 Apr 2009 13:41:36 +0000 (15:41 +0200)]
python/regress: Add vertex shader FRC test.

15 years agoglsl: fix texgen state variable tokens in emit_statevars()
Brian Paul [Wed, 1 Apr 2009 13:35:07 +0000 (07:35 -0600)]
glsl: fix texgen state variable tokens in emit_statevars()

This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays.
See bug 20986.

15 years agomesa: minor tweaks in append_token() for printing state var strings
Brian Paul [Wed, 1 Apr 2009 13:33:50 +0000 (07:33 -0600)]
mesa: minor tweaks in append_token() for printing state var strings

15 years agotgsi: Lookup alternate instruction mnemonics when parsing tgsi text.
Michal Krol [Wed, 1 Apr 2009 09:49:55 +0000 (11:49 +0200)]
tgsi: Lookup alternate instruction mnemonics when parsing tgsi text.

15 years agotgsi: Provide alternate instruction mnemonics in tgsi info.
Michal Krol [Wed, 1 Apr 2009 09:45:25 +0000 (11:45 +0200)]
tgsi: Provide alternate instruction mnemonics in tgsi info.

15 years agotgsi/doc: Fix typo.
Michal Krol [Wed, 1 Apr 2009 09:25:58 +0000 (11:25 +0200)]
tgsi/doc: Fix typo.

15 years agopython/regress: Add vertex shader EX2 test.
Michal Krol [Wed, 1 Apr 2009 09:25:02 +0000 (11:25 +0200)]
python/regress: Add vertex shader EX2 test.

15 years agopython/regress: Add vertex shader DST test.
Michal Krol [Wed, 1 Apr 2009 09:09:37 +0000 (11:09 +0200)]
python/regress: Add vertex shader DST test.

15 years agopython/regress: Fix vertex shader XPD test.
Michal Krol [Wed, 1 Apr 2009 09:08:41 +0000 (11:08 +0200)]
python/regress: Fix vertex shader XPD test.

15 years agopython/regress: Indent.
Michal Krol [Wed, 1 Apr 2009 08:58:46 +0000 (10:58 +0200)]
python/regress: Indent.

15 years agopython/regress: Add vertex shader test for XPD.
Michal Krol [Wed, 1 Apr 2009 08:56:53 +0000 (10:56 +0200)]
python/regress: Add vertex shader test for XPD.

15 years agopython/regress: Rename test files from *.txt to *.sh -- won't be .gitignored.
Michal Krol [Wed, 1 Apr 2009 08:23:09 +0000 (10:23 +0200)]
python/regress: Rename test files from *.txt to *.sh -- won't be .gitignored.

15 years agopython/regress: Add more vertex shader tests.
Michal Krol [Wed, 1 Apr 2009 08:18:50 +0000 (10:18 +0200)]
python/regress: Add more vertex shader tests.

15 years agor300-gallium: Backwards test.
Corbin Simpson [Wed, 1 Apr 2009 03:24:50 +0000 (20:24 -0700)]
r300-gallium: Backwards test.

Wow, how long's that been there? Embarrassing.

15 years agor300-gallium: Moar vert shader emit.
Corbin Simpson [Wed, 1 Apr 2009 03:04:56 +0000 (20:04 -0700)]
r300-gallium: Moar vert shader emit.

15 years agor300-gallium: Add vertex shader emit.
Corbin Simpson [Wed, 1 Apr 2009 01:58:03 +0000 (18:58 -0700)]
r300-gallium: Add vertex shader emit.

15 years agor300-gallium: Stubs for vertex shaders.
Corbin Simpson [Tue, 31 Mar 2009 06:54:53 +0000 (23:54 -0700)]
r300-gallium: Stubs for vertex shaders.

15 years agotgsi: added some helpful debug functions in the tgsi interpreter
Brian Paul [Tue, 31 Mar 2009 22:17:23 +0000 (16:17 -0600)]
tgsi: added some helpful debug functions in the tgsi interpreter

Check for NaN/Inf, print exec vectors, print temp registers.

15 years agomesa: fix bug in GPU codegen for fixed-function two-sided lighting
Brian Paul [Tue, 31 Mar 2009 22:13:14 +0000 (16:13 -0600)]
mesa: fix bug in GPU codegen for fixed-function two-sided lighting

The 'dots' register wasn't getting properly un-negated and un-swizzled
after emitting the code for back-face lighting.  So, if more than one
light source was enabled, the specular exponent for the next light source
was wrong.

During execution we were evaluating pow(x, y) where y was negative instead
of positive.  This led to the outcome being zero or NaN.

This fixes the occasional black triangles seen in isosurf when hacked to
enable two-sided lighting.