Commit graph

38455 commits

Author SHA1 Message Date
Kenneth Graunke
ee88c46640 ast_function: Remove bogus cases from generate_constructor_matrix.
There are no integer matrix types, so switching on them is silly.
2010-09-01 18:57:50 -07:00
Dave Airlie
36192b772e r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view
fixes problems in valgrind with uninitialised values.
2010-09-02 11:17:37 +10:00
Eric Anholt
5ad74779ce 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.
2010-09-01 17:08:23 -07:00
Eric Anholt
500e7b7599 ir_to_mesa: Add a little helper for emitting link failure messages. 2010-09-01 17:08:23 -07:00
Eric Anholt
86af037e6a 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.
2010-09-01 17:08:23 -07:00
Eric Anholt
3cddc15d9d mesa: Add __printf__ attribute to printf-like functions to get warnings. 2010-09-01 17:08:23 -07:00
Dave Airlie
557a71c506 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.
2010-09-02 09:51:25 +10:00
Jerome Glisse
ffcb443cd7 r600g: silence compiler warning
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:09:37 -04:00
Jerome Glisse
67234b4b42 r600g: refix db/cb state
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:05:52 -04:00
Brian Paul
4ff3467daf 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.
2010-09-01 13:24:26 -06:00
Brian Paul
fd7f2ae085 mesa: more prog_execute.c debug code 2010-09-01 13:24:26 -06:00
Kenneth Graunke
0181385f36 glsl: Add forgotten implementations of equal/notEqual on bvecs. 2010-09-01 11:50:23 -07:00
Alex Deucher
c70459a1b9 r600g: fix up default state differences between r6xx and r7xx
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-09-01 14:41:03 -04:00
Brian Paul
6ac66192a6 st/glx: re-order destruction of buffers, visuals
Free the buffers before the visuals.  Fixes valgrind warning
reported in fd.o bug 29919.
2010-09-01 12:40:31 -06:00
Eric Anholt
dd5ef33e3c i965: DP2 produces a scalar result like DP3, DP4, etc.
Fixes glsl-fs-dot-vec2-2.
2010-09-01 10:45:05 -07:00
Ian Romanick
a35faa6a41 glsl2: Perform algebraic simplifications on logical binary operators
Reduces glsl-vs-all-01 from 42 Mesa IR instructions (including the
END) to 17.
2010-09-01 10:25:11 -07:00
Ian Romanick
a4262874f8 glsl2: Allow ir_constant::zero to create boolean constants 2010-09-01 10:25:11 -07:00
Jerome Glisse
66e4cb1cd5 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>
2010-09-01 13:16:23 -04:00
Jerome Glisse
15ce70252c Revert "Revert "r600g: precompute some of the hw state""
This reverts commit 1fa7245c34.

Conflicts:

	src/gallium/drivers/r600/r600_state.c
2010-09-01 13:04:42 -04:00
Patrice Mandin
4a955ab6b7 nouveau/nvfx: Remove enforcement of bit depth being same as front buffer
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2010-09-01 18:13:14 +02:00
Vladimir Vukicevic
0731701236 mesa: initialize dummy framebuffer and renderbuffer mutexes
See fd.o bug 29909.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:54:23 -06:00
Jon TURNEY
c085cd6917 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>
2010-09-01 08:48:11 -06:00
Jon TURNEY
c55a8a73a4 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>
2010-09-01 08:48:06 -06:00
Jon TURNEY
36b195332f 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>
2010-09-01 08:48:02 -06:00
Jon TURNEY
8fee182e8c 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>
2010-09-01 08:48:00 -06:00
Ian Romanick
63b80f8cc1 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.
2010-09-01 07:08:34 -07:00
Andre Maasikas
c3c25a7ab8 r600: cube mipmap levels are aligned to 8 faces only starting from r7xx 2010-09-01 09:19:51 +03:00
Dave Airlie
1d7b4af817 r600g: correct cb/zb offset emits.
This fixes fbo-3d and fbo-cubemap
2010-09-01 14:59:18 +10:00
Dave Airlie
1fa7245c34 Revert "r600g: precompute some of the hw state"
This reverts commit de0b76cab2, 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.
2010-09-01 14:56:04 +10:00
Dave Airlie
d7e2509692 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.
2010-09-01 13:55:56 +10:00
Dave Airlie
bea5f559a6 r600g: fix glean texCube and shadows.
add cube and shadow support to the texture code.
2010-09-01 12:55:21 +10:00
Brian Paul
3fa3c33844 gallivm: fix bug in nested conditionals
This, plus the previous commit fix fd.o bug 29806.
2010-08-31 19:15:07 -06:00
Brian Paul
16c733495d glsl2: fix bug in atan(y, x) function
When x==0, the result was wrong.  Fixes piglit glsl-fs-atan-1.shader_test
2010-08-31 19:15:07 -06:00
Eric Anholt
9b075cb9fa 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.
2010-08-31 15:43:49 -07:00
Keith Whitwell
e38d2f7163 llvmpipe: slightly simplify build_mask 2010-08-31 23:31:45 +01:00
Keith Whitwell
0aa3a09ced llvmpipe: combine linear mask calculation 2010-08-31 23:31:45 +01:00
Keith Whitwell
d8c92a1eea llvmpipe: intrinsics versions of build_mask functions 2010-08-31 23:31:44 +01:00
Ian Romanick
a6c3cd5ca6 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.
2010-08-31 14:44:13 -07:00
Eric Anholt
99f3c9caa3 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
2010-08-31 11:34:29 -07:00
nobled
2a78807db7 ir_to_mesa: Fix struct/class confusion 2010-08-31 11:34:29 -07:00
Eric Anholt
7406898441 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.
2010-08-31 11:34:29 -07:00
Kenneth Graunke
1eea96326f 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.
2010-08-31 11:00:34 -07:00
Chia-I Wu
3fbbd70e80 st/egl: Enable EGL_MESA_drm_display. 2010-08-31 15:52:33 +08:00
Chia-I Wu
8cdeff8444 egl: Mark EGL_MESA_screen_surface as obsolete.
EGL_MESA_drm_{display,image} can achieve the same functionality.
2010-08-31 15:25:22 +08:00
Dave Airlie
b87b6e5bf7 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.
2010-08-31 16:15:04 +10:00
Dave Airlie
ad202678fc r600g: fix fp-fragment-position test. 2010-08-31 15:13:24 +10:00
Dave Airlie
580781babe r600g: fix typo in last commit 2010-08-31 15:13:21 +10:00
Dave Airlie
5d66a8606d r600g: fix position input to fragment shader.
this fixes a few if the fs shader tests, 10 more piglits
2010-08-31 14:55:32 +10:00
Dave Airlie
4e61f085d0 r600g: remove unneeded function call from scs 2010-08-31 14:55:32 +10:00
Marek Olšák
4f189b3bf5 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.
2010-08-31 06:36:52 +02:00