| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.
We apparently don't yet have a test case that allowed valgrind to find
this bug for us, but valgrind found a similar problem in the other
parser, so we fix this one as well.
|
|
|
|
| |
After making a minor change to the .y file.
|
|
|
|
|
|
|
|
| |
Since we have a custom structure for YYLTYPE locations, we need to use
an %initial-action directive to avoid triggering use of uninitialized
memory when, for example, printing error messages.
Thanks to valgrind for noticing this bug.
|
|
|
|
|
|
|
|
| |
It's rather easy to produce two constant multiplies separated by other
multiplies while writing a BRDF shader, and non-obvious enough in the
resulting codegen that I didn't catch it in my demo code until just
recently. Cuts 3 965 instructions from my demo (<1%), and 20 from
glsl-fs-raytrace (1.3%).
|
|
|
|
|
|
| |
All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR. This allows
some subtract of subtract to get removed in ir_algebraic.
|
|
|
|
|
|
|
|
| |
Whereas constant folding evaluates constant expressions at rvalue
nodes, constant propagation tracks constant components of vectors
across execution to replace (possibly swizzled) variable dereferences
with constant values, triggering possible constant folding or reduced
variable liveness.
|
|
|
|
|
|
|
|
|
| |
This lets us track copies across basic block boundaries. The loop
doesn't get a filled out list of available copies into it yet, though.
glsl-fs-raytrace drops from 585 to 535 Mesa IR instructions out of the
compiler, and it appears that Yo Frankie's largest shaders decrease in
Mesa IR count by about 10% as well.
|
| |
|
|
|
|
| |
Some signatures were being generated with the wrong function name.
|
|
|
|
|
| |
It was being incorrectly added as gl_DepthRangeParameters, which is the
type name, not the variable name.
|
| |
|
|
|
|
|
|
| |
Currently only ir_binop_equal and ir_binop_nequal are supported, but
soon all of the relational operators will be added. Making this
change now will simplify those commits.
|
|
|
|
| |
to GLSL spec (and Win7 ATI drivers do complain about that)
|
| |
|
|
|
|
|
| |
glsl-fs-raytrace goes from 620 Mesa IR instructions out of the
compiler to 585.
|
| |
|
|
|
|
| |
Fixes glsl-fs-function-samplers.
|
| |
|
|
|
|
|
|
|
| |
This lets us handle arrays much better than trying to work backwards
from assembly.
Fixes fbo-drawbuffers-maxtargets on swrast (i965 needs loop unrolling)
|
|
|
|
|
|
|
| |
Previously, we'd replace an argument of mysampler[2] with a plain
reference to mysampler by using the cloning hash table. Instead, use
a visitor to clone whatever complicated sampler dereference into the
sampler parameter derefs in the inlined function body.
|
|
|
|
| |
Fixes glean shaderAPI.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously some sampler types were duplicated in GLSL 1.30 and
GL_EXT_texture_array. This resulted in not being able to find the
built-in sampler functions when the extension was used. When the
built-in functions were compiled, they bound to the 1.30 version.
This caused a type mismatch when trying to find the function. It also
resulted in a confusing error message:
0:0(0): error: no matching function for call to `texture2DArray(sampler2DArray, vec3)'
0:0(0): error: candidates are: vec4 texture2DArray(sampler2DArray, vec3)
0:0(0): error: vec4 texture2DArray(sampler2DArray, vec3, float)
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want. This also lets the multiplication
coefficients in there get constant-folded, possibly.
Fixes:
glsl-fs-log
|
|
|
|
|
|
|
|
| |
Fixes use-before-decl in glslparsertest shaders.
Fixes:
CorrectFull.frag
CorrectModule.frag
|
|
|
|
|
|
| |
I'd missed putting in the actual "find structures to split" part, so
most of the code didn't do anything. I was running on too large of an
app and assuming the lack of progress was elsewhere.
|
| |
|
|
|
|
|
|
|
| |
This doesn't do anything if your structure goes through an uninlined
function call or if whole-structure assignment occurs. As such, the
impact is limited, at least until we do some global copy propagation
to reduce whole-structure assignment.
|
|
|
|
|
|
|
|
|
|
|
| |
The HV doesn't descend into ir_variable, which is generally a good
thing (allowing one to distinguish between variable declarations and
refs), but here we never saw tree grafting opportunities killed
because we were looking for the ir_variable child of a dereference to
get visited.
Fixes:
glsl1-function call with inout params
|
|
|
|
|
| |
Fixes:
glsl-deadcode-varying.
|
|
|
|
|
|
|
|
| |
This showed up since the disabling of inlining at compile time, which
I apparently didn't regenerate piglit summary for.
Fixes:
glsl-deadcode-call.
|
| |
|
|
|
|
|
|
|
|
|
| |
For a shader involving many small functions, this avoids running
optimization across all of them after they've been inlined
post-linking.
Reduces the runtime of linking and running a fragment shader from Yo
Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
|
|
|
|
|
|
|
|
|
| |
We wouldn't want to go rewriting dereferences to variables to point at
the same variable it did before. While I didn't find a way to trigger
that, a shader in Yo Frankie managed to produce a self-assignment by
passing a constant to a function doing self assignment like this.
Cleans up the IR for glsl-deadcode-self-assign.shader_test
|
|
|
|
|
| |
Fixes glcpp test cases 073 and 074, as well as piglit test
xonotic-vs-generic-diffuse.vert.
|
| |
|
|
|
|
| |
The original intention was to use #ifdef.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I introduced this for ir_dead_code to distinguish function parameter
outvals from varying outputs. Only, since ast_to_hir's
current_function is unset when setting up function parameters (they're
needed for making the function signature in the first place), all
function parameter outvals were marked as shader outputs anyway. This
meant that an inlined function's cloned outval was marked as a shader
output and couldn't be dead-code eliminated. Instead, since
ir_dead_code doesn't even look at function parameters, just use
var->mode.
The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from
725 instructions to 636.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Previously the in-line matrix and vector constructors would generate
swizzles in the LHS. The code is actually more clear if it just
generates the masked assignments instead of relying on the
ir_assignment constructor to convert the swizzles to write masks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace swizzles on the LHS with additional swizzles on the RHS and a
write mask in the assignment instruction. As part of this add
ir_assignment::set_lhs. Ideally we'd make ir_assignment::lhs private
to prevent erroneous writes, but that would require a lot of code
butchery at this point.
Add ir_assignment constructor that takes an explicit write mask. This
is required for ir_assignment::clone, but it can also be used in other
places. Without this, ir_assignment clones lose their write masks,
and incorrect IR is generated in optimization passes.
Add ir_assignment::whole_variable_written method. This method gets
the variable on the LHS if the whole variable is written or NULL
otherwise. This is different from
ir->lhs->whole_variable_referenced() because the latter has no
knowledge of the write mask stored in the ir_assignment.
Gut all code from ir_to_mesa that handled swizzles on the LHS of
assignments. There is probably some other refactoring that could be
done here, but that can be left for another day.
|
| |
|
| |
|
| |
|