aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program
Commit message (Collapse)AuthorAgeFilesLines
* ir_to_mesa: Handle loops with loop controls setIan Romanick2010-09-031-4/+44
| | | | | | The downside of our talloc usage is that we can't really make static (i.e., not created with new) instances of our IR types. This leads to a lot of unnecessary dynamic allocation in this patch.
* mesa: Fix printf-like warning.Vinson Lee2010-09-022-2/+2
|
* mesa: fix code generation for ir_unop_sqrtBrian Paul2010-09-021-2/+3
| | | | | | | The CMP instruction needed to be flipped to properly handle operand==0. Fixes fd.o bug 29923.
* ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.Eric Anholt2010-09-011-345/+291
| | | | | | | | | | | | | | | | | | Like the constant handling and the handling of other uniforms, we add the whole thing to the Parameters, avoiding messy, incomplete logic for adding just the elements of a builting uniform that get used. This means that a driver that relies only on ParameterValues[] for its parameters will have an increased parameter load, but drivers generally don't do that (since they have other params they need to handle, too). Fixes glsl-fs-statevar-call (testcase for Ember). Bug #29687. Regresses glsl-vs-array-04 on 965. Thanks to a slight change in register allocation, this test of undefined behavior now wraps around the register space and unexpectedly reads the constant value it's trying to compare to. The test should probably not look at the resulting color, since behavior is undefined.
* ir_to_mesa: Add a little helper for emitting link failure messages.Eric Anholt2010-09-011-24/+22
|
* mesa: more prog_execute.c debug codeBrian Paul2010-09-011-0/+7
|
* ir_to_mesa: When emitting a pixel kill, flag that we did so.Eric Anholt2010-08-311-0/+3
| | | | | | | Both i965 and swrast rely on UsesKill to determine whether to do early depth writes. Fixes glsl-fs-discard-02. Bug #29835.
* ir_to_mesa: Sort the uniform list we're adding to Parameters[] order.Eric Anholt2010-08-311-5/+41
| | | | | | | | | Fixes glsl-uniform-linking-1 and failure to link a shader in Unigine. An alternative here would be to just ditch using _mesa_add_parameter and build the initial params list on our own, but that would require two walks of the list as well. Bug #29822
* ir_to_mesa: Fix struct/class confusionnobled2010-08-311-1/+1
|
* ir_to_mesa: Set up our instruction nodes with zeroed data.Eric Anholt2010-08-311-0/+12
| | | | | | cond_update wasn't being set by emit_op3, leading to valgrind complaints, and failures in several piglit tests when built with clang.
* ir_to_mesa: use RSQ+MUL instead of RSQ+RCP for SQRTMarek Olšák2010-08-311-1/+2
| | | | | | | | sqrt(x) = 1/rsq(x) = x*rsq(x) This optimization already was in the old GLSL compiler. Acked on irc by Eric Anholt.
* mesa: Return after assertion failure.José Fonseca2010-08-301-1/+1
| | | | | | Addresses the warnings: warning: ‘target’ may be used uninitialized in this function warning: ‘target_string’ may be used uninitialized in this function
* mesa: Fix _mesa_lookup_parameter_constant's return value.José Fonseca2010-08-301-2/+4
| | | | | | | | | Fixes gcc warning In function ‘_mesa_add_unnamed_constant’: warning: ‘pos’ may be used uninitialized in this function but also what appears to be a bug.
* ir_to_mesa: Initialize variable in ir_to_mesa_visitor::visit.Vinson Lee2010-08-291-1/+1
| | | | | Fixes piglit glsl-fs-loop valgrind uninitialized value error on softpipe and llvmpipe.
* ir_to_mesa: Don't assume that an ir_dereference_array is of a variable.Eric Anholt2010-08-261-1/+2
| | | | | | | | Fixes: glsl-array-bounds-02 (software) glsl-array-bounds-04 glsl-array-bounds-06 (software) glsl-array-bounds-08
* mesa: Remove now-unused _mesa_add_sampler().Eric Anholt2010-08-252-41/+0
| | | | | | We do the generation of "what sampler number within Parameters are we" right in ir_to_mesa.cpp, instead of repeatedly walking the existing list to find out.
* ir_to_mesa: Add support for samplers in structures.Eric Anholt2010-08-251-109/+122
| | | | | | | Fixes: glsl-fs-uniform-sampler-struct glsl-fs-sampler-numbering-3 Bug #29690
* mesa: Remove now-unused _mesa_add_uniform.Eric Anholt2010-08-252-35/+0
| | | | | We had to inline it to avoid doing a double-lookup in the process of adding assertion checks.
* ir_to_mesa: Convert this code to using linker.cpp's uniform locations.Eric Anholt2010-08-252-127/+77
| | | | Fixes: glsl-fs-uniform-array-4.
* mesa: Remove the "Used" flag in gl_program_parameter.Eric Anholt2010-08-253-33/+1
| | | | | | 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.
* ir_to_mesa: set IndirectRegisterFilesMarek Olšák2010-08-251-0/+8
| | | | | | | This fixes relative addressing of temporaries (and maybe others) in all gallium drivers. Acked on irc by Eric Anholt.
* glsl: Set up uniform initializers by walking the shaders after linking.Eric Anholt2010-08-241-73/+107
| | | | | | | | | | | | | 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.
* prog_execute: Implement OPCODE_TXLIan Romanick2010-08-241-0/+16
| | | | Fixes bugzilla #29628
* mesa: Add new ir_unop_any() expression operation.Eric Anholt2010-08-231-0/+20
| | | | | | | 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)
* ir_to_mesa: Implement f2b by comparing the arg to 0, not the result.Eric Anholt2010-08-231-1/+1
| | | | Fixes: glsl-fs-any
* ir_to_mesa: Fix constant array handling to return the temp we created.Eric Anholt2010-08-231-0/+1
| | | | | | | | | | | 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.
* mesa: Initialize member variables in ir_to_mesa_src_reg constructor.Vinson Lee2010-08-221-0/+4
| | | | The default constructor did not initialize some member variables.
* mesa: Initialize variables in mesa_src_reg_from_ir_src_reg.Vinson Lee2010-08-211-0/+2
|
* glsl: Remove bogus "ambient" field from vec4 gl_TextureEnvColor.Kenneth Graunke2010-08-201-1/+1
|
* glsl: add missing ambient field to gl_LightModelLuca Barbieri2010-08-201-1/+1
| | | | | Again, this is a one-element struct that was incorrectly missing the field.
* glsl: don't crash if a field is specified for a non-struct uniformLuca Barbieri2010-08-201-1/+1
| | | | | This was triggered by the previous bug, but is a separate problem in the general sense.
* glsl: add missing sceneColor field to gl_{Front, Back}LightModelProductLuca Barbieri2010-08-201-2/+2
| | | | | | | 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.
* mesa: Fix the whining for link failures to actually be under MESA_GLSL=dump.Eric Anholt2010-08-181-0/+5
|
* mesa: Don't try to free components of a NULL uniform list.Eric Anholt2010-08-181-0/+4
| | | | This might happen if we manage to trigger the right linker errors.
* ir_to_mesa: Fix leak by improper freeing of a uniform list.Eric Anholt2010-08-181-1/+1
|
* ir_to_mesa: Don't leak the whole linked assembly program.Eric Anholt2010-08-181-0/+1
|
* ir_to_mesa: Fix leak of set_branchtargets temp data.Eric Anholt2010-08-181-4/+2
|
* ir_to_mesa: Stop leaking the ir_instruction * annotation of our compile.Eric Anholt2010-08-181-2/+1
|
* mesa: Free old linked shaders when relinking new shaders.Eric Anholt2010-08-181-1/+1
|
* ir_to_mesa: Free the ir_to_mesa temporary storage when we're done.Eric Anholt2010-08-181-2/+2
|
* mesa: Hang the compiled shader off the shader->ir, not the shader.Eric Anholt2010-08-181-1/+2
| | | | | Otherwise, with repeated program recompile, we never free the results of the previous compile.
* mesa: Make MESA_GLSL=dump include when compile/link fails, and the info log.Eric Anholt2010-08-181-5/+20
|
* ir_to_mesa: Allow ir_return in main().Eric Anholt2010-08-171-2/+2
| | | | | | | | | 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
* ir_to_mesa: Fix implementation of ir_binop_equal, ir_binop_notequal.Eric Anholt2010-08-171-2/+26
| | | | | | | | | | | | | 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
* prog_optimize: Only merge writes to temporary registersBenjamin Segovia2010-08-171-1/+5
| | | | | | In one optimization pass, register files may have been messed therefore merging instructions which use the same index in two different register files.
* mesa: Dump shader source before validating the shader.Eric Anholt2010-08-171-9/+9
| | | | | This will make extracting source to produce minimal testcases for shader compile issues easier.
* Merge branch 'glsl2'Ian Romanick2010-08-1613-63/+2970
|\ | | | | | | | | Conflicts: src/mesa/program/prog_optimize.c
| * ir_to_mesa: Silence unused variable warningsIan Romanick2010-08-161-3/+3
| |
| * ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *)Ian Romanick2010-08-161-1/+4
| |
| * ir_to_mesa: Support texture rectangle targetsIan Romanick2010-08-161-0/+3
| |