summaryrefslogtreecommitdiff
path: root/src/glsl/builtins
AgeCommit message (Collapse)Author
2010-08-16glsl2: Add builtins profile for GLSL 1.30.Kenneth Graunke
Many functions are currently wrapped with #if 0 since we haven't implemented them yet.
2010-08-13glsl2: Rework builtin function generation.Kenneth Graunke
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-12glsl2: Use Elements from main/compiler.h instead of open-codingIan Romanick
2010-08-10texture_builtins.py: Remove useless comments.Kenneth Graunke
2010-08-09texture_builtins.py: Fix cut and paste errors in function names.Kenneth Graunke
Some signatures were being generated with the wrong function name.
2010-08-02glsl2: Fix expression type in builtin tan().Eric Anholt
Fixes glsl-fs-tan-1.
2010-07-30glsl2: Fix the implementation of atan(y, x).Eric Anholt
So many problems here. One is that we can't do the quadrant handling for all the channels at the same time, so we call the float(y, x) version multiple times. I'd also left out the x == 0 handling. Also, the quadrant handling was broken for y == 0, so there was a funny discontinuity on the +x side if you plugged in obvious values to test. I generated the atan(float y, float x) code from a short segment of GLSL and pasted it in by hand. It would be nice to automate that somehow. Fixes: glsl-fs-atan-1 glsl-fs-atan-2
2010-07-28glsl2: Fix outerProduct builtin.Kenneth Graunke
The type signatures were completely backwards.
2010-07-22glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin.Kenneth Graunke
2010-07-22glsl2/builtins: Fix 1.30 sign implementation for ints.Kenneth Graunke
2010-07-22glsl2/builtins: Fix "mod" builtin to use scalar/vector operations.Kenneth Graunke
2010-07-22glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).Eric Anholt
Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0). Fixes: glsl1-mix(vec4) function
2010-07-21linker: Link built-in functions instead of including them in every shaderIan Romanick
This is an invasive set of changes. Each user shader tracks a set of other shaders that contain built-in functions. During compilation, function prototypes are imported from these shaders. During linking, the shaders are linked with these built-in-function shaders just like with any other shader.
2010-07-20glsl2: Fix asin() implementation.Eric Anholt
I'd flipped around the order of two operations in paren-balancing adventures, and left out the multiply by sign(x) required for negative x. Fixes: glsl1-acos(vec4) function glsl1-asin(vec4) function glsl1-atan(vec4) function
2010-07-20glsl2: notEqual() produces a boolean value, not the base type of the args.Eric Anholt
Fixes: glsl1-vector relational (bvec2 ==,!=) glsl1-vector relational (vec4 !=)
2010-07-19glsl2: Use Elements macroIan Romanick
2010-07-19glsl2: Fix the expression type for atan's pi * sign(y).Eric Anholt
Fixes CorrectFunction.vert.
2010-07-18glsl2: Make cross() be an expression operation.Eric Anholt
ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have instructions for cross. Shaves 12 Mesa instructions off of a 66-instruction shader I have.
2010-07-14glsl2/builtins: Rework clamp to use scalar/vector combinations.Kenneth Graunke
2010-07-14glsl2/builtins: Rework min/max to use scalar/vector combinations.Kenneth Graunke
2010-07-07glsl: Fix the setup of refract()'s output for vec3/vec4 and k < 0.0.Eric Anholt
caught by valgrind.
2010-07-02glsl2/builtins: Use vector ops in the 130 version of "sign."Kenneth Graunke
2010-07-02glsl2/builtins: Use vector ops in "smoothstep."Kenneth Graunke
2010-07-01glsl2: Add ir_unop_fract as an expression type.Eric Anholt
Most backends will prefer seeing this to seeing (a - floor(a)), so represent it explicitly.
2010-06-30glsl2: Don't break sign() down by vector components.Eric Anholt
2010-06-30glsl2: Fix reversed value of step().Eric Anholt
It's 0.0 if x < edge, not 1.0. Partial fix for glsl-fs-step.
2010-06-30glsl2: Fix up the implementation of fract() for vector types.Eric Anholt
There's no need to split each vector component out, just do vector ops.
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt