Commit graph

38489 commits

Author SHA1 Message Date
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
Kenneth Graunke
2619b1c96f 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.
2010-08-30 21:04:13 -07:00
Dave Airlie
d3fa92584b 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
2010-08-31 12:59:10 +10:00
Zhenyu Wang
24ff42e7d5 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>
2010-08-31 09:58:18 +08:00
Dave Airlie
be7816f2b7 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
2010-08-31 11:44:34 +10:00
Dave Airlie
ee0153f891 r600g: make sure LIT splits constants 2010-08-31 10:47:08 +10:00
Dave Airlie
9bbc54a10d r600g: fix constant splitting
constant splitting was broken for multi-constant cases, fixes fp1 CMP+MAD, vp1 CMP.
2010-08-31 10:47:03 +10:00
Dave Airlie
85e401d8bf r600g: fix LIT tests 2010-08-31 10:46:58 +10:00
Dave Airlie
5ea238b799 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>
2010-08-31 09:43:48 +10:00
Ian Romanick
df869d9163 linker: Handle varying arrays, matrices, and arrays of matrices
Fixes piglit test case glsl-array-varying-01.
2010-08-30 16:02:51 -07:00
Eric Anholt
a3c2bd416a Don't pass -ffast-math to clang, since it ignores it and complains. 2010-08-30 14:20:05 -07:00
nobled
2a50187a92 Make configure work with clang
It was mistaking clang for gcc and deciding its version
was too low.
2010-08-30 13:59:18 -07:00
Jon TURNEY
e637f8b40c 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>
2010-08-30 13:41:39 -07:00
Jon TURNEY
6356303de6 Add talloc to dependencies for libGL built with xlib driver
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-08-30 13:41:36 -07:00
Eric Anholt
8b3d36d563 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.
2010-08-30 13:12:24 -07:00
Ian Romanick
33fe364e5a glsl2: Commit generated files changed by previous commit 2010-08-30 12:52:42 -07:00
Ian Romanick
bea3963f59 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).
2010-08-30 12:52:42 -07:00