Age | Commit message (Collapse) | Author |
|
|
|
Also implement a reverse-lookup function for use in the IR reader.
|
|
|
|
Unfortunately, we still have two kinds of matching - one, with implicit
conversions (for use in calls) and another without them (for finding a
prototype to overwrite when processing a function body). This commit
does not attempt to coalesce the two.
|
|
|
|
A new static version takes an ir_expression_operation enum, and the
original non-static version now uses it. This will make it easier to
read operations (where the ir_expression doesn't yet exist).
|
|
|
|
|
|
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.
|
|
This pass only works on assignments where the variable is never
referenced. There is no code flow analysis, so it can't do a better
job of avoiding redundant assignments.
For now, the optimizer only does do_dead_code_unlinked(), so it won't
trim the builtin variable list or initializers outside of the scope of
functions. This is because we don't have the visibility into other
functions that might get linked in in order to eliminate work on
global variables.
|
|
This will be important to optimization passes. We don't want to
dead-code eliminate writes to out varyings, or propagate uninitialized
values of uniforms.
|
|
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant. However, it does remove 59 lines
from the printout of CorrectParse2.vert.
|
|
|
|
|
|
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
|
|
|
|
Using '#extension foo: warn' instructs the compiler to generate a
warning when some feature of the extension 'foo' is used. This patch
adds some infrastructure needed to support that for variables.
Similar changes will be needed for types and built-in functions.
|
|
|
|
|
|
This touches a lot of files because everything derived from ir_visitor
has to be updated. This is the primary disadvantage of the visitor pattern.
|
|
|
|
Fixes CorrectParse1.frag and makes for a ton of folding in
CorrectParse2.frag.
|
|
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is.
This causes the following tests to pass:
glslparsertest/glsl2/array-09.vert
glslparsertest/glsl2/array-13.vert
|
|
Fixes constructor-09.glsl and CorrectParse2.frag.
|
|
|
|
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert.
Regresses parser3.frag which was failing for the wrong reason.
|
|
|
|
|
|
For unsized arrays, we can't flag out-of-bounds accesses until the
array is redeclared with a size. Track the maximum accessed element
and generate an error if the declaration specifies a size that would
cause that access to be out-of-bounds.
This causes the following tests to pass:
glslparsertest/shaders/array10.frag
|
|
|
|
|
|
|
|
|
|
ir_function_signature now has a pointer back to the ir_function that owns it.
|
|
Currently only works for constants. The rest will be added later.
|
|
The following tests now pass:
glslparsertest/shaders/if1.frag
glslparsertest/shaders/if2.frag
The following tests that used to pass now fail. It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.
shaders/glsl-unused-varying.frag
shaders/glsl-fs-sqrt-branch.frag
|
|
|
|
Fixes swizzle2.frag.
|
|
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.
|
|
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.
|
|
|
|
This should fix tests trying to assign to builtin "in" variables, and
will also be relied on for post_inc/dec handling.
|
|
This will make ast_to_hir for inc/dec easier.
|
|
|
|
|
|
|
|
|
|
Also turn generate_swizzle into a static "create" method of the new
class; we'll want to use it for the IR reader as well.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
These should work well even in a non-flat IR hierarchy.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|