| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.
However, if breaks are not lowered, they tend to appear at the beginning, so
add support for a conditional break anywhere.
Signed-off-by: Luca Barbieri <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
|
|
|
|
|
|
|
| |
Found this bug by code inspection. Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch. However, the code actually looked at the
last instruction in the "then" branch twice.
|
| |
|
|
|
|
|
|
|
|
| |
If you used a constant array index to access the matrix, we'd flag a
bunch of wrong inputs/outputs as being used because the index was
multiplied by matrix columns and the actual used index was left out.
Fixes glsl-mat-attribute.
|
|
|
|
|
|
| |
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass
Fixes piglit tests glsl-functions-5 and glsl-functions-6.
|
|
|
|
|
|
|
|
|
| |
Raise error if a sampler array is indexed with a non-constant expression.
From section 4.1.7 of the GLSL 1.30 spec:
"Samplers aggregated into arrays within a shader (using square
brackets [ ]) can only be indexed with integral constant
expressions [...]."
|
|
|
|
|
|
|
|
|
| |
That's what I get for not running piglit before pushing.
Don't try to patch types of unsized arrays when linking fails.
Don't try to patch types of unsized arrays that are shared between
shader stages.
|
|
|
|
|
|
|
| |
Fixes piglit test case glsl-vec-array (bugzilla #31908).
NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Types of declared variables and their initializer must match excatly
except for unsized arrays. Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms. Now that type
is explicitly copied unconditionally.
Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
|
|
| |
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.
NOTE: This is a candidate for the 7.9 branch.
|
| |
|
|
|
|
|
|
|
|
| |
Fixes glslparsertest defined-01.vert.
Reported-by: José Fonseca <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
Acked-by: Carl Worth <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original lazy built-in importing patch did not add the newly created
function to the symbol table, nor actually emit it into the IR stream.
Adding it to the symbol table is non-trivial since importing occurs when
generating some ir_call in a nested scope. A new add_global_function
method, backed by new symbol_table code in the previous patch, handles
this.
Fixes bug #32030.
|
|
|
|
| |
A future commit will use the newly created function in a second place.
|
|
|
|
| |
In the form (constant type ((field1 value) (field2 value) ...))
|
|
|
|
| |
Fixes glsl-array-uniform.
|
|
|
|
|
|
| |
Cause linking to fail if a global has mismatching invariant qualifiers.
See https://bugs.freedesktop.org/show_bug.cgi?id=30261
|
|
|
|
|
|
| |
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
|
| |
|
| |
|
|
|
|
|
| |
This is essentially Luca's commit message, but placed at the top of the
file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.
Also, lower_jumps incorrectly handled conditional discards - it would
unconditionally truncate all code after the discard. Rather than fixing
the bug, simply remove the code.
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
|
|
| |
This should allow lower_if_to_cond_assign to work in the presence of
discards, fixing bug #31690 and likely #31983.
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
| |
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, IR for a linked shader was allocated directly out of the
gl_shader object - meaning all of it lived as long as the shader.
Now, IR is allocated out of a temporary context, and any -live- IR is
reparented/stolen to (effectively) the gl_shader. Any remaining IR can
be freed.
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
| |
Now that we only import built-in signatures that are actually used,
printing them is reasonable.
|
|
|
|
|
|
|
|
| |
This makes a very simple 1.30 shader go from 196k of memory to 9k.
NOTE: This -may- be a candidate for the 7.9 branch, as the benefit is
substantial. However, it's not a simple change, so it may be wiser to
wait for 7.10.
|
|
|
|
| |
This allows us to reuse some code and will be useful later.
|
|
|
|
| |
Fixes glsl-mat-mul-1.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were trying to emit a single ir_expression to compare the whole
thing. The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass). Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.
Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
|
|
|
|
|
|
| |
This doesn't cover all expressions or all operand types, but it will
complain if you overreach and it allows for much greater slack on the
programmer's part.
|
| |
|
| |
|
|
|
|
| |
NOTE: This is candidate for the 7.9 branch.
|
|
|
|
| |
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the standalone compiler tries to do function inlining before
linking shaders (including linking against the built-in functions).
This resulted in the built-in function _prototypes_ being inlined rather
than the actual function definition.
This is only known to fix a bug in the standalone compiler; most
programs should be unaffected. Still, it seems like a good idea.
NOTE: This is a candidate for the 7.9 branch.
|
|
|
|
|
|
| |
Hardware pretty commonly has saturate modifiers on instructions, and
this can be used in codegen to produce those, without everyone else
needing to understand clamping other than min and max.
|
| |
|
| |
|
|
|
|
|
|
|
| |
When the semantics of write masks in assignments were changed, this
code was not correctly updated.
Fixes piglit test glsl-mat-from-vec-ctor-01.
|
|
|
|
|
|
|
| |
This should save on the overhead of tree-walking and provide a
convenient place to add more instruction lowering in the future.
Signed-off-by: Ian Romanick <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The vector operator collects 2, 3, or 4 scalar components into a
vector. Doing this has several advantages. First, it will make
ud-chain tracking for components of vectors much easier. Second, a
later optimization pass could collect scalars into vectors to allow
generation of SWZ instructions (or similar as operands to other
instructions on R200 and i915). It also enables an easy way to
generate IR for SWZ instructions in the ARB_vertex_program assembler.
|
| |
|
| |
|
|
|
|
| |
This may grow in the near future.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The operate just like ir_unop_sin and ir_unop_cos except that they
expect their inputs to be limited to the range [-pi, pi]. Several
GPUs require this limited range for their sine and cosine
instructions, so having these as operations (along with a to-be-written
lowering pass) helps this architectures.
These new operations also matche the semantics of the
GL_ARB_fragment_program SCS instruction. Having these as operations
helps in generating GLSL IR directly from assembly fragment programs.
|
|
|
|
|
| |
This eliminates the need in some cames to validate that an rvalue is
an ir_constant before checking to see if it's 0 or 1.
|
|
|
|
|
|
|
| |
Fix this GCC warning.
ir.cpp: In static member function
'static unsigned int ir_expression::get_num_operands(ir_expression_operation)':
ir.cpp:199: warning: control reaches end of non-void function
|