Commit graph

48 commits

Author SHA1 Message Date
Kenneth Graunke
af05703826 Implement 1.30 int/uint variants of min/max/clamp. 2010-06-09 16:14:45 -07:00
Kenneth Graunke
c9aabc866f Implement 1.30 hyperbolic trig builtins (sinh, cosh, tanh). 2010-06-09 16:08:36 -07:00
Kenneth Graunke
1d0e07c420 Implement 1.20 'transpose' builtin. 2010-06-09 15:56:46 -07:00
Kenneth Graunke
43ff6fc4ae Implement 1.20 'outerProduct' builtin. 2010-06-09 15:47:34 -07:00
Kenneth Graunke
0c8ffadc8c Implement matrixCompMult builtin - the last of the 110 builtins. 2010-06-09 15:35:54 -07:00
Kenneth Graunke
b843c7a20c Implement dFdx, dFdy, and fwidth via new expression opcodes. 2010-06-09 14:44:39 -07:00
Kenneth Graunke
cbd881da3f Implement 'refract' builtin. 2010-06-09 14:44:39 -07:00
Kenneth Graunke
3ffedf1249 Fix some typing issues in asin.
CorrectFunction.vert now passes.
2010-06-09 14:15:04 -07:00
Kenneth Graunke
c476ba8fe2 Add a completely bogus implementation of the noise[1234] builtins.
idr suggested this.  Eventually we will need a real one.
2010-06-09 14:07:35 -07:00
Kenneth Graunke
855fcb22c1 Implement 'acos' builtin.
This is tacked on to the end of the 'asin' file because acos calls asin,
whech means asin needs to be defined first.  Alphabetical order fail.
2010-06-09 13:52:32 -07:00
Kenneth Graunke
539f29323f Implement 'faceforward' builtin. 2010-06-09 13:27:16 -07:00
Kenneth Graunke
29b22287fe Implement 'distance' builtin. 2010-06-09 13:17:00 -07:00
Kenneth Graunke
cdf1726ffd Add remaining signatures for 'clamp' builtin. 2010-06-09 13:10:00 -07:00
Kenneth Graunke
76796ed66f Add remaining signatures for 'max' builtin. 2010-06-09 13:05:40 -07:00
Kenneth Graunke
47d44c877e Add remaining signatures for 'min' builtin. 2010-06-09 13:04:16 -07:00
Kenneth Graunke
2438f64e63 Add remaining signatures for 'mod' builtin. 2010-06-09 13:04:03 -07:00
Kenneth Graunke
4b0029a97d Commit output of texture_builtins.py and refresh builtin_function.cpp. 2010-06-09 11:14:58 -07:00
Eric Anholt
5b9ac87941 builtins: Add support for reflect().
Fixes glsl-orangebook-ch06.frag parsing.
2010-06-01 15:15:05 -07:00
Eric Anholt
da46e5f534 builtins: Add ftransform().
Fixes glsl-orangebook-ch06-bump.vert.
2010-06-01 15:15:05 -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
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
Kenneth Graunke
67e07ad3a3 Refresh autogenerated builtin_function.cpp. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
b3262128fe Replace old builtin_function.cpp with new autogenerated one. 2010-05-14 16:34:46 -07:00
Eric Anholt
25ebc0459f builtin_functions: Clean up compiler warning about unused name, instructions. 2010-04-23 16:12:44 -07:00
Eric Anholt
ec9e73870c Put static pointers to vec[234]_types along with the static float_type.
Otherwise you have to type a lot of get_instance.
2010-04-23 16:12:44 -07:00
Kenneth Graunke
67029b13b7 Actually emit temp declaration in vector comparison builtins. 2010-04-21 23:58:13 -07:00
Kenneth Graunke
9fa99f3b6c Refactor IR function representation.
Now, ir_function is emitted as part of the IR instructions, rather than
simply existing in the symbol table.  Individual ir_function_signatures
are not emitted themselves, but only as part of ir_function.
2010-04-21 15:36:36 -07:00
Eric Anholt
a3fa3fbf76 Add an implementation of gentype-only clamp(). 2010-04-08 16:08:15 -07:00
Eric Anholt
cc4ef154e6 Add builtin implementations of vector comparison functions.
Fixes CorrectFunction1.vert, glsl-fs-notequal.frag.
2010-04-08 15:35:34 -07:00
Eric Anholt
cc49cea9ea Add support for builtin gentype mix(gentype a, gentype b)
Fixes glsl-fs-mix.frag, glsl-fs-mix-constant.frag.
2010-04-08 15:10:37 -07:00
Eric Anholt
feeb43b829 Add buitlin functions for any(), all(), not(). 2010-04-08 15:02:59 -07:00
Eric Anholt
925759283a Add builtin normalize() functions.
Fixes CorrectSqizzle2.vert.
2010-04-08 14:38:32 -07:00
Eric Anholt
fbc7c0b8f2 Make function bodies rely on the parameter variable declarations.
Previously, generating inlined function bodies was going to be
difficult, as there was no mapping between the body's declaration of
variables where parameter values were supposed to live and the
parameter variables that a caller would use in paramater setup.
Presumably this also have been a problem for actual codegen.
2010-04-07 17:23:23 -07:00
Eric Anholt
6173312d84 Make dot() take the right number of args. 2010-04-07 17:23:23 -07:00
Eric Anholt
7e78e07ddb Fix the returns of builtin functions to actually return. 2010-04-07 17:23:23 -07:00
Eric Anholt
894ea972a4 Put function bodies under function signatures, instead of flat in the parent.
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
2010-04-07 17:23:23 -07:00
Ian Romanick
6a15d5b514 Use ir_function::add_signature to create link between function and signature
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31 16:37:10 -07:00
Eric Anholt
d1e31952ed Add support for builtin radians() and degrees(). 2010-03-29 12:48:45 -07:00
Eric Anholt
3cb4358f38 Add the instruction for the parameter variable declarations of builtin funcs.
Matches constructor setup, but I'm not really sure why we make the
variable twice.
2010-03-29 12:48:45 -07:00
Eric Anholt
76a91e1afb Implement dot() builtin. 2010-03-29 12:48:45 -07:00
Eric Anholt
01665262e5 Implement exp2() and log2(), and make ir_unop_exp and ir_unop_log be base e.
Making the base e functions IR operations is not a clear win.  i965
doesn't support it, it doesn't look like r600 supports it, but r500
does. It should be easily supportable as a lowering pass, though.
2010-03-29 12:48:45 -07:00
Eric Anholt
53afc3609d Implement builtin length() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
44d68fd06f Add sqrt() builtin as an IR operation.
Following a discussion in #dri-devel, I think this makes more sense
than implementing it as RSQ RCP CMP as Mesa did.  The i965 has a
hardware sqrt that should work, and AMD is suppposed to be able to
implement it as RSQ RCP with an alternate floating point mode so that
the 0.0 case is handled like we want.
2010-03-29 12:48:45 -07:00
Eric Anholt
ddd2e83db2 Add builtin pow() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
bfe380a721 Implement some binary gentype builtin functions. 2010-03-29 12:48:45 -07:00
Eric Anholt
2eec73f735 Implement additional unary gentype builtins. 2010-03-29 12:48:45 -07:00
Eric Anholt
c22c40015d Implement the first builtin function: exp(). 2010-03-29 12:48:45 -07:00