mesa.git
14 years agoglsl2: Don't generate constructor functions for structures
Ian Romanick [Wed, 1 Sep 2010 21:08:08 +0000 (14:08 -0700)]
glsl2: Don't generate constructor functions for structures

14 years agoglsl2: Emit structure constructors inline
Ian Romanick [Wed, 1 Sep 2010 20:46:04 +0000 (13:46 -0700)]
glsl2: Emit structure constructors inline

Fixes piglit test cases glsl-[fv]s-all-0[12].

14 years agor600g: add missing vertex fetch formats to the translation table.
Dave Airlie [Thu, 2 Sep 2010 03:32:25 +0000 (13:32 +1000)]
r600g: add missing vertex fetch formats to the translation table.

fixes at least 2 more piglits.

14 years agor600g: fix binding of same texture to several target slot
Jerome Glisse [Thu, 2 Sep 2010 01:57:43 +0000 (21:57 -0400)]
r600g: fix binding of same texture to several target slot

One can bind same texture or sampler to different slot,
each slot needs it own state. The solution implemented
here is not exactly beautifull or optimal need to think
to somethings better.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agoglsl: Fix write mask in matrix-from-matrix constructors.
Kenneth Graunke [Wed, 1 Sep 2010 23:10:01 +0000 (16:10 -0700)]
glsl: Fix write mask in matrix-from-matrix constructors.

If the matrix being constructed was larger than the source matrix, it
would overwrite the lower-right part of the matrix with the wrong
values, rather than leaving it as the identity matrix.

For example, constructing a mat4 from a mat2 should only use a writemask
of "xy" when copying from the source, but was using "xyzw".

Fixes the code generated by piglit test constructor-23.vert.

14 years agoglsl: Add proper handling for constant matrix-from-matrix constructors.
Kenneth Graunke [Wed, 1 Sep 2010 22:37:13 +0000 (15:37 -0700)]
glsl: Add proper handling for constant matrix-from-matrix constructors.

Fixes piglit test case constructor-21.vert and changes
constructor-22.vert to give the correct output.

14 years agoglsl: Move generate_constructor_(matrix|vector) to ir_constant ctor.
Kenneth Graunke [Wed, 1 Sep 2010 22:31:06 +0000 (15:31 -0700)]
glsl: Move generate_constructor_(matrix|vector) to ir_constant ctor.

14 years agoast_function: Fix check for "too few components".
Kenneth Graunke [Wed, 1 Sep 2010 22:04:57 +0000 (15:04 -0700)]
ast_function: Fix check for "too few components".

This was triggering even for matrix-from-matrix constructors.  It is
perfectly legal to construct a mat3 from a mat2 - the rest will be
filled in by the identity matrix.

Changes piglit test constructor-23.vert from FAIL to PASS, but the
generated code is incorrect.

14 years agoast_function: Remove bogus cases from generate_constructor_matrix.
Kenneth Graunke [Wed, 1 Sep 2010 21:49:53 +0000 (14:49 -0700)]
ast_function: Remove bogus cases from generate_constructor_matrix.

There are no integer matrix types, so switching on them is silly.

14 years agor600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view
Dave Airlie [Thu, 2 Sep 2010 01:16:31 +0000 (11:16 +1000)]
r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view

fixes problems in valgrind with uninitialised values.

14 years agoir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.
Eric Anholt [Wed, 1 Sep 2010 23:06:32 +0000 (16:06 -0700)]
ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.

Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

Regresses glsl-vs-array-04 on 965.  Thanks to a slight change in
register allocation, this test of undefined behavior now wraps around
the register space and unexpectedly reads the constant value it's
trying to compare to.  The test should probably not look at the
resulting color, since behavior is undefined.

14 years agoir_to_mesa: Add a little helper for emitting link failure messages.
Eric Anholt [Wed, 1 Sep 2010 21:56:43 +0000 (14:56 -0700)]
ir_to_mesa: Add a little helper for emitting link failure messages.

14 years agomesa: Fix many printf-like warnings.
Eric Anholt [Wed, 1 Sep 2010 21:46:22 +0000 (14:46 -0700)]
mesa: Fix many printf-like warnings.

