| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This conveniently creates a zero value of whatever type you want.
|
|
|
|
|
| |
Fixes:
glsl-arb-fragment-coord-conventions
|
|
|
|
|
|
| |
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*. glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
|
|
|
|
|
|
|
|
|
|
|
| |
Top-level instructions now get NULL as their default type (since type is
irrelevant for things like ir_function), while ir_rvalues get error_type
by default.
This should make it easier to tell if we've forgotten to set a type. It
also fixes some "Conditional jump or move depends on uninitialized
value" errors in valgrind caused by ir_validate examining the type of
top level ir_instructions, which weren't set.
|
|
|
|
|
|
| |
Assignments can only exist at the top level instruction stream; the
residual value is handled by assigning the value to a temporary and
returning an ir_dereference_variable of that temporary.
|
|
|
|
|
|
|
|
|
| |
Since GLSL permits arrays of structures, we need to store each element
as an ir_constant*, not just ir_constant_data.
Fixes parser tests const-array-01.frag, const-array-03.frag,
const-array-04.frag, const-array-05.frag, though 03 and 04 generate the
wrong code.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken. The big changes
are:
* Add the ir_var_temporary variable mode
* Change the ir_variable constructor to take the mode as a
parameter and correctly specify the mode for all ir_varables.
* Change the linker to not cross validate ir_var_temporary
variables.
* Change the linker to pull all ir_var_temporary variables from
global scope into 'main'.
|
|
|
|
|
|
|
|
|
| |
The constant_expression_wrapper was already the only external API, and
much of the internal code used it anyway. Also, it wouldn't ever visit
non-rvalue ir_instructions, so using a visitor seemed a bit unnecessary.
This uses "ir_foo *ir = this;" lines to avoid code churn. These should
be removed.
|
|
|
|
|
| |
This prevents top-level callers from asking for the value of something
that is guaranteed not to have one.
|
|
|
|
|
|
| |
Give ir_function::parameter_lists_match_exist similar treatment. Make
the parameters const, and propogate the constness as far as it will
trivially go.
|
| |
|
|
|
|
|
|
|
| |
This is a big deal for debugging if nothing else ("what class is this
ir_instruction, really?"), but is also nice for avoiding building a
whole visitor or an if (node->as_whatever() || node->as_other_thing())
chain.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
The linker needs to use this function to get specific function signatures, but
it also needs to modify the returned signature. Since this method isn't itself
const (i.e., const this pointer), there is no value in making a const and
non-const version.
|
|
|
|
|
|
|
| |
This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined. As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
|
|
|
|
|
|
|
|
|
| |
There is no setter function, the getter returns a constant pointer,
and ir_function_signature::_function is private for a reason. The
only way to make a connection between a function and function
signature is via ir_function::add_signature. This helps ensure that
certain invariants (i.e., a function signature is in the list of
signatures for its _function) are met.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This will be used by the Mesa IR and likely most HW backends, as it
allows other optimizations to occur that might not otherwise.
Fixes glsl-vs-mat-sub-1, glsl-vs-mat-div-1.
|
|
|
|
| |
This is as opposed to returning the type of the base class of the hierarchy.
|
|
|
|
| |
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
|
|
|
|
|
| |
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
|
| |
|
|
|
|
|
|
|
| |
Fixes:
glsl-fs-bug25902
glsl-fs-sampler-numbering
glsl-lod-bias
|
|
|
|
|
| |
Adds a new constructor that takes an array of component values. Refactors
the meat of the two constructors to an init_mask method.
|
|
|