| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Optimizations at compile time should generally be done with the goal
of reducing instruction count so that other work, particularly
linking, is less time-consuming if the shader is used multiple times.
However, function inlining increases instruction count for the inlined
function bodies without removing the original function body, since we
don't know if it will be used at link time or not.
Reduces the runtime of linking and executing a Yo Frankie fragment
shader from 0.9 seconds to 0.5 seconds (-45.9%, +/- 2.2%, n=5).
|
| |
|
| |
|
|
|
|
|
|
| |
Mixing stderr (_mesa_print_program, _mesa_print_instruction,
_mesa_print_alu) with stdout means that when writing both to a file,
there isn't a consistent ordering between the two.
|
|
|
|
|
|
|
| |
While the Mesa IR dumping includes some corresponding GLSL IR for
correlating Mesa IR to GLSL IR, it doesn't completely express it.
This printing includes things like variable declarations and control
flow structure that is hard to read otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes:
glsl-uniform-initializer-1
glsl-uniform-initializer-2
glsl-uniform-initializer-3
glsl-uniform-initializer-4
glsl1-GLSL 1.20 uniform array constructor
|
| |
|
|
|
|
| |
Fixes glsl-uniform-struct.
|
|
|
|
|
| |
This helps makes sure we don't miss any new fields, and makes totally
uninitialized src_regs be PROGRAM_UNDEFINED.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This is the option that dumps shader source to files in the current
directory.
|
| |
|
| |
|
|
|
|
| |
It was harmless, but ugly.
|
| |
|
|
|
|
|
| |
Fixes:
glsl-arb-fragment-coord-conventions
|
|
|
|
|
|
|
|
|
|
| |
Fixes:
glsl1-GL state variable reference (diffuse product)
glsl1-GL state variable reference (gl_FrontMaterial.ambient)
glsl1-GL state variable reference (gl_LightSource[0].diffuse)
glsl1-GL state variable reference (point attenuation)
glsl1-GL state variable reference (point size)
glsl1-linear fog
|
|
|
|
|
| |
Fixes:
glsl-uniform-out-of-bounds.
|
|
|
|
|
|
|
|
|
| |
Fixes:
glsl1-GLSL 1.20 array constructor 1
glsl1-GLSL 1.20 array constructor 2
glsl1-GLSL 1.20 array.length()
glsl1-GLSL 1.20 const array constructor 1
glsl1-GLSL 1.20 const array constructor 2
|
|
|
|
|
| |
This way, we don't need to pass in a parse state, and the context
doesn't grow with the number of passes through optimization.
|
|
|
|
|
| |
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new
compiler.
|
|
|
|
| |
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
|
| |
|
|
|
|
|
|
| |
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*. glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
|
|
|
|
| |
void functions have a type of glsl_type::void_type, not a null type.
|
| |
|
|
|
|
|
| |
Fixes:
TPPStreamCompiler::assignOperands
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.
Conflicts:
src/mesa/Makefile
src/mesa/main/shaderapi.c
src/mesa/main/shaderobj.h
|
| |
| |
| |
| |
| | |
Also fix up comments, so that the difference between the two passes is
clarified.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Several routines directly analyze the grf-to-mrf moves from the Gen
binary code. When it is possible, the mov is removed and the message
register is directly written in the arithmetic instruction
Also redundant mrf-to-grf moves are removed (frequently for example,
when sampling many textures with the same uv)
Code was tested with piglit, warsow and nexuiz on an Ironlake
machine. No regression was found there
Note that the optimizations are *deactivated* on Gen4 and Gen6 since I
did test them properly yet. No reason there are bugs but who knows
The optimizations are currently done in branch free programs *only*.
Considering branches is more complicated and there are actually two
paths: one for branch free programs and one for programs with branches
Also some other optimizations should be done during the emission
itself but considering that some code is shader between vertex shaders
(AOS) and pixel shaders (SOA) and that we may have branches or not, it
is pretty hard to both factorize the code and have one good set of
strategies
|
| |
| |
| |
| |
| | |
Clarifies program assembly, and with a little tweak to always use
constant_map, we could cut down on constant buffer payload.
|
| |
| |
| |
| |
| | |
On Cygwin locale_t in not available but 'llvm-config --cppflags' adds
the compiler flag -D_GNU_SOURCE to the build.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The es1, es2 and gl state trackers include draw_pipe.h, which includes
the llvm headers if MESA_LLVM is true, so we also need to add the
llvm seachpaths.
Similarly, gallivm and other gallium drivers need LLVM_CFLAGS to build when enabled.
Also fix xorg drivers, they didn't include LDFLAGS.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we bias x,y we still need to pass through z,w in case the shader
reads gl_FragCoord.z or .w.
Fixes fd.o bug 29183 (piglit glsl-bug-22603).
NOTE: This is a candidate for the 7.8 branch.
|
| |
| |
| |
| |
| | |
This should be more useful for developers and for bug triaging than
just generating wrong code.
|
| |
| |
| |
| | |
Fixes glsl-vs-arrays. Bug #27388.
|
| |
| |
| |
| | |
Fixes fd.o bug 29206.
|
| |
| |
| |
| | |
Fixes glsl-vs-point-size.
|
| |
| |
| |
| |
| |
| | |
This has confused me twice now. It's a fixed width of 4 (usually a
region description of <4,4,1>), not 1. If it was 1, we'd have been
skipping all over register space.
|
| | |
|