| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Calling exit() on a memory failure probably made sense for the
standalone preprocessor, but doesn't seem too appealing as part of
the GL library. Also, we don't use it in the main compiler.
|
| |
|
| |
|
|
|
|
|
|
| |
Mesa will do the mapping at _mesa_add_sampler() time. Fixes assertion
failures in debug builds, which might have caught real problems with
multiple samplers linked in a row.
|
|
|
|
|
|
| |
Instead of using a linker-assigned location (since samplers don't
actually take up uniform space, being a link-time choice), use the
sampler's varaible pointer as a hash key.
|
|
|
|
|
|
|
| |
The new compiler doesn't generate Mesa IR at compile time, and that
compile time code previously wouldn't have reflected the link time
code that actually got used. But do dump the info log of the compile
regardless.
|
| |
|
|
|
|
|
|
|
| |
In most cases, we needed to be reparenting the cloned IR to a
different context (for example, to the linked shader instead of the
unlinked shader), or optimization before the reparent would cause
memory usage of the original object to grow and grow.
|
|
|
|
| |
Fixes unset ir_type after inlining.
|
|
|
|
|
|
|
|
|
| |
An unnamed variable in a prototype will have a NULL ->name, so don't
worry about storage then.
Fixes:
CorrectFunction1.vert
CorrectParse1.frag
|
|
|
|
|
| |
ir_variable always strdups the incoming name so that it matches the
lifetime of the ir_variable.
|
|
|
|
|
| |
I take back the bad things I've said about the signed/unsigned
comparison warning now.
|
|
|
|
|
|
|
|
|
| |
Fixes:
glsl-uniform-initializer-1
glsl-uniform-initializer-2
glsl-uniform-initializer-3
glsl-uniform-initializer-4
glsl1-GLSL 1.20 uniform array constructor
|
|
|
|
|
| |
We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.
|
| |
|
|
|
|
| |
Fixes glsl-uniform-struct.
|
|
|
|
|
| |
This helps makes sure we don't miss any new fields, and makes totally
uninitialized src_regs be PROGRAM_UNDEFINED.
|
|
|
|
|
|
| |
This is a zero-ing function, (like calloc), to avoid bugs due to
accessing uninitialized values. Thanks to valgrind for noticing the
use of uninitialized values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The symbol_header structure that tracks symbols with a particular name
may have a different (longer) life time than the symbols it tracks.
Not keeping a local copy of the name can lead to use-after-free
errors. For example, the following sequence would trigger such an
error:
char *copy = strdup(name);
_mesa_symbol_table_push_scope(st);
_mesa_symbol_table_add_symbol(st, 0, name, NULL);
_mesa_symbol_table_pop_scope(st);
free(name);
_mesa_symbol_table_find_symbol(st, 0, copy);
With this change, the symbol table keeps a local copy of the name that
has the same life time as the symbol_header for that name. This
resolves some use-after-free errors with built-in functions in the
GLSL compiler.
|
| |
|
| |
|
|
|
|
| |
Fixes glsl-fs-tan-1.
|
| |
|
|
|
|
| |
We use vector ir_unop_not to implement builtin not(), and that seems fine.
|
|
|
|
| |
Fixes glsl-floating-constant-120.
|
|
|
|
| |
Fixes intermittent failure in glsl-arb-fragment-coord-conventions.
|
|
|
|
|
|
| |
The non-named parameter grammar understandably doesn't set the
identifier field. Fixes intermittent failures about void main(void)
{} having a named void parameter.
|
| |
|
| |
|
| |
|
|
|
|
| |
The non-array path of glsl_parser.ypp wasn't setting is_array to false.
|
|
|
|
| |
Fixes glsl-mat-110.
|
|
|
|
|
| |
This is the option that dumps shader source to files in the current
directory.
|
|
|
|
| |
gcc and mesa master agree that this is OK.
|
|
|
|
|
| |
Linking brings in inlining of builtins, so we weren't catching the
(rcp(/sqrt(x)) -> rsq(x)) without it.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So many problems here. One is that we can't do the quadrant handling
for all the channels at the same time, so we call the float(y, x)
version multiple times. I'd also left out the x == 0 handling. Also,
the quadrant handling was broken for y == 0, so there was a funny
discontinuity on the +x side if you plugged in obvious values to test.
I generated the atan(float y, float x) code from a short segment of
GLSL and pasted it in by hand. It would be nice to automate that
somehow.
Fixes:
glsl-fs-atan-1
glsl-fs-atan-2
|
|
|
|
|
|
| |
This prevents using uninitialized data in _msea_glsl_error in some
cases, (including at least 6 piglit tests). Thanks to valgrind for
pointing out the problem!
|
| |
|
|
|
|
|
|
| |
Otherwise, ir_function_inlining will see the body of the function from
the unlinked version of the shader, which won't have had the lowering
passes done on it or linking's variable remapping.
|
|
|
|
| |
Fixes a valgrind error.
|
|
|
|
| |
Fixes a valgrind error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem with doing it on the way in is that for a function with
multiple early returns, we'll move an outer block in, then restart the
pass, then move the two inside returns out, then never move outer
blocks in again because the remaining early returns are inside an else
block and they don't know that there's a return just after their
block. By going inside-out, we get the early returns stacked up so
that they all move out with a series of
move_returns_after_block().
Fixes (on i965):
glsl-fs-raytrace-bug27060
glsl-vs-raytrace-bug26691
|
|
|
|
|
|
|
|
|
| |
This catches a few remaining functions that weren't getting inlined,
generally operating on global or out variables and using an early
return to skip work when possible.
Fixes for i965:
glsl1-function with early return (3)
|