Commit graph

37181 commits

Author SHA1 Message Date
Eric Anholt
9b68b88e43 ir_to_mesa: Add support for matrix * matrix. 2010-07-07 16:37:48 -07:00
Kenneth Graunke
e024c5c690 ir_reader: Don't emit ir_function multiple times. 2010-07-07 16:37:48 -07:00
Brian Paul
d95b40759e gallivm: restore const qualifier 2010-07-07 17:36:43 -06:00
Brian Paul
b17fba92db gallivm: fix cube map LOD computation
First, this undoes commit e503af4baa
so we use iround() in lp_build_nearest_mip_level().

Second, in lp_build_sample_general() we need to check if we're sampling
a cube map before anything else.  Choose the cube face and then recompute
the partial derivatives of (S,T) with respect to the chosen cube face.
Before, we were using the directional (S,T,R) derivatives to compute
the LOD.

Third, work around an apparent bug in LLVM 2.7 where setting the lod
variable to a const(0) value results in bad x86 code.  See comments in
the code.
2010-07-07 17:33:43 -06:00
Ian Romanick
35c89204e5 linker: Use bit-0 instead of VERT_BIT_GENERIC0
Uses of the bits for allocation are offset by 16, and
VERT_BIT_GENERIC0 already has the 16 offset.  As a result, it was
preventing the wrong thing from being allocated.
2010-07-07 16:28:39 -07:00
Eric Anholt
0b74bbb3dc glsl: Fix the setup of refract()'s output for vec3/vec4 and k < 0.0.
caught by valgrind.
2010-07-07 14:55:33 -07:00
Eric Anholt
9cbd8a1d5a glsl2: Fix ir_div_to_mul_rcp for integer division.
rcp of an integer value did not produce the result you're looking for.
Instead, do the a * rcp(b) as float and truncate after.  This mostly
fixes glsl-fs-loop-nested.
2010-07-07 14:06:26 -07:00
Eric Anholt
43b5b03d67 glsl2: Actually add the declaration of _post_incdec_temp. 2010-07-07 14:06:26 -07:00
Kenneth Graunke
acf88f2769 ir_constant_expression: Fix loop increments. 2010-07-07 12:41:26 -07:00
Kenneth Graunke
388ab9fa6b glsl2: Initialize yylineno and yycolumn so line numbers are sane. 2010-07-07 12:41:26 -07:00
Ian Romanick
e78e0fa42b glsl2: Put the initializer in the instruction stream after the declaration 2010-07-07 12:41:26 -07:00
Ian Romanick
c44556317a exec_list: Add method to append one complete list to another 2010-07-07 12:41:26 -07:00
Ian Romanick
2e85f993d8 Revert "glsl2: Put the declaration in the instruction stream before its initializer."
This change causes segfaults in other tests.  A fix for both sets of
segfaults is coming.

This reverts commit d4d630b72c.
2010-07-07 12:41:26 -07:00
Brian Paul
9755539116 st/mesa: fix sampler max_lod computation
This change makes gallium behave like other GL implementations and fixes
a conformance failure.
2010-07-07 13:05:35 -06:00
Eric Anholt
76101f7c04 ir_to_mesa: Add support for gl_TextureMatrix access.
Fixes glsl-vs-texturematrix-1, and glsl-vs-texturematrix-2 on swrast.
2010-07-07 11:51:36 -07:00
Eric Anholt
8bb15c1ed5 ir_to_mesa: Fill in some uninitialized fields that sometimes contained junk. 2010-07-07 11:39:21 -07:00
Andre Maasikas
51c438feb7 r600: workaround 3 comp GL_SHORT vertex attribute format on r700
guess it's a hw errata?
2010-07-07 21:32:07 +03:00
Eric Anholt
d674ebcee0 glsl2: Add a pass to simplify if statements returning from both sides.
This allows function inlining making the following tests work even
without function calls implemented:
glsl-fs-functions-2
glsl-fs-functions-3
glsl-vs-functions
glsl-vs-functions-2
glsl-vs-functions-3
glsl-vs-vec4-indexing-5

(Note that those tests were designed to trigger actual function calls,
and this defeats them.  However, those testcases ended up catching the
bug in the previous commit.)
2010-07-07 09:10:48 -07:00
Eric Anholt
6de882334a glsl2: Clean up vec_index_to_cond_assign after the clone return type change. 2010-07-07 09:07:52 -07:00
Eric Anholt
773025b92c glsl2: Don't forget to walk the parameters to a function in the hv.
Fixes segfaults from use after free after the steal of ir nodes and
free of the compile context.
2010-07-07 09:07:52 -07:00
Eric Anholt
570dc0d400 glsl2: Avoid null deref in scalar constant unop expressions. 2010-07-07 09:07:52 -07:00
Brian Paul
84a5f27b9b glsl: use Elements() in arrays instead of sentinal values
The _slang_*_output_name() functions had one too many loop iterations
because of the sentinal end-of-list values in the vertOutput array.
Just use Elements() everywhere.
2010-07-07 09:00:00 -06:00
Eric Anholt
d4d630b72c glsl2: Put the declaration in the instruction stream before its initializer.
This fixes a regression in the generated code from when I did the
ir_validate.cpp-driven rework of assignments.
2010-07-06 18:49:24 -07:00
Eric Anholt
a36334be02 glsl2: Add pass for supporting variable vector indexing in rvalues.
The Mesa IR needs this to support vector indexing correctly, and
hardware backends such as 915 would want this behavior as well.