Most of these are just typecasting to long to match the arg type.  I
don't really care too much about getting a GLsizei or whatever
appropriate type in.  However, there were a number of real bugs, like
missing arguments or passing floats to integer format specifiers.  My
favorite: printflike("%s, argument") is missing an argument.

14 years agomesa: Add __printf__ attribute to printf-like functions to get warnings.
Eric Anholt [Wed, 1 Sep 2010 21:39:50 +0000 (14:39 -0700)]
mesa: Add __printf__ attribute to printf-like functions to get warnings.

14 years agomesa/st: remove check for buffer/elements = 0
Dave Airlie [Wed, 1 Sep 2010 23:45:37 +0000 (09:45 +1000)]
mesa/st: remove check for buffer/elements = 0

shown by the glsl-vs-point-size failing on r600g.

the test passes on softpipe and I get a full piglit test run completing on r600g.

14 years agor600g: silence compiler warning
Jerome Glisse [Wed, 1 Sep 2010 22:09:37 +0000 (18:09 -0400)]
r600g: silence compiler warning

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agor600g: refix db/cb state
Jerome Glisse [Wed, 1 Sep 2010 22:04:38 +0000 (18:04 -0400)]
r600g: refix db/cb state

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agomesa: fix out of bounds memory read in mipmap gen code
Brian Paul [Wed, 1 Sep 2010 19:21:51 +0000 (13:21 -0600)]
mesa: fix out of bounds memory read in mipmap gen code

Out of bounds reads could happen for reducing WxH to WxH/2
or WxH to W/2xH.

Fixes fd.o bug 29918.

14 years agomesa: more prog_execute.c debug code
Brian Paul [Wed, 1 Sep 2010 18:46:57 +0000 (12:46 -0600)]
mesa: more prog_execute.c debug code

14 years agoglsl: Add forgotten implementations of equal/notEqual on bvecs.
Kenneth Graunke [Wed, 1 Sep 2010 18:47:52 +0000 (11:47 -0700)]
glsl: Add forgotten implementations of equal/notEqual on bvecs.

14 years agor600g: fix up default state differences between r6xx and r7xx
Alex Deucher [Wed, 1 Sep 2010 17:57:52 +0000 (13:57 -0400)]
r600g: fix up default state differences between r6xx and r7xx

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
14 years agost/glx: re-order destruction of buffers, visuals
Brian Paul [Wed, 1 Sep 2010 18:39:04 +0000 (12:39 -0600)]
st/glx: re-order destruction of buffers, visuals

Free the buffers before the visuals.  Fixes valgrind warning
reported in fd.o bug 29919.

14 years agoi965: DP2 produces a scalar result like DP3, DP4, etc.
Eric Anholt [Wed, 1 Sep 2010 17:41:36 +0000 (10:41 -0700)]
i965: DP2 produces a scalar result like DP3, DP4, etc.

Fixes glsl-fs-dot-vec2-2.

14 years agoglsl2: Perform algebraic simplifications on logical binary operators
Ian Romanick [Wed, 1 Sep 2010 17:13:21 +0000 (10:13 -0700)]
glsl2: Perform algebraic simplifications on logical binary operators

Reduces glsl-vs-all-01 from 42 Mesa IR instructions (including the
END) to 17.

14 years agoglsl2: Allow ir_constant::zero to create boolean constants
Ian Romanick [Wed, 1 Sep 2010 17:12:55 +0000 (10:12 -0700)]
glsl2: Allow ir_constant::zero to create boolean constants

14 years agor600g: avoid dynamic allocation of states
Jerome Glisse [Mon, 30 Aug 2010 21:56:59 +0000 (17:56 -0400)]
r600g: avoid dynamic allocation of states

Make state statically allocated, this kills a bunch of code
and avoid intensive use of malloc/free. There is still a lot
of useless duplicate function wrapping that can be kill. This
doesn't improve yet performance, needs to avoid memcpy states
in radeon_ctx_set_draw and to avoid rebuilding vs_resources,
dsa, scissor, cb_cntl, ... states at each draw command.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agoRevert "Revert "r600g: precompute some of the hw state""
Jerome Glisse [Wed, 1 Sep 2010 17:04:42 +0000 (13:04 -0400)]
Revert "Revert "r600g: precompute some of the hw state""

