Commit graph

36252 commits

Author SHA1 Message Date
Eric Anholt
cd512b0063 gl_Normal is a vec3 not a vec4.
Fixes CorrectSwizzle1.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
f03acfc7d7 builtins: Add the mix(gentype, gentype, float) variant.
The broken-in-mesa Regnum Online shader now parses, except for its
preprocessor usage.
2010-06-01 15:15:04 -07:00
Eric Anholt
336b4ad8c7 Handle GLSL 1.20 implicit type conversions.
We were nicely constructing a new expression for the implicit type
conversion, but then checking that the previous types matched instead
of the new expression's type.  Fixes errors in Regnum Online shaders.
2010-06-01 15:15:04 -07:00
Eric Anholt
60fa1a9458 builtins: Add atan(). 2010-06-01 15:15:04 -07:00
Eric Anholt
5e58e541e0 builtins: Add asin(). 2010-06-01 15:15:04 -07:00
Eric Anholt
43ad37aa88 ir_constant_expression: Handle several floating point unops.
Cleans up a bunch of pointless operations in a GStreamer fragment shader.
2010-06-01 15:15:04 -07:00
Eric Anholt
65122e9e80 ir_constant_variable: New pass to mark constant-assigned variables constant.
This removes a bunch of gratuitous moving around of constant values
from constructors.  Makes a shader ir I was looking at for structure
handling almost readable.
2010-06-01 15:15:04 -07:00
Eric Anholt
f389862006 ir_constant_folding: Look at instructions in functions.
This was broken in the ir_label -> ir_function rework.
2010-06-01 15:15:04 -07:00
Eric Anholt
49a5d5c4f5 ir_swizzle_swizzle: Reduce swizzle chains to a single swizzle. 2010-06-01 15:15:04 -07:00
Eric Anholt
b145e90369 ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.
This should remove the burden of handling constant vector indexing
well from backend codegen, and could help with swizzle optimizations.
2010-06-01 15:15:04 -07:00
Eric Anholt
f8bb17260a ir_expression_flattening: Handle flattening values out of swizzles, too.
Fixes an uninlined normalize() in CorrectSwizzle2.vert.
2010-06-01 15:15:04 -07:00
Eric Anholt
459e4a286c ir_expression_flattening: Fix breakage from hierarchichal visitor.
Similar to other situations where the visitor pattern doesn't fit, in
this case we need the pointer to the base instruction in the
instruction stream for where to insert any new instructions we
generate (not the instruction in the tree we're looking at).  By
removing the code for setting the base_ir, flattened expressions would
end up, for example, before the function definition where they had appeared.
2010-06-01 15:15:04 -07:00
Carl Worth
2571415d1a Implement comment handling in the lexer (with test).
We support both single-line (//) and multi-line (/* ... */) comments
and add a test for this, (trying to stress the rules just a bit by
embedding one comment delimiter into a comment delimited with the
other style, etc.).

To keep the test suite passing we do now discard any output lines from
glcpp that consist only of spacing, (in addition to blank lines as
previously). We also discard any initial whitespace from gcc output.
In neither case should the absence or presence of this whitespace
affect correctness.
2010-06-01 12:18:43 -07:00
Carl Worth
a771a40e22 Fix #if-skipping to *really* skip the skipped group.
Previously we were avoiding printing within a skipped group, but we
were still evluating directives such as #define and #undef and still
emitting diagnostics for things such as macro calls with the wrong
number of arguments.

Add a test for this and fix it with a high-priority rule in the lexer
that consumes the skipped content.
2010-06-01 11:23:08 -07:00
Jakob Bornecrantz
05863c4877 gallium: Don't depend directly on staging dir in Xorg template makefile 2010-06-01 10:30:27 +01:00
Brian Paul
b297b14d30 tgsi: we don't support indirect input/output registers in SSE codegen yet
Extend the check for indirect addressing of temp regs to include
input/output regs.

Fixes failure with piglit glsl-texcoord-array.shader_test test when using
SSE codegen.
2010-06-03 09:01:32 -06:00
Brian Paul
d4afee9202 tgsi: whitespace cleanup 2010-06-03 08:58:31 -06:00
Brian Paul
d18fb4822b gallium: add interpolation parameter to simple shader functions
This lets us specify linear interpolation instead of perspective
interpolation for blit operations.  Might be a bit faster.
2010-06-03 08:54:15 -06:00
Jakob Bornecrantz
35d75e4930 gallium: Don't always copy the dri driver to the staging dir
So something in the build keept updating the timestamp on the
staging directory causing us to always copy the library to it.
2010-06-01 09:41:01 +01:00
Jakob Bornecrantz
d212a4d414 gallium: Create a Xorg driver template Makefile 2010-06-01 09:41:00 +01:00
Brian Paul
6cc51b982e util/u_debug: use MAX2 macro 2010-06-03 07:52:46 -06:00
José Fonseca
81862bbbc8 llvmpipe: Number shaders/variants for more reproducible function names in the IR. 2010-06-03 14:32:56 +01:00
José Fonseca
55948247eb gallivm: Register the JIT engine with oprofile on debug/profile builds. 2010-06-03 14:32:56 +01:00
José Fonseca
ef81779850 gallivm: Factor out the quad derivative code into a single place. Fix ddy.
For ddy it should be (bottom - top).
2010-06-03 14:32:56 +01:00
Joakim Sindholt
9eb730a735 r300g: use util/u_debug 2010-06-03 13:45:05 +02:00
Joakim Sindholt
8413b92a6f gallium: silence all debug_named_value related warnings 2010-06-03 13:45:05 +02:00
Joakim Sindholt
fbeab4cbce util/u_debug: add description field to debug_named_value 2010-06-03 13:45:05 +02:00
Vinson Lee
d062d21416 scons: Handle Python OSError exception when missing libdrm_radeon.
Instead of crashing when libdrm_radeon is unavailable, the SCons build
just does not build r600g.
2010-06-03 00:08:22 -07:00
Marek Olšák
128190e4a9 r300/compiler: print opcode names instead of numbers 2010-06-03 05:15:10 +02:00
Marek Olšák
e0d72814be r300g: set the minimum texture stride to 64 bytes on RS600, RS690, and RS740
I hope I've done it right. No way to test it here...
2010-06-03 03:46:34 +02:00
Vinson Lee
88008dfaa4 dri/swrast: Remove unnecessary header. 2010-06-02 17:54:10 -07:00
Brian Paul
dfe9dec04f st/mesa: fix indirect addressing of input/output regs
This fixes an issue that was missed with commit
9f544394c1.
Fixes piglit glsl-texcoord-array.shader_test
2010-06-02 17:43:39 -06:00
Brian Paul
14b7fdb8ac gallivm: bump up LP_BUILD_FLOW_MAX_VARIABLES
Fixes failed assertion with piglit fbo-drawbuffers-fragcolor.c
See fd.o bug 28358.

With 8 color buffers + Z we need to declare 33 vars, at least.
2010-06-02 16:23:20 -06:00
Kristian Høgsberg
890b3c61e3 intel: Remove a leftover DRI1/DRI2 conditional 2010-06-02 18:07:14 -04:00
Brian Paul
2c30a8d8f9 glx: fix indentation and remove extraneous break 2010-06-02 16:04:10 -06:00
Brian Paul
fc72452b97 glx: reformat and silence unused expression warning 2010-06-02 16:03:22 -06:00
Brian Paul
398e046efd glsl: handle indirectly indexed input registers in linker
For example, if the fragment shader reads gl_TexCoord[i] with a
dynamic index we need to set all the InputsRead bits for all
texcoords.  We were already doing this for shader outputs.
Refactored the later code so inputs and outputs are handled with
similar code.

Fixes a swrast failure with piglit's glsl-texcoord-array.shader_test
2010-06-02 15:34:49 -06:00
Brian Paul
e57689c6ba mesa: use BITFIELD64_BIT() macro 2010-06-02 15:34:49 -06:00
Brian Paul
7a156476e4 glsl: fix bad sanity-check assertion 2010-06-02 15:34:49 -06:00
Brian Paul
23c5b21c16 mesa: whitespace and 80 column wrapping 2010-06-02 15:34:49 -06:00
Eric Anholt
84db95bfcd shaders: Don't lose the param binding swizzle for single params.
Multiple item params are OK because we don't allow swizzles for them
(in case you do array access to hit their elements, for example).  For
singles, though, using the swizzle can cut down on storage, we do want
to allow a swizzled use of another param.

Fixes OGLC texRect.c.
2010-06-02 14:06:41 -07:00
José Fonseca
a33b5ef7d0 llvmpipe: Fix bad logic.
Courtesy of Vinson and coverity.
2010-06-02 21:32:49 +01:00
Vinson Lee
fae7bee475 llvmpipe: Remove unnecessary header. 2010-06-02 12:09:23 -07:00
José Fonseca
92cbbba7fb llvmpipe: Fix typo in assert. 2010-06-02 20:00:30 +01:00
José Fonseca
ead58101f9 llvmpipe: Per quad interpolation.
First interpolate the 4 quads upper left corners, then sub-interpolate
each quad pixel. Do the perspective divide once per quad.

Saves some muls and reciprocates. But doesn't seem to make a
noticeable improvement.

It make the code simpler and more compact, so commiting anyway.
2010-06-02 18:43:35 +01:00
José Fonseca
5871b7ebc9 llvmpipe: Minor cleanup to the interpolator. 2010-06-02 16:09:21 +01:00
José Fonseca
952d188c3c gallivm: Add a lp_build_const_elem(). 2010-06-02 16:00:40 +01:00
José Fonseca
21a6bf8624 llvmpipe: Store often used LLVM types in the lp_build_context. 2010-06-02 16:00:15 +01:00
José Fonseca
baf4393105 gallivm: Zero min_lod and max_lod when only one view is selected and min/mag filter are equal. 2010-06-02 13:24:26 +01:00
José Fonseca
804e76ac4f gallivm: Make lp_build_sample_wrap_int usage more accurate.
Fixes mesa texwrap demo border with GL_CLAMP.
2010-06-02 13:24:26 +01:00