Commit graph

37536 commits

Author SHA1 Message Date
Ian Romanick
fc63e37b97 ir_to_mesa: Silence unused variable warnings 2010-08-16 09:45:01 -07:00
Ian Romanick
68772031e6 ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *) 2010-08-16 09:43:00 -07:00
Ian Romanick
0bf63733e5 ir_to_mesa: Support texture rectangle targets 2010-08-16 09:39:58 -07:00
Marek Olšák
83baa8a6c5 st/mesa: remove output register reads inside shaders
This is a GLSL2 regression fix.
2010-08-16 02:19:18 +02:00
Vinson Lee
a0b0afc694 mesa: Check that _XOPEN_SOURCE is defined before using it. 2010-08-15 13:08:15 -07:00
José Fonseca
9349379d1a Revert "glsl2: Use stdint.h instead of inttypes.h"
This reverts commit a77a6bc008.
2010-08-14 16:01:24 +01:00
José Fonseca
8df0bea9c5 Replace our custom C99 headers with http://code.google.com/p/msinttypes/
Perhaps http://www.azillionmonkeys.com/qed/pstdint.h would be a better
(more portable) choice, but only MSVC uses this anyway, and we can always
change later.
2010-08-14 16:00:52 +01:00
José Fonseca
1cbcf6693a glsl: Standardize a few more uses of struct vs class keyword. 2010-08-14 15:35:57 +01:00
José Fonseca
1d22923fae scons: Link talloc. 2010-08-14 15:29:15 +01:00
José Fonseca
4b1721eaf3 glsl: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:39 +01:00
José Fonseca
19acfa42ed mesa: Silence gcc warning "control reaches end of non-void function". 2010-08-14 14:40:06 +01:00
José Fonseca
325aa1b3cd mesa: Silence gcc warning "missing initializer for member". 2010-08-14 14:38:09 +01:00
José Fonseca
8881b0fe43 mesa: Recent versions of MSVC define the single precision functions already. 2010-08-14 13:10:24 +01:00
José Fonseca
2322404b55 scons: Add new source files. 2010-08-14 12:45:14 +01:00
José Fonseca
68f602afb1 mesa: atan2f and powf need two args. 2010-08-14 12:44:41 +01:00
Ian Romanick
443a7e4e9a Merge branch 'master' into glsl2 2010-08-13 20:22:46 -07:00
Ian Romanick
2f8ee757ab mesa: Work-arounds for platforms that lack C99 math functions 2010-08-13 20:18:08 -07:00
Kenneth Graunke
9364ad8528 glsl2/Makefile: Add a 'make builtins' target.
This copies over a dummy builtin_functions.cpp and rebuilds a
bootstrapped version of the compiler, then uses that to generate the
proper list of builtins.  Finally, it rebuilds the compiler with the new
list.

Unfortunately, it's no longer automatic, but at least it works.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
43ff8f1a4b glsl2: Rework builtin function generation.
Each language version/extension and target now has a "profile" containing
all of the available builtin function prototypes.  These are written in
GLSL, and come directly out of the GLSL spec (except for expanding genType).

A new builtins/ir/ folder contains the hand-written IR for each builtin,
regardless of what version includes it.  Only those definitions that have
prototypes in the profile will be included.

The autogenerated IR for texture builtins is no longer written to disk,
so there's no longer any confusion as to what's hand-written or
generated.