This reverts commit 1fa7245c348cb7aced81f1672140f64cb6450e2f.

Conflicts:

src/gallium/drivers/r600/r600_state.c

14 years agonouveau/nvfx: Remove enforcement of bit depth being same as front buffer
Patrice Mandin [Wed, 1 Sep 2010 16:12:11 +0000 (18:12 +0200)]
nouveau/nvfx: Remove enforcement of bit depth being same as front buffer

Signed-off-by: Patrice Mandin <patmandin@gmail.com>
14 years agomesa: initialize dummy framebuffer and renderbuffer mutexes
Vladimir Vukicevic [Wed, 1 Sep 2010 14:54:21 +0000 (08:54 -0600)]
mesa: initialize dummy framebuffer and renderbuffer mutexes

See fd.o bug 29909.

Signed-off-by: Brian Paul <brianp@vmware.com>
14 years agoCygwin: Adjust mklib so -linker and -cplusplus options are processed more like they...
Jon TURNEY [Fri, 27 Aug 2010 21:52:41 +0000 (22:52 +0100)]
Cygwin: Adjust mklib so -linker and -cplusplus options are processed more like they are for linux

It looks like we were ignoring -linker when -noprefix wasn't present, and
when -noprefix was present, -linker was mandatory and -cplusplus ignored.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
14 years agoCygwin: Teach mklib/minstall to properly install libraries on cygwin
Jon TURNEY [Sat, 24 Jul 2010 11:05:34 +0000 (12:05 +0100)]
Cygwin: Teach mklib/minstall to properly install libraries on cygwin

Teach mklib/minstall more about cygwin so libraries are properly installed

Have mklib install the .dll into the lib/ staging directory as well

Have minstall install the .dll into PREFIX/bin at the same time as
installing the .dll.a link library into PREFIX/lib

mklib uses a '-' rather than a '.' as the separator before the version
number in library names on cygwin.  Change the install globs so they match
library names like that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
14 years agoCygwin: Change mklib not to report the full archname on cygwin
Jon TURNEY [Sat, 24 Jul 2010 11:06:23 +0000 (12:06 +0100)]
Cygwin: Change mklib not to report the full archname on cygwin

Change mklib not to report the full archname when building a library for cygwin
(which is something like 'CYGWIN_NT-5.1' or 'CYGWIN_NT-6.1-WOW64' and kind of
confusing), but just 'CYGWIN'.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
14 years agoCygwin: Have mklib exit with error code if link fails
Jon TURNEY [Fri, 19 Feb 2010 22:38:57 +0000 (22:38 +0000)]
Cygwin: Have mklib exit with error code if link fails

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
14 years agoglsl2: Disallow function declarations within function definitions in GLSL 1.20
Ian Romanick [Wed, 1 Sep 2010 13:34:58 +0000 (06:34 -0700)]
glsl2: Disallow function declarations within function definitions in GLSL 1.20

The GLSL 1.20 spec specifically disallows this, but it was allowed in
GLSL 1.10.

Fixes piglit test cases local-function-0[13].frag and bugzilla #29921.

14 years agor600: cube mipmap levels are aligned to 8 faces only starting from r7xx
Andre Maasikas [Wed, 1 Sep 2010 06:19:51 +0000 (09:19 +0300)]
r600: cube mipmap levels are aligned to 8 faces only starting from r7xx

14 years agor600g: correct cb/zb offset emits.
Dave Airlie [Wed, 1 Sep 2010 04:28:55 +0000 (14:28 +1000)]
r600g: correct cb/zb offset emits.

This fixes fbo-3d and fbo-cubemap

14 years agoRevert "r600g: precompute some of the hw state"
Dave Airlie [Wed, 1 Sep 2010 04:56:04 +0000 (14:56 +1000)]
Revert "r600g: precompute some of the hw state"

This reverts commit de0b76cab22caa9fc7260f80acb8f151ccced6c5, its pre-computes the texture state wrong,

you can't just use an array of levels, since you can have FBOs to depth texture slices inside a level as well
it would get really messy quickly. Probably need to split commits like this up into pieces for each piece
of state, so we can revert bits easier in case of regressions.