Fixes glsl-vs-vec4-indexing-2.
2010-07-06 18:49:24 -07:00
Eric Anholt
2d1789e667 ir_to_mesa: Add support for conditional moves.
Nothing generates conditional moves yet.
2010-07-06 18:49:24 -07:00
Ian Romanick
ca088cc277 glsl2: Clone methods return the type of the thing being cloned
This is as opposed to returning the type of the base class of the hierarchy.
2010-07-06 17:44:37 -07:00
Kenneth Graunke
f14e596f11 ir_constant_expression: Declare loop counting variables in the loops.
Fixes "name lookup of 'c' changed" warning.
2010-07-06 17:43:56 -07:00
Vinson Lee
c89ea8f213 llvmpipe: Don't build lp_test_round when using MSVC.
lp_test_round uses the math functions round and trunc, which aren't
available with MSVC.

Fixes the MSVC build for now.
2010-07-06 17:25:39 -07:00
Vinson Lee
2e423ac074 llvmpipe: Add lp_test_round to SCons build. 2010-07-06 16:18:32 -07:00
Kenneth Graunke
f2dfac6d74 glsl2: Update TODO. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
3f4a0b8bb0 ir_constant_expression: Add support for dot products. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
cf80a4d177 ir_constant_expression: Add support for matrix multiplication.
Also handles matrix/vector and vector/matrix multiplication.

Fixes piglit tests const-matrix-multiply-01.frag,
const-matrix-multiply-02.frag, and const-vec-mat.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
37b3f9d0ed ir_constant_expression: Support scalar * vector and scalar * matrix.
The test here is slightly different since we need to keep matrix
multiplication separate.

Fixes piglit tests const-vec-scalar-03.frag and const-mat-scalar-03.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
dad35eb8b0 ir_constant_expression: Support scalar / vector and scalar / matrix.
Fixes piglit tests const-vec-scalar-04.frag and const-mat-scalar-04.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
97b44f040a ir_constant_expression: Support scalar - vector and scalar - matrix.
Fixes piglit tests const-vec-scalar-02.frag and const-mat-scalar-02.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
e74dcd7924 ir_constant_expression: Support scalar + vector and scalar + matrix.
Fixes piglit tests const-vec-scalar-01.frag, const-vec-scalar-05.frag,
and const-mat-scalar-01.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
6fc983b9bb ir_constant_expression: Assert that both operands share a base type. 2010-07-06 16:03:33 -07:00
Kenneth Graunke
6bc432e14e ir_constant_expression: Initialize op[0] and op[1] to NULL.
This makes it easy to check if there is a second argument.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
c63a1db81f ir_constant_expression: Initialize all components of constant data to 0.
This is probably just a good idea, and will come in useful when
implementing things like matrix multiplication.
2010-07-06 16:03:32 -07:00
Vinson Lee
ff318c45ec egl: Remove unnecessary headers. 2010-07-06 16:02:49 -07:00
Vinson Lee
9ead6c129f draw: Remove unnecessary header. 2010-07-06 15:49:40 -07:00
Vinson Lee
01985390be gallivm: Remove unnecessary header. 2010-07-06 15:45:31 -07:00
Marek Olšák
98cb202444 util: print help for debug options on non-debug builds
I'd like to see the help when I request it.
2010-07-07 00:12:49 +02:00
Ian Romanick
d1a1ee583e Add hash table helper functions for using pointers as hash keys 2010-07-06 15:00:46 -07:00
Ian Romanick
e45a982313 Make hashtable.h be C++ friendly 2010-07-06 15:00:46 -07:00
Eric Anholt
a0b3b93029 ir_to_mesa: Use the compiler-assigned locations for builtin attrs/varyings.
The previous table didn't distinguish gl_Color for the VS and FS, so
we would use the FS's attribute index for the VS and read undefined.
This partially fixes glsl-routing to match its behavior on master.
2010-07-06 14:05:51 -07:00
Brian Paul
e503af4baa gallivm: use trunc, not round in lp_build_nearest_mip_level()
Fixes fd.o bug 28036 (piglit fbo-cubemap.c regression)
2010-07-06 13:22:57 -06:00
Brian Paul
7743791da0 llvmpipe: add test program for round(), trunc(), floor(), ceil() 2010-07-06 11:36:37 -06:00
Brian Paul
e834c48100 gallivm: finish implementation of lp_build_iceil()
Plus fix minor error in lp_build_iceil() by tweaking the offset value.
And add a bunch of comments for the round(), trunc(), floor(), ceil()
functions.
2010-07-06 11:36:37 -06:00
Zack Rusin
99c8d9b6da llvmpipe: disconnect vertex texture sampling from the setup
it was wrong to put this in the fs paths, but it was easier to just
stuff it along the fragment texture sampling paths. the patch
disconnects vertex texture sampling and just maps the textures
before the draw itself and unmaps them after.
2010-07-06 13:29:04 -04:00