summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
Commit message (Collapse)AuthorAgeFilesLines
* mesa: silence enum comparison warningBrian Paul2010-10-251-1/+1
| | | | http://bugs.freedesktop.org/show_bug.cgi?id=31069
* mesa: move declaration before codeBrian Paul2010-10-221-1/+2
|
* i965: Add support for register spilling.Eric Anholt2010-10-212-0/+65
| | | | | It can be tested with if (0) replaced with if (1) to force spilling for all virtual GRFs. Some simple tests work, but large texturing tests fail.
* glsl: Slightly change the semantic of _LinkedShadersIan Romanick2010-10-141-3/+13
| | | | | | | | | | | | | | | Previously _LinkedShaders was a compact array of the linked shaders for each shader stage. Now it is arranged such that each slot, indexed by the MESA_SHADER_* defines, refers to a specific shader stage. As a result, some slots will be NULL. This makes things a little more complex in the linker, but it simplifies things in other places. As a side effect _NumLinkedShaders is removed. NOTE: This may be a candidate for the 7.9 branch. If there are other patches that get backported to 7.9 that use _LinkedShader, this patch should be cherry picked also.
* glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.Kenneth Graunke2010-10-141-0/+1
| | | | Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-1325-98/+95
|
* glsl: Fix incorrect assertionIan Romanick2010-10-121-1/+1
| | | | | | | This assertion was added in commit f1c1ee11, but it did not notice that the array is accessed with 'size-1' instead of 'size'. As a result, the assertion was off by one. This caused failures in at least glsl-orangebook-ch06-bump.
* ir_to_mesa: assorted clean-ups, const qualifiers, new commentsBrian Paul2010-10-121-14/+45
|
* mesa: Simplify a bit of _mesa_add_state_reference using memcmp.Eric Anholt2010-10-081-12/+3
|
* ra: First cut at a graph-coloring register allocator for mesa.Eric Anholt2010-09-292-0/+430
| | | | Notably missing is choice of registers to spill.
* mesa: Move the list of builtin uniform info from ir_to_mesa to shared code.Eric Anholt2010-09-281-242/+6
| | | | | | I'm still not pleased with how builtin uniforms are handled, but as long as we're relying on the prog_statevar stuff this seems about as good as it'll get.
* mesa: Pull ir_to_mesa's sampler number fetcher out to shared code.Eric Anholt2010-09-283-86/+173
|
* mesa: Remove SGI_color_matrix.Eric Anholt2010-09-232-32/+0
| | | | Another optional ARB_imaging subset extension.
* ir_to_mesa: Only compare vector_elements present for any_nequal/all_equalEric Anholt2010-09-221-2/+18
| | | | Fixes: glsl-mat-from-int-ctor-03
* glsl: Rework assignments with write_masks to have LHS chan count match RHS.Eric Anholt2010-09-221-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that most people new to this IR are surprised when an assignment to (say) 3 components on the LHS takes 4 components on the RHS. It also makes for quite strange IR output: (assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) )) (assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) )) (assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) )) But even worse, even we get it wrong, as shown by this line of our current step(float, vec4): (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) where we try to assign a float to the writemasked-out x channel and don't supply anything for the actual w channel we're writing. Drivers right now just get lucky since ir_to_mesa spams the float value across all the source channels of a vec4. Instead, the RHS will now have a number of components equal to the number of components actually being written. Hopefully this confuses everyone less, and it also makes codegen for a scalar target simpler. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Remove unused member array_indexed from struct statevar_element.Vinson Lee2010-09-171-1/+0
| | | | | Fixes this GCC warning. warning: missing initializer for member 'statevar_element::array_indexed'
* glsl2: Add flags to enable variable index loweringIan Romanick2010-09-171-0/+13
|
* glsl2: fix signed/unsigned comparison warningBrian Paul2010-09-151-2/+2
|
* mesa: Include missing header in program.h.Vinson Lee2010-09-141-0/+1
| | | | Include compiler.h for ASSERT symbol.
* glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmpsLuca Barbieri2010-09-131-1/+7
| | | | | | | | | | | | | | | | | Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal" and "ir_binop_nequal" to compare all elements and give a single bool. This is highly unintuitive and prevents generation of optimal Mesa IR. Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and "ir_binop_nequal" to "ir_binop_any_nequal". Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics as less, lequal, etc. Third, allow all comparisons to acts on vectors. Signed-off-by: Ian Romanick <[email protected]>
* glsl: call ir_lower_jumps according to compiler optionsLuca Barbieri2010-09-131-0/+2
|
* glsl2: Add EmitNoNoise flag, use it to remove noise opcodesIan Romanick2010-09-091-0/+3
|
* glsl2: Add ir_unop_noiseIan Romanick2010-09-091-0/+10
|
* glsl: add several EmitNo* options, and MaxUnrollIterationsLuca Barbieri2010-09-081-2/+2
| | | | | | | | | This increases the chance that GLSL programs will actually work. Note that continues and returns are not yet lowered, so linking will just fail if not supported. Signed-off-by: Ian Romanick <[email protected]>
* glsl: make compiler options per-targetLuca Barbieri2010-09-081-3/+9
| | | | | | | This allows us to specify different options, especially useful for chips without unified shaders. Signed-off-by: Ian Romanick <[email protected]>
* mesa: add PIPE_SHADER_* like constants and conversions to/from enums (v2)Luca Barbieri2010-09-081-0/+32
| | | | | Changes in v2: - No longer adds tessellation enums
* glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.Kenneth Graunke2010-09-071-1/+1
| | | | Also define it if #version 100 is encountered.
* ir_to_mesa: Add support for gl_NormalScale.Eric Anholt2010-09-072-0/+7
| | | | Bug #30040.
* glsl: Make sure shader source isn't NULL.Kenneth Graunke2010-09-071-0/+8
| | | | | This should only occur if glCompileShader is called without a prior call to glShaderSource. An empty source program should be the empty string.
* ir_to_mesa: Fix warning in last commit.Eric Anholt2010-09-071-1/+1
| | | | | I swear there was some git option for "don't push things when you've got uncommitted changes", but I can't find it now.
* ir_to_mesa: Move the STATE_VAR elements of a builtin uniform to a temp (v2).Eric Anholt2010-09-071-345/+326
| | | | | | | | | | | | | | | | | | 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. v2: Continue referencing the STATE_VAR[] file directly when the uniform will land in STATE_VAR[] formatted exactly as we'd put into a temporary. When there's array dereferencing, we don't copy-propagate in Mesa IR (not knowing where the array is in register space), so smarts here are required or we'll massively increase the temp count.
* mesa: don't smash the stack in _mesa_find_used_registersLuca Barbieri2010-09-051-2/+6
| | | | | | At some point this actually triggered, not sure if it still does. Give a meaningful assert and refuse to smash the stack anyway.
* Revert "ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to ↵Marek Olšák2010-09-041-291/+345
| | | | | | | | | | | | | | a temp." This reverts commit 5ad74779cea07cc6a19a52874cdaef8b018e2f1b. Sorry, but I had to revert this. Any commit which needlessly increases the number of temporaries is wrong. More temporaries mean less shader performance because of reduced parallelism and therefore less efficient latency hiding. In this case, there is possible performance degradation of every shader which uses GL state variables. I cannot accept this.
* 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