This also break 5 piglit tests, and valgrind starts to warn about invalid read/writes after this.

14 years agor600g: fix typo causing segfault.
Dave Airlie [Wed, 1 Sep 2010 03:54:38 +0000 (13:54 +1000)]
r600g: fix typo causing segfault.

fixes warning that
r600_blit.c: In function ‘r600_resource_copy_region’:
r600_blit.c:136: warning: passing argument 1 of ‘util_resource_copy_region’ from incompatible pointer type

and also 7 more piglit tests.

14 years agor600g: fix glean texCube and shadows.
Dave Airlie [Wed, 1 Sep 2010 01:37:39 +0000 (11:37 +1000)]
r600g: fix glean texCube and shadows.

add cube and shadow support to the texture code.

14 years agogallivm: fix bug in nested conditionals
Brian Paul [Wed, 1 Sep 2010 01:14:18 +0000 (19:14 -0600)]
gallivm: fix bug in nested conditionals

This, plus the previous commit fix fd.o bug 29806.

14 years agoglsl2: fix bug in atan(y, x) function
Brian Paul [Wed, 1 Sep 2010 01:13:09 +0000 (19:13 -0600)]
glsl2: fix bug in atan(y, x) function

When x==0, the result was wrong.  Fixes piglit glsl-fs-atan-1.shader_test

14 years agoir_to_mesa: When emitting a pixel kill, flag that we did so.
Eric Anholt [Tue, 31 Aug 2010 20:02:59 +0000 (13:02 -0700)]
ir_to_mesa: When emitting a pixel kill, flag that we did so.

Both i965 and swrast rely on UsesKill to determine whether to do early
depth writes.  Fixes glsl-fs-discard-02.

Bug #29835.

14 years agollvmpipe: slightly simplify build_mask
Keith Whitwell [Tue, 24 Aug 2010 22:05:57 +0000 (23:05 +0100)]
llvmpipe: slightly simplify build_mask

14 years agollvmpipe: combine linear mask calculation
Keith Whitwell [Sun, 22 Aug 2010 21:56:54 +0000 (22:56 +0100)]
llvmpipe: combine linear mask calculation

14 years agollvmpipe: intrinsics versions of build_mask functions
Keith Whitwell [Sun, 15 Aug 2010 17:19:52 +0000 (18:19 +0100)]
llvmpipe: intrinsics versions of build_mask functions

14 years agoglsl2: Write vector constructor constants in a single assignment
Ian Romanick [Tue, 31 Aug 2010 21:44:13 +0000 (14:44 -0700)]
glsl2: Write vector constructor constants in a single assignment

Make two passes over the constructor parameters.  Write all of the
constants in a single write, then write the non-constants one at a
time.  This causes the fragment shader

varying float g;
void main()
{
gl_FragColor = vec4(0.0, g, 0.0, 1.0);
}

to generate

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (xzw) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

instead of

(function main
  (signature void (parameters )
    (
      (declare (temporary ) vec4 vec_ctor@0x8580058)
      (assign (constant bool (1)) (x) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058)  (swiz xxxx (var_ref g@0x8580218) ))
      (assign (constant bool (1)) (z) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (w) (var_ref vec_ctor@0x8580058)  (constant vec4 (0.000000 0.000000 0.000000 1.000000)) )
      (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0)  (var_ref vec_ctor@0x8580058) )
    ))
)

A similar optimization could be done for matrix constructors, but it
is a little more complicate there.

14 years agoir_to_mesa: Sort the uniform list we're adding to Parameters[] order.
Eric Anholt [Tue, 31 Aug 2010 18:16:09 +0000 (11:16 -0700)]
ir_to_mesa: Sort the uniform list we're adding to Parameters[] order.

Fixes glsl-uniform-linking-1 and failure to link a shader in Unigine.
An alternative here would be to just ditch using _mesa_add_parameter
and build the initial params list on our own, but that would require
two walks of the list as well.

Bug #29822

14 years agoir_to_mesa: Fix struct/class confusion
nobled [Sun, 22 Aug 2010 05:16:53 +0000 (05:16 +0000)]
ir_to_mesa: Fix struct/class confusion

