| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should be the last bit of infrastructure changes before
generating GLSL IR for assembly shaders.
This commit leaves some odd code formatting in ir_to_mesa and brw_fs.
This was done to minimize whitespace changes / reindentation in some
loops. The following commit will restore formatting sanity.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Arrays are zero based. If the highest element accessed is 6, the
array needs to have 7 elements.
Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
|
|
|
|
| |
ES requires that a vertex shader and a fragment shader be present.
Fixes bugzilla #32214.
|
|
|
|
|
|
|
|
| |
This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions. The only known example of this, currently,
is the textureOffset functions.
This should never be used for globals.
|
| |
|
|
|
|
|
|
|
|
|
| |
From the AMD_conservative_depth spec:
If gl_FragDepth is redeclared in any fragment shader in a program, it
must be redeclared in all fragment shaders in that program that have
static assignments to gl_FragDepth. All redeclarations of gl_FragDepth in
all fragment shaders in a single program must have the same set of
qualifiers.
|
|
|
|
|
|
|
|
|
| |
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.
Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
|
|
|
|
|
|
|
| |
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.
Fixes piglit test glsl-fs-implicit-array-size-02.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
|
|
| |
These are already picked up by ir.h or glsl_types.h.
|
|
|
|
| |
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
|
|
|
|
| |
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Cause linking to fail if a global has mismatching invariant qualifiers.
See https://bugs.freedesktop.org/show_bug.cgi?id=30261
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously some shader input or outputs that hadn't received location
assignments could slip through. This could happen when a shader
contained user-defined varyings and was used with either
fixed-function or assembly shaders.
See the piglit tests glsl-[fv]s-user-varying-ff and
sso-user-varying-0[12].
NOTE: this is a candidate for the 7.9 branch.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously _LinkedShaders was a compact array of the linked shaders
for each shader stage. Now it is arranged such that each slot,
indexed by the MESA_SHADER_* defines, refers to a specific shader
stage. As a result, some slots will be NULL. This makes things a
little more complex in the linker, but it simplifies things in other
places.
As a side effect _NumLinkedShaders is removed.
NOTE: This may be a candidate for the 7.9 branch. If there are other
patches that get backported to 7.9 that use _LinkedShader, this patch
should be cherry picked also.
|
|
|
|
|
|
|
|
|
|
| |
This really amounts to just using the return value from
link_function_calls. All the work was being done, but the result was
being ignored.
Fixes piglit test link-unresolved-funciton.
NOTE: this is a candidate for the 7.9 branch.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Otherwise, we'll often end up with gl_TexCoord being 0 length, for
example. With ir_to_mesa, things ended up working out anyway, as long
as multiple implicitly-sized arrays weren't involved.
|
| |
|
|
|
|
|
|
|
|
|
| |
This increases the chance that GLSL programs will actually work.
Note that continues and returns are not yet lowered, so linking
will just fail if not supported.
Signed-off-by: Ian Romanick <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c.
In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.
However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
|
|
|
|
|
|
| |
Fixes an assert (min_version >= 110) which was no longer correct, and
also prohibits linking ES2 shaders with non-ES2 shaders. I'm not
positive this is correct, but the specification doesn't seem to say.
|
|
|
|
|
|
|
| |
Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.
This also fixes piglit test cases glsl-link-empty-prog-0[12].
|
|
|
|
| |
Fixes piglit test case glsl-array-varying-01.
|
|
|
|
|
|
|
|
|
|
| |
If two shaders contain variables declared with array types that have
the same base type but one is sized and the other is not, linking
should succeed. I'm not super pleased with the way this is
implemented, and I am more convinced than ever that we need more
linker tests. We especially need "negative" tests.
Fixes bugzilla #29697 and piglit test glsl-link-array-01.
|
|
|
|
|
|
| |
Also rename it to "is_builtin" for consistency.
Signed-off-by: Ian Romanick <[email protected]>
|
|
|
|
| |
Fixes: glsl-fs-uniform-array-4.
|
|
|
|
|
| |
This is a step towards making the linker code usable as our uniform
setup, instead of having it wedged into ir_to_mesa.cpp.
|
|
|
|
| |
Make glsl include only main/core.h from core mesa.
|
|
|
|
| |
Fixes: glsl-vs-position-outval. Bug #28138 (regnum online)
|
|
|
|
| |
Fixes glsl-getactiveuniform-array-size.
|
|
|
|
| |
Fixes double-free since the fix to free all of the uniform list.
|
| |
|
|
|
|
| |
Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
|
| |
|
|
|
|
|
| |
These are passes that we expect all codegen to be happy with. The
other lowering passes for Mesa IR are moved to the Mesa IR generator.
|
|
|
|
|
|
|
| |
If gl_Vertex is not used in the shader, then attribute location 0 is
available for use.
Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes glean shaderAPI.
|
|
|
|
|
|
|
|
|
| |
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
|