summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Clean up header file inclusion in nvvertparse.h.Vinson Lee2010-12-141-1/+4
|
* ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectorsIan Romanick2010-12-131-1/+7
| | | | | | | | This is the same as what the array dereference handler does. Fixes piglit test glsl-link-struct-array (bugzilla #31648). NOTE: This is a candidate for the 7.9 and 7.10 branches.
* mesa: Clean up header file inclusion in nvfragparse.h.Vinson Lee2010-12-111-1/+4
|
* mesa: Clean up header file inclusion in ir_to_mesa.h.Vinson Lee2010-12-111-2/+5
|
* mesa: Clean up header file inclusion in arbprogparse.h.Vinson Lee2010-12-091-1/+5
|
* symbol_table: Add support for adding a symbol at top-level/global scope.Kenneth Graunke2010-12-062-5/+84
|
* mesa: Bump the number of bits in the register index.José Fonseca2010-12-061-1/+1
| | | | | | More than 1023 temporaries were being used for a Cinebench shader before doing temporary optimization, causing the index value to wrap around to -1024.
* mesa: update comments, remove dead codeBrian Paul2010-12-031-3/+3
|
* mesa: remove unneeded castBrian Paul2010-12-031-1/+1
|
* mesa, st/mesa: fix gl_FragCoord with FBOs in GalliumMarek Olšák2010-12-032-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | gl_FragCoord.y needs to be flipped upside down if a FBO is bound. This fixes: - piglit/fbo-fragcoord - https://bugs.freedesktop.org/show_bug.cgi?id=29420 Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based on whether a FBO is bound. The state contains a pair of transformations. It can be either (XY=identity, ZW=transformY) if a FBO is bound, or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0), transformY = (-1, height-1). A classic driver (or st/mesa) may, based on some other state, choose whether to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...". The reason for this is that a Gallium driver is allowed to only support WPOS relative to either the lower left or the upper left corner, so we must flip the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion) NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* glsl: Lower ir_binop_pow to a sequence of EXP2 and LOG2Ian Romanick2010-12-011-2/+3
|
* glsl: Add a lowering pass to move discards out of if-statements.Kenneth Graunke2010-12-011-1/+3
| | | | | | | This should allow lower_if_to_cond_assign to work in the presence of discards, fixing bug #31690 and likely #31983. NOTE: This is a candidate for the 7.9 branch.
* ir_to_mesa: Add support for conditional discards.Marek Olšák2010-12-011-2/+7
| | | | | | | NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: start restoring some geometry shader codeBrian Paul2010-11-231-0/+11
|
* glsl: better handling of linker failuresBrian Paul2010-11-231-19/+33
| | | | | Upon link error, exit translation loop, free program instructions. Check for null pointers in calling code.
* mesa: replace #defines with new gl_shader_type enumBrian Paul2010-11-232-2/+2
|
* mesa: _mesa_valid_register_index() to validate register indexesBrian Paul2010-11-232-0/+103
|
* mesa: rename, make _mesa_register_file_name() non-staticBrian Paul2010-11-232-11/+12
| | | | Plus remove unused parameter.
* glsl: use gl_register_file in a few placesBrian Paul2010-11-231-4/+4
|
* glsl: fix off by one in register index assertionBrian Paul2010-11-231-1/+1
|
* ir_to_mesa: Detect and emit MOV_SATs for saturate constructs.Eric Anholt2010-11-191-0/+32
| | | | | The goal here is to avoid regressing performance on ir_to_mesa drivers for fixed function fragment shaders requiring saturates.
* glsl: Combine many instruction lowering passes into one.Kenneth Graunke2010-11-191-3/+2
| | | | | | | This should save on the overhead of tree-walking and provide a convenient place to add more instruction lowering in the future. Signed-off-by: Ian Romanick <[email protected]>
* glsl: Add ir_quadop_vector expressionIan Romanick2010-11-191-0/+132
| | | | | | | | | | The vector operator collects 2, 3, or 4 scalar components into a vector. Doing this has several advantages. First, it will make ud-chain tracking for components of vectors much easier. Second, a later optimization pass could collect scalars into vectors to allow generation of SWZ instructions (or similar as operands to other instructions on R200 and i915). It also enables an easy way to generate IR for SWZ instructions in the ARB_vertex_program assembler.
* glsl: Eliminate assumptions about size of ir_expression::operandsIan Romanick2010-11-191-1/+1
| | | | This may grow in the near future.
* glsl: Add ir_unop_sin_reduced and ir_unop_cos_reducedIan Romanick2010-11-191-0/+110
| | | | | | | | | | | | The operate just like ir_unop_sin and ir_unop_cos except that they expect their inputs to be limited to the range [-pi, pi]. Several GPUs require this limited range for their sine and cosine instructions, so having these as operations (along with a to-be-written lowering pass) helps this architectures. These new operations also matche the semantics of the GL_ARB_fragment_program SCS instruction. Having these as operations helps in generating GLSL IR directly from assembly fragment programs.
* ir_to_mesa: Generate smarter code for some conditional movesIan Romanick2010-11-181-12/+99
| | | | | | | Condiation moves with a condition of (a < 0), (a > 0), (a <= 0), or (a >= 0) can be generated with "a" directly as an operand of the CMP instruction. This doesn't help much now, but it will help with assembly shaders that use the CMP instruction.
* glsl: Remove the ir_binop_cross opcode.Kenneth Graunke2010-11-171-4/+0
|
* ir_to_mesa: Refactor code for emitting DP instructionsIan Romanick2010-11-091-45/+35
|
* mesa: Fix C++ includes in sampler.cppChad Versace2010-11-021-4/+4
| | | | | | | | | Some C++ header files were included in an extern "C" block. When building with Clang, this caused the build to fail due to namespace errors. (GCC did not report any errors.) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* 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
|