All scripts are now in python instead of perl.
2010-08-13 19:09:36 -07:00
Kenneth Graunke
d802ba110f ir_reader: Don't mark functions as defined if their body is empty. 2010-08-13 19:09:35 -07:00
Ian Romanick
d01bf822dd glsl2: Commit generated file change by commit ab18be74
This would have been included in commit 23f6017d, but make wisely did
not regenerate the file when the .lpp file did not change.
2010-08-13 19:05:54 -07:00
Eric Anholt
8f8cdbfba4 glsl2: Add a pass to strip out noop swizzles.
With the glsl2-965 branch, the optimization of glsl-algebraic-rcp-rcp
regressed due to noop swizzles hiding information from ir_algebraic.
This cleans up those noop swizzles for us.
2010-08-13 17:54:47 -07:00
Eric Anholt
42cab131da glsl2: Convert ir_constant_propagation to ir_rvalue_visitor.
This one is a little tricky because of the LHS handling.
2010-08-13 17:54:47 -07:00
Eric Anholt
b3b0cf6a4c glsl2: Add a generic visitor class to call back with pointers to each rvalue.
I keep copy and pasting this code all over, so consolidate it in one
place.
2010-08-13 17:54:46 -07:00
Eric Anholt
9c3acce680 mesa: Avoid using c++ keyword in dri_util.h when compiled with c++. 2010-08-13 17:54:46 -07:00
Eric Anholt
c374487a54 intel: Remove include of texmem.h, since we haven't used it in ages. 2010-08-13 17:54:46 -07:00
Eric Anholt
d19eecef54 glsl2: Move ir_to_mesa handling to driver CompileShader and LinkShader hooks.
This lets drivers override ir_to_mesa with their own codegen, or at
least have a native alternative.
2010-08-13 17:54:42 -07:00
Eric Anholt
013bbbbb0a glsl2: Add support for ir_unop_neg to ir_mat_op_to_vec 2010-08-13 17:47:00 -07:00
Eric Anholt
2f4fe15168 glsl2: Move the common optimization passes to a helper function.
These are passes that we expect all codegen to be happy with.  The
other lowering passes for Mesa IR are moved to the Mesa IR generator.
2010-08-13 17:47:00 -07:00
Kenneth Graunke
c55aa4292f glsl2: Refresh autogenerated bison parser. 2010-08-13 17:16:43 -07:00
Vinson Lee
07ca55b7fa Fix an MSVC build error (bugzilla 29570). 2010-08-13 17:11:21 -07:00
Ian Romanick
768b55a526 glsl2: Remove unnecessary use of 'struct' before type names
In C++ you don't have to say 'struct' or 'class' if the declaration of
the type has been seen.  Some compilers will complain if you use
'struct' when 'class' should have been used and vice versa.

Fixes bugzilla #29539.
2010-08-13 16:46:43 -07:00
Ian Romanick
d960b61ea3 Add missing intmax_t and uintmax_t 2010-08-13 16:22:38 -07:00
Ian Romanick
a77a6bc008 glsl2: Use stdint.h instead of inttypes.h 2010-08-13 16:22:21 -07:00
Ian Romanick
23f6017d70 glsl2: Commit generated file changed by previous commit 2010-08-13 14:50:53 -07:00
Ian Romanick
ab18be74ac glsl2: Use --nounistd to fix MSVC build
Also remove the --never-interactive command line option for the
preprocessor lexer.  This was already done for main compiler lexer.
2010-08-13 14:50:53 -07:00
Ian Romanick
c33e78f62b linker: Assign attrib location 0 if gl_Vertex is not used
If gl_Vertex is not used in the shader, then attribute location 0 is
available for use.

Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
2010-08-13 14:50:48 -07:00
Jakob Bornecrantz
204d4cbea0 glsl2: Include string.h in preprocessor 2010-08-13 18:36:55 +01:00
Ian Romanick
103453659d glsl2: Commit generated files changed by previous two commits 2010-08-13 09:34:52 -07:00
Ian Romanick
5c77efc0b2 glsl2: Avoid token name collisions with names used by Windows header files 2010-08-13 09:30:56 -07:00
Ian Romanick
5b9f3db719 glsl2: Eliminate tokens for square matrix short names
MAT2 and MAT2X2, for example, are treated identically by the parser.
The language version based error checking (becuase mat2x2 is not
available in GLSL 1.10) is already done in the lexer.
2010-08-13 09:29:39 -07:00
José Fonseca
3a3cdb909d scons: Build the new glsl2 code. 2010-08-13 13:55:34 +01:00
José Fonseca
1ca2945f84 talloc: Make it compile with MSVC, MinGW, and Xcode/gcc4.0.
Based on Aras Pranckevičius' patch.
2010-08-13 13:53:04 +01:00
José Fonseca
e6032b1d96 talloc: Import 2.0.1 code. 2010-08-13 12:31:10 +01:00
Ian Romanick
0dc39f481a glsl2: Use MIN2 from macros.h instead of open coding it 2010-08-12 18:01:14 -07:00
Ian Romanick
261bbc011d glsl2: Use Elements from main/compiler.h instead of open-coding 2010-08-12 15:05:39 -07:00
Brian Paul
2d83e3fa0d mesa: check for null shader->InfoLog before printing 2010-08-12 16:00:01 -06:00
Ian Romanick
4ca4edd20e glsl2: Commit generated file changed by previous commit 2010-08-12 10:09:05 -07:00
Ian Romanick
188f60fb05 glsl2: Add missing include of string.h
Makes the build happy on non-GCC platforms.
2010-08-12 10:09:05 -07:00
Jakob Bornecrantz
4f51762b07 gallium: Link DRI drivers with g++ and test with CXX
New shader compiler need libc++ runtime. This works already if
we are using llvm so this just covers the !llvm case.
2010-08-12 16:04:11 +01:00