14 years agoir_to_mesa: Set up our instruction nodes with zeroed data.
Eric Anholt [Mon, 30 Aug 2010 21:42:27 +0000 (14:42 -0700)]
ir_to_mesa: Set up our instruction nodes with zeroed data.

cond_update wasn't being set by emit_op3, leading to valgrind
complaints, and failures in several piglit tests when built with
clang.

14 years agoast_to_hir: Add support for bit-wise operators (but not shifts).
Kenneth Graunke [Tue, 31 Aug 2010 17:56:24 +0000 (10:56 -0700)]
ast_to_hir: Add support for bit-wise operators (but not shifts).

Previously, using bit-wise operators in some larger expression would
crash on a NULL pointer dereference.  This code at least doesn't crash.

Fixes piglit test bitwise-01.frag.

14 years agost/egl: Enable EGL_MESA_drm_display.
Chia-I Wu [Tue, 31 Aug 2010 07:52:26 +0000 (15:52 +0800)]
st/egl: Enable EGL_MESA_drm_display.

14 years agoegl: Mark EGL_MESA_screen_surface as obsolete.
Chia-I Wu [Tue, 31 Aug 2010 07:25:09 +0000 (15:25 +0800)]
egl: Mark EGL_MESA_screen_surface as obsolete.

EGL_MESA_drm_{display,image} can achieve the same functionality.

14 years agor600g: fix up depth write swizzles.
Dave Airlie [Tue, 31 Aug 2010 06:13:03 +0000 (16:13 +1000)]
r600g: fix up depth write swizzles.

For some reason r600c, emits extra instructions in the FP to do the depth write output swizzle,
I'm not sure this is required, so here I'm doing it in the exports.

this fixes the mesa trivial demos tri-depthwrite and tri-depthwrite2, it doesn't fix
the glsl1 gl_FragDepth writing test however.

14 years agor600g: fix fp-fragment-position test.
Dave Airlie [Tue, 31 Aug 2010 05:12:24 +0000 (15:12 +1000)]
r600g: fix fp-fragment-position test.

14 years agor600g: fix typo in last commit
Dave Airlie [Tue, 31 Aug 2010 04:57:57 +0000 (14:57 +1000)]
r600g: fix typo in last commit

14 years agor600g: fix position input to fragment shader.
Dave Airlie [Tue, 31 Aug 2010 04:52:52 +0000 (14:52 +1000)]
r600g: fix position input to fragment shader.

this fixes a few if the fs shader tests, 10 more piglits

14 years agor600g: remove unneeded function call from scs
Dave Airlie [Tue, 31 Aug 2010 03:54:19 +0000 (13:54 +1000)]
r600g: remove unneeded function call from scs

14 years agoir_to_mesa: use RSQ+MUL instead of RSQ+RCP for SQRT
Marek Olšák [Tue, 31 Aug 2010 03:38:50 +0000 (05:38 +0200)]
ir_to_mesa: use RSQ+MUL instead of RSQ+RCP for SQRT

sqrt(x) = 1/rsq(x) = x*rsq(x)

This optimization already was in the old GLSL compiler.

Acked on irc by Eric Anholt.

14 years agolinker: Require an exact matching signature when looking for prototypes.
Kenneth Graunke [Tue, 31 Aug 2010 03:42:19 +0000 (20:42 -0700)]
linker: Require an exact matching signature when looking for prototypes.

Fixes piglit test glsl-override-builtin.  The linker incorrectly found
the prototype for the float signature, rather than adding a new
prototype with the int return type.  This caused ir_calls with type int
to have their callees set to the float signature, triggering an assert.

14 years agor600g: make LIT work properly
Dave Airlie [Tue, 31 Aug 2010 01:57:04 +0000 (11:57 +1000)]
r600g: make LIT work properly

this is a bit of a workaround, something is wrong with the literal emits here
so we just use the trig copy function to copy the immd to a temp at start of op.

fix VP/FP LIT tests

14 years agoi965: fix depth test on sandybridge
Zhenyu Wang [Tue, 31 Aug 2010 01:54:44 +0000 (09:54 +0800)]
i965: fix depth test on sandybridge

