summaryrefslogtreecommitdiff
path: root/src/mesa/program/ir_to_mesa.cpp
AgeCommit message (Collapse)Author
2010-08-29ir_to_mesa: Initialize variable in ir_to_mesa_visitor::visit.Vinson Lee
Fixes piglit glsl-fs-loop valgrind uninitialized value error on softpipe and llvmpipe.
2010-08-26ir_to_mesa: Don't assume that an ir_dereference_array is of a variable.Eric Anholt
Fixes: glsl-array-bounds-02 (software) glsl-array-bounds-04 glsl-array-bounds-06 (software) glsl-array-bounds-08
2010-08-25ir_to_mesa: Add support for samplers in structures.Eric Anholt
Fixes: glsl-fs-uniform-sampler-struct glsl-fs-sampler-numbering-3 Bug #29690
2010-08-25ir_to_mesa: Convert this code to using linker.cpp's uniform locations.Eric Anholt
Fixes: glsl-fs-uniform-array-4.
2010-08-25mesa: Remove the "Used" flag in gl_program_parameter.Eric Anholt
This was in place for uniform handling, but nothing actually needs the value now, since presence in a parameter list indicates that the uniform was used as far as the linker was concerned.
2010-08-25ir_to_mesa: set IndirectRegisterFilesMarek Olšák
This fixes relative addressing of temporaries (and maybe others) in all gallium drivers. Acked on irc by Eric Anholt.
2010-08-24glsl: Set up uniform initializers by walking the shaders after linking.Eric Anholt
Previously, uniform initializers were handled by ir_to_mesa as it made its Parameters list. However, uniform values are global to all shaders, and the value set in one Parameters list wasn't propagated to the other gl_program->Parameters lists. By going back through the general Mesa uniform handling, we make sure that all gl_programs get updated values, and also successfully separate uniform initializer handling from ir_to_mesa gl_program generation. Fixes: glsl-uniform-initializer-5.
2010-08-23mesa: Add new ir_unop_any() expression operation.Eric Anholt
The previous any() implementation would generate arg0.x || arg0.y || arg0.z. Having an expression operation for this makes it easy for the backend to generate something easier (DPn + SNE for 915 FS, .any predication on 965 VS)
2010-08-23ir_to_mesa: Implement f2b by comparing the arg to 0, not the result.Eric Anholt
Fixes: glsl-fs-any
2010-08-23ir_to_mesa: Fix constant array handling to return the temp we created.Eric Anholt
We ended up returning CONST[loc] rather than TEMP[loc2]. Things would *usually* end up working out OK, since the constants often ended up getting allocated to CONST[loc..loc+columns] with no swizzle. But for the case where the contigous temporary copy of the swizzled constant vec4 args was actually needed, we'd end up reading some other constant values, possibly including ones not actually allocated. Fixes: glsl-varying-mat3x2.
2010-08-22mesa: Initialize member variables in ir_to_mesa_src_reg constructor.Vinson Lee
The default constructor did not initialize some member variables.
2010-08-21mesa: Initialize variables in mesa_src_reg_from_ir_src_reg.Vinson Lee
2010-08-20glsl: Remove bogus "ambient" field from vec4 gl_TextureEnvColor.Kenneth Graunke
2010-08-20glsl: add missing ambient field to gl_LightModelLuca Barbieri
Again, this is a one-element struct that was incorrectly missing the field.
2010-08-20glsl: don't crash if a field is specified for a non-struct uniformLuca Barbieri
This was triggered by the previous bug, but is a separate problem in the general sense.
2010-08-20glsl: add missing sceneColor field to gl_{Front, Back}LightModelProductLuca Barbieri
According to both GLSL 1.20 and 4.0, these are a struct with one field called "sceneColor". Fixes a crash on loading in FlightGear.
2010-08-18mesa: Fix the whining for link failures to actually be under MESA_GLSL=dump.Eric Anholt
2010-08-18ir_to_mesa: Fix leak by improper freeing of a uniform list.Eric Anholt
2010-08-18ir_to_mesa: Don't leak the whole linked assembly program.Eric Anholt
2010-08-18ir_to_mesa: Fix leak of set_branchtargets temp data.Eric Anholt
2010-08-18ir_to_mesa: Stop leaking the ir_instruction * annotation of our compile.Eric Anholt
2010-08-18mesa: Free old linked shaders when relinking new shaders.Eric Anholt
2010-08-18ir_to_mesa: Free the ir_to_mesa temporary storage when we're done.Eric Anholt
2010-08-18mesa: Hang the compiled shader off the shader->ir, not the shader.Eric Anholt
Otherwise, with repeated program recompile, we never free the results of the previous compile.
2010-08-18mesa: Make MESA_GLSL=dump include when compile/link fails, and the info log.Eric Anholt
2010-08-17ir_to_mesa: Allow ir_return in main().Eric Anholt
I didn't expect that this would really work, but it turns out there are shaders in the wild that do it. Fixes: (with swrast) glsl-fs-main-return glsl-vs-main-return
2010-08-17ir_to_mesa: Fix implementation of ir_binop_equal, ir_binop_notequal.Eric Anholt
These binops are the vector-to-bool comparisons, not vec-to-bvec. We likely want both operations avilable as expression, since 915 and 965 FS naturally does the vector version, while 965 VS can also naturally do the scalar version. However, we can save that until later. Fixes: glsl-fs-vec4-operator-equal.shader_test glsl-fs-vec4-operator-notequal.shader_test glsl-vs-vec4-operator-equal.shader_test glsl-vs-vec4-operator-notequal.shader_test
2010-08-17mesa: Dump shader source before validating the shader.Eric Anholt
This will make extracting source to produce minimal testcases for shader compile issues easier.
2010-08-16ir_to_mesa: Silence unused variable warningsIan Romanick
2010-08-16ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *)Ian Romanick
2010-08-16ir_to_mesa: Support texture rectangle targetsIan Romanick
2010-08-14mesa: Silence gcc warning "control reaches end of non-void function".José Fonseca
2010-08-14mesa: Silence gcc warning "missing initializer for member".José Fonseca
2010-08-13glsl2: Move ir_to_mesa handling to driver CompileShader and LinkShader hooks.Eric Anholt
This lets drivers override ir_to_mesa with their own codegen, or at least have a native alternative.
2010-08-13glsl2: Move the common optimization passes to a helper function.Eric Anholt
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.
2010-08-12glsl2: Use Elements from main/compiler.h instead of open-codingIan Romanick
2010-08-09glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))Eric Anholt
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.
2010-08-09glsl2: Add constant propagation.Eric Anholt
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.
2010-08-06glsl2: Move gl_program->InputsRead/OutputsWritten setting to an ir pass.Eric Anholt
This lets us handle arrays much better than trying to work backwards from assembly. Fixes fbo-drawbuffers-maxtargets on swrast (i965 needs loop unrolling)
2010-08-06ir_to_mesa: Add support for sampler arrays.Eric Anholt
Support for samplers in general is still incomplete -- anything in a uniform struct will still be broken. But that doesn't appear to be any different from master. Fixes: glsl-fs-uniform-sampler-array.shader_test
2010-08-06glsl2: Don't assert in a couple of places when encountering sampler arrays.Eric Anholt
Fixes glean shaderAPI.
2010-08-06ir_to_mesa: Give the expected size for _mesa_add_attribute().Eric Anholt
Fixes a failure in glean shaderAPI.
2010-08-05ir_to_mesa: Handle texture-array samplersIan Romanick
Fixes piglit test array_texture.
2010-08-05glsl2: Add a pass to convert exp and log to exp2 and log2.Eric Anholt
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
2010-08-05ir_to_mesa: Don't do function inlining until linking.Eric Anholt
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).
2010-08-05glsl2: Don't try to dump GLSL IR for a shader that didn't compile.Eric Anholt
2010-08-05ir_to_mesa: Remove debug force-enablement of EmitNoIfs.Eric Anholt
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.