summaryrefslogtreecommitdiff
path: root/src/mesa
AgeCommit message (Collapse)Author
2010-08-04i965: Settle on printing our program debug to stdout.Eric Anholt
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.
2010-08-04ir_to_mesa: Print shader source and compiled IR under MESA_GLSL=dump.Eric Anholt
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.
2010-08-04glsl2: Add ir_assignment::write_mask and associated methodsIan Romanick
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.
2010-08-04ir_to_mesa: Clean up the mapping of samplers to Mesa's sampler uniforms.Eric Anholt
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.
2010-08-04mesa: Don't null deref looking for Mesa IR code at compile time.Eric Anholt
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.
2010-08-04glsl2: Skip talloc_parent in constant_expression of non-constant arrays.Eric Anholt
2010-08-02ir_to_mesa: Add support for 1.20 uniform initializers.Eric Anholt
Fixes: glsl-uniform-initializer-1 glsl-uniform-initializer-2 glsl-uniform-initializer-3 glsl-uniform-initializer-4 glsl1-GLSL 1.20 uniform array constructor
2010-08-02Initialize a couple of HasIndex2 fields on Mesa IR src regs.Eric Anholt
2010-08-02ir_to_mesa: Support for struct uniforms.Eric Anholt
Fixes glsl-uniform-struct.
2010-08-02ir_to_mesa: Add a constructor for ir_to_mesa_src_reg.Eric Anholt
This helps makes sure we don't miss any new fields, and makes totally uninitialized src_regs be PROGRAM_UNDEFINED.
2010-08-02Keep a local copy of the symbol name in the symbol tableIan Romanick
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.
2010-08-01ir_to_mesa: Add support for MESA_GLSL=log.Eric Anholt
This is the option that dumps shader source to files in the current directory.
2010-07-31glsl2: Add new tree grafting optimization pass.Eric Anholt
2010-07-30ir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB.Eric Anholt
2010-07-29ir_to_mesa: Don't emit a duplicate return at the end of a function.Eric Anholt
It was harmless, but ugly.
2010-07-28ir_to_mesa: Respect the driver if it rejects a shader.Eric Anholt
2010-07-28glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.Eric Anholt
Fixes: glsl-arb-fragment-coord-conventions
2010-07-28ir_to_mesa: Add remaining state variable (builtin uniforms) support.Eric Anholt
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
2010-07-27ir_to_mesa: Provide a restricted type size to _mesa_add_uniform.Eric Anholt
Fixes: glsl-uniform-out-of-bounds.
2010-07-27ir_to_mesa: Add support for array constants.Eric Anholt
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
2010-07-27glsl2: Make the dead code handler make its own talloc context.Eric Anholt
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.
2010-07-27mesa: Allow large temporary indices coming into the temporary reg allocator.Eric Anholt
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new compiler.
2010-07-27ir_to_mesa: Set the swizzle on constant struct src regs.Eric Anholt
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
2010-07-27ir_to_mesa: Fix stray "break" that broke functions of >1 argument.Eric Anholt
2010-07-27glsl2: Add optimization pass for algebraic simplifications.Eric Anholt
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).
2010-07-26ir_to_mesa: Fix up handling of void function returns.Eric Anholt
void functions have a type of glsl_type::void_type, not a null type.
2010-07-26ir_to_mesa: Actually allocate the right size for constant matrix temps.Eric Anholt
2010-07-26ir_to_mesa: Add support for structure constants.Eric Anholt
Fixes: TPPStreamCompiler::assignOperands
2010-07-26Merge remote branch 'origin/master' into glsl2Eric Anholt
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
2010-07-26ir_to_mesa: Flag when we use the address reg.Eric Anholt
Hardware backends will get angry otherwise.
2010-07-26i965: Fix reversed naming of the operations in compute-to-mrf optimization.Eric Anholt
Also fix up comments, so that the difference between the two passes is clarified.
2010-07-26i965: Clean up a few magic numbers to use brw_defines.h defs.Eric Anholt
2010-07-26i965: Use MIN2, MAX2 instead of rolling our own.Eric Anholt
2010-07-26i965: Fold the "is arithmetic" bit of 965 opcodes into the opcode list.Eric Anholt
2010-07-26i965: Remove some duped register size/count definitionsEric Anholt
2010-07-26i965: Move the GRF-to-MRF optimizations to brw_optimize.c.Eric Anholt
2010-07-26i965: Improve (i.e. remove) some grf-to-mrf unnecessary movesBenjamin Segovia
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
2010-07-26i965: Allow VS MOVs to use immediate constants.Eric Anholt
Clarifies program assembly, and with a little tweak to always use constant_map, we could cut down on constant buffer payload.
2010-07-23mesa: Fix Cygwin build with llvm enabled.Vinson Lee
On Cygwin locale_t in not available but 'llvm-config --cppflags' adds the compiler flag -D_GNU_SOURCE to the build.
2010-07-23gallium: Fix build with llvm installed in non-standard locationChristopher James Halse Rogers
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.
2010-07-23st/mesa: get rid of unneeded ureg_writemask()Brian Paul
2010-07-23st/mesa: fix bug in emit_adjusted_wpos()Brian Paul
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.
2010-07-23i965: Cleanly fail programs with unsupported array access.Eric Anholt
This should be more useful for developers and for bug triaging than just generating wrong code.
2010-07-23i965: Add support for VS relative addressing of temporary arrays.Eric Anholt
Fixes glsl-vs-arrays. Bug #27388.
2010-07-22ir_to_mesa: Fix the swizzles on record and array dereferences.Eric Anholt
Fixes: glsl1-struct (1) glsl1-struct (2) glsl1-struct (3) glsl1-struct (4)
2010-07-22glsl: remove invalid _mesa_problem() callBrian Paul
Fixes fd.o bug 29206.
2010-07-22ir_to_mesa: Pretty up the printing of MESA_GLSL=dumpEric Anholt
2010-07-22mesa: Only complain about an infinite loop in a swrast program once.Eric Anholt
Chances are, if one fragment looped badly, others will too, and debugging output gets overwhelmed by the looping complaints.
2010-07-22ir_to_mesa: Add support for MESA_GLSL=dump environment var.Eric Anholt
2010-07-22i965: Respect VS/VP point size result when enabled.Eric Anholt
Fixes glsl-vs-point-size.