This includes several corrections for fixing depth test on sandybridge.
Fix wrong bits definition in depth stencil state. Fix wrong order of
state buffer offset in 3DSTATE_CC_STATE_POINTERS command. Correctly use
buffer width parameter in depth buffer setting.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
14 years agor600g: fixup trig functions when input is a literal
Dave Airlie [Tue, 31 Aug 2010 01:42:01 +0000 (11:42 +1000)]
r600g: fixup trig functions when input is a literal

So as the trig functions used up the literal spots for the PI work, if the arg0 was an immediate
we'd hit failure, so copy the literal before starting.

add some tracking of max temp used to avoid trashing temp regs.

5 more piglits, fp1 COS,SCS,SIN tests

14 years agor600g: make sure LIT splits constants
Dave Airlie [Tue, 31 Aug 2010 00:43:54 +0000 (10:43 +1000)]
r600g: make sure LIT splits constants

14 years agor600g: fix constant splitting
Dave Airlie [Tue, 31 Aug 2010 00:43:04 +0000 (10:43 +1000)]
r600g: fix constant splitting

constant splitting was broken for multi-constant cases, fixes fp1 CMP+MAD, vp1 CMP.

14 years agor600g: fix LIT tests
Dave Airlie [Mon, 30 Aug 2010 23:56:35 +0000 (09:56 +1000)]
r600g: fix LIT tests

14 years agor600g: add missing literals
Dave Airlie [Mon, 30 Aug 2010 23:02:02 +0000 (09:02 +1000)]
r600g: add missing literals

Also add an error if we hit this problem again, we need to do this better
possibly tying the literal addition to the last flag.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agolinker: Handle varying arrays, matrices, and arrays of matrices
Ian Romanick [Mon, 30 Aug 2010 22:37:44 +0000 (15:37 -0700)]
linker: Handle varying arrays, matrices, and arrays of matrices

Fixes piglit test case glsl-array-varying-01.

14 years agoDon't pass -ffast-math to clang, since it ignores it and complains.
Eric Anholt [Mon, 30 Aug 2010 21:19:23 +0000 (14:19 -0700)]
Don't pass -ffast-math to clang, since it ignores it and complains.

14 years agoMake configure work with clang
nobled [Mon, 30 Aug 2010 00:03:37 +0000 (20:03 -0400)]
Make configure work with clang

It was mistaking clang for gcc and deciding its version
was too low.

14 years agoAdd talloc to osmesa library dependencies
Jon TURNEY [Mon, 30 Aug 2010 11:41:16 +0000 (12:41 +0100)]
Add talloc to osmesa library dependencies

also link osmesa with C++ standard libraries, as it now contains C++ code

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
14 years agoAdd talloc to dependencies for libGL built with xlib driver
Jon TURNEY [Mon, 30 Aug 2010 11:41:15 +0000 (12:41 +0100)]
Add talloc to dependencies for libGL built with xlib driver

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
14 years agoglsl: Clear the static values of builtin function profiles at release.
Eric Anholt [Mon, 30 Aug 2010 19:20:25 +0000 (12:20 -0700)]
glsl: Clear the static values of builtin function profiles at release.

When releasing the builtin functions, we were just freeing the memory,
not telling the builtin function loader that we had freed its memory.
I wish I had done ARB_ES2_compatibility so we had regression testing
of this path.  Fixes segfault on changing video options in nexuiz.

14 years agoglsl2: Commit generated files changed by previous commit
Ian Romanick [Mon, 30 Aug 2010 18:59:48 +0000 (11:59 -0700)]
glsl2: Commit generated files changed by previous commit

14 years agoglsl2: Parse #pragma lines
Ian Romanick [Mon, 30 Aug 2010 18:58:04 +0000 (11:58 -0700)]
glsl2: Parse #pragma lines

All pragmas are currently ignored.  Also, the error messages when a
pragma is used incorrectly (i.e., '#pragma debug(on)' inside a
function) are crap, but I think this is sufficient for now.

Fixes piglit test cases pragma-0[1-8].(vert|frag).

14 years agoFix inverted version checks in check_extra.
Kenneth Graunke [Mon, 30 Aug 2010 19:22:39 +0000 (12:22 -0700)]
Fix inverted version checks in check_extra.

Previously, if an attribute was enabled by either a specific GL version
or an extension, the check would require -both- to be enabled.  This bug
was not discovered earlier because version checks are currently only ever
used on their own.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
14 years agor600g: precompute some of the hw state
Jerome Glisse [Mon, 30 Aug 2010 01:01:51 +0000 (21:01 -0400)]
r600g: precompute some of the hw state

Idea is to build hw state at pipe state creation and
reuse them while keeping a non PM4 packet interface
btw winsys & pipe driver. This commit also force rebuild
of pm4 packet on each call to radeon_state_pm4 which
in turn slow down everythings, this will be addressed.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agor600g: fix depth buffer decompression after states rework
Jerome Glisse [Sat, 28 Aug 2010 21:47:13 +0000 (17:47 -0400)]
r600g: fix depth buffer decompression after states rework

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
14 years agor600g: fixup states generation in winsys.
Dave Airlie [Thu, 26 Aug 2010 04:55:48 +0000 (14:55 +1000)]
r600g: fixup states generation in winsys.

The current states code had an unhealthy relationship between
that had to somehow magically align themselves, editing either
place meant renumbering all states after the one you were on,
and it was pretty unapproachable code.

This replaces the huge types structures with a simple type + sub
type struct, which is keyed on an stype enum in radeon.h. Each
stype can have a per-shader type subclassing (4 types supported,
PS/VS/GS/FS), and also has a number of states per-subtype. So you
have 256 constants per 4 shaders per one CONSTANT stype.

The interface from the driver is changed to pass in the tuple,
(stype, id, shader_type), and we look for this. If
radeon_state_shader ever shows up on profile, it could use a
hashtable based on stype/shader_type to speed things up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoglapi: fix generator which got out of sync with the codebase
Luca Barbieri [Mon, 30 Aug 2010 18:48:49 +0000 (20:48 +0200)]
glapi: fix generator which got out of sync with the codebase

The __GLapi typedef was removed in c356f5867f2c1fad7155df538b9affa8dbdcf869,
but the code generator hasn't been updated.

14 years agoi965: Clear the cached constant buffer entry in the VS at control flow.
Eric Anholt [Mon, 30 Aug 2010 18:19:30 +0000 (11:19 -0700)]
i965: Clear the cached constant buffer entry in the VS at control flow.

Fixes the 7 regressions with constant buffers forced on with piglit -t
glsl (glsl-vs-if-*).

14 years agoi965: Align the number of payload regs to 2 again in 16-wide mode.
Eric Anholt [Mon, 30 Aug 2010 17:47:05 +0000 (10:47 -0700)]
i965: Align the number of payload regs to 2 again in 16-wide mode.

Fixes a regression in point-line-no-cull and glean/paths tests since
501c9dc62774a73c080d500a1eab773b0da9577e.

14 years agoi965: Apply the rest of the old-libdrm guard patch.
Cedric Vivier [Mon, 30 Aug 2010 17:40:39 +0000 (10:40 -0700)]
i965: Apply the rest of the old-libdrm guard patch.

Bug #29855

14 years agoi965: Add support for loops to the new FS backend.
Eric Anholt [Sun, 29 Aug 2010 06:31:09 +0000 (23:31 -0700)]
i965: Add support for loops to the new FS backend.

This includes a handy little safety check to prevent the loop from
going "too long", as permitted by the spec.  I haven't gone out of my
way to test it, though…

Fixes 20 more piglit tests.

14 years agoi965: Make brw_CONT and brw_BREAK take the pop count.
Eric Anholt [Sun, 29 Aug 2010 06:18:18 +0000 (23:18 -0700)]
i965: Make brw_CONT and brw_BREAK take the pop count.

We always need to set it, so pass it in.

14 years agoi965: Add "discard" support to the new FS backend.
Eric Anholt [Sun, 29 Aug 2010 05:56:33 +0000 (22:56 -0700)]
i965: Add "discard" support to the new FS backend.

Fixes 3 testcases related to discard.

14 years agoi965: Fix the new implementation of ir_unop_sign to match brw_wm_emit.c
Eric Anholt [Sun, 29 Aug 2010 05:42:01 +0000 (22:42 -0700)]
i965: Fix the new implementation of ir_unop_sign to match brw_wm_emit.c

Like the comparison operations, this suffered from CMP only setting
the low bit.  Doing the AND instructions would be the same instruction
count as the more obvious conditional moves, so do cond moves.

Fixes glsl-fs-sign and 6 other cases, like trig functions that use
sign() internally.

14 years agoi965: Add support for texturing with bias to i965 FS backend.
Eric Anholt [Sun, 29 Aug 2010 05:34:30 +0000 (22:34 -0700)]
i965: Add support for texturing with bias to i965 FS backend.

Fixes 5 piglit tests for bias.  Note that LOD is a 1.30 feature and
not yet supported.

14 years agoglut: Silence missing initializer warning.
José Fonseca [Mon, 30 Aug 2010 13:12:01 +0000 (14:12 +0100)]
glut: Silence missing initializer warning.

14 years agomesa: Return after assertion failure.
José Fonseca [Mon, 30 Aug 2010 12:59:24 +0000 (13:59 +0100)]
mesa: Return after assertion failure.

Addresses the warnings:
warning: ‘target’ may be used uninitialized in this function
warning: ‘target_string’ may be used uninitialized in this function

14 years agogallivm: Compute the 4 texel offsets for linear filtering en ensemble.
José Fonseca [Mon, 7 Jun 2010 11:05:18 +0000 (12:05 +0100)]
gallivm: Compute the 4 texel offsets for linear filtering en ensemble.

14 years agoglsl: Silence unused variable warning.
José Fonseca [Mon, 30 Aug 2010 12:53:15 +0000 (13:53 +0100)]
glsl: Silence unused variable warning.

14 years agomesa: Fix _mesa_lookup_parameter_constant's return value.
José Fonseca [Mon, 30 Aug 2010 12:48:21 +0000 (13:48 +0100)]
mesa: Fix _mesa_lookup_parameter_constant's return value.

Fixes gcc warning

  In function ‘_mesa_add_unnamed_constant’:
  warning: ‘pos’ may be used uninitialized in this function

but also what appears to be a bug.

14 years agogallivm: Disable LLVM's pretty stack trace dumper.
José Fonseca [Sun, 29 Aug 2010 11:05:36 +0000 (12:05 +0100)]
gallivm: Disable LLVM's pretty stack trace dumper.

By default LLVM adds a signal handler to output a pretty stack trace.
This signal handler is never removed, causing problems when unloading
the shared object where the gallium driver resides.

Thanks to Chris Li for finding this.

14 years agogallivm: Correct copy'n'pasted comments.
José Fonseca [Sat, 21 Aug 2010 10:29:41 +0000 (11:29 +0100)]
gallivm: Correct copy'n'pasted comments.

14 years agogallivm: Fix lp_build_sum_vector.
José Fonseca [Sat, 21 Aug 2010 10:31:22 +0000 (11:31 +0100)]
gallivm: Fix lp_build_sum_vector.

The result is scalar, so when argument is zero/undef we can pass vector
zero/undef.

Also, support the scalar case.

14 years agosvga: Fix CMP translation for vertex shader targets.
Michal Krol [Fri, 27 Aug 2010 11:24:47 +0000 (13:24 +0200)]
svga: Fix CMP translation for vertex shader targets.

SVGA3DOP_CMP is not supported for vertex shaders;
use SLT + LRP instead.

14 years agosvga: Re-emit bound rendertargets and texture samplers at the beginning of every...
José Fonseca [Sun, 15 Aug 2010 12:36:02 +0000 (13:36 +0100)]
svga: Re-emit bound rendertargets and texture samplers at the beginning of every command buffer.

Only non null resources.

To ensure that relocations are emitted for every resource currently
referred.

14 years agost/mesa: set the MaxVarying GLSL constant
Marek Olšák [Wed, 25 Aug 2010 03:25:41 +0000 (05:25 +0200)]
st/mesa: set the MaxVarying GLSL constant

14 years agor300g: fix warning in winsys
Marek Olšák [Mon, 30 Aug 2010 11:25:07 +0000 (13:25 +0200)]
r300g: fix warning in winsys

14 years agor600g: add DST opcode support.
Dave Airlie [Mon, 30 Aug 2010 06:22:54 +0000 (16:22 +1000)]
r600g: add DST opcode support.