summaryrefslogtreecommitdiff
path: root/src/mesa/program
AgeCommit message (Collapse)Author
2010-12-03mesa: update comments, remove dead codeBrian Paul
2010-12-03mesa: remove unneeded castBrian Paul
2010-12-03mesa, st/mesa: fix gl_FragCoord with FBOs in GalliumMarek Olšák
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 <maraeo@gmail.com> Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-01glsl: Lower ir_binop_pow to a sequence of EXP2 and LOG2Ian Romanick
2010-12-01glsl: Add a lowering pass to move discards out of if-statements.Kenneth Graunke
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.
2010-12-01ir_to_mesa: Add support for conditional discards.Marek Olšák
NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-11-23glsl: start restoring some geometry shader codeBrian Paul
2010-11-23glsl: better handling of linker failuresBrian Paul
Upon link error, exit translation loop, free program instructions. Check for null pointers in calling code.
2010-11-23mesa: replace #defines with new gl_shader_type enumBrian Paul
2010-11-23mesa: _mesa_valid_register_index() to validate register indexesBrian Paul
2010-11-23mesa: rename, make _mesa_register_file_name() non-staticBrian Paul
Plus remove unused parameter.
2010-11-23glsl: use gl_register_file in a few placesBrian Paul
2010-11-23glsl: fix off by one in register index assertionBrian Paul
2010-11-19ir_to_mesa: Detect and emit MOV_SATs for saturate constructs.Eric Anholt
The goal here is to avoid regressing performance on ir_to_mesa drivers for fixed function fragment shaders requiring saturates.
2010-11-19glsl: Combine many instruction lowering passes into one.Kenneth Graunke
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 <ian.d.romanick@intel.com>
2010-11-19glsl: Add ir_quadop_vector expressionIan Romanick
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.
2010-11-19glsl: Eliminate assumptions about size of ir_expression::operandsIan Romanick
This may grow in the near future.
2010-11-19glsl: Add ir_unop_sin_reduced and ir_unop_cos_reducedIan Romanick
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.
2010-11-18ir_to_mesa: Generate smarter code for some conditional movesIan Romanick
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.
2010-11-17glsl: Remove the ir_binop_cross opcode.Kenneth Graunke
2010-11-09ir_to_mesa: Refactor code for emitting DP instructionsIan Romanick
2010-11-02mesa: Fix C++ includes in sampler.cppChad Versace
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 <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2010-10-25mesa: silence enum comparison warningBrian Paul
http://bugs.freedesktop.org/show_bug.cgi?id=31069
2010-10-22mesa: move declaration before codeBrian Paul
2010-10-21i965: Add support for register spilling.Eric Anholt
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.
2010-10-14glsl: Slightly change the semantic of _LinkedShadersIan Romanick
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.
2010-10-14glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.Kenneth Graunke
Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-12glsl: Fix incorrect assertionIan Romanick
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.
2010-10-12ir_to_mesa: assorted clean-ups, const qualifiers, new commentsBrian Paul
2010-10-08mesa: Simplify a bit of _mesa_add_state_reference using memcmp.Eric Anholt
2010-09-29ra: First cut at a graph-coloring register allocator for mesa.Eric Anholt
Notably missing is choice of registers to spill.
2010-09-28mesa: Move the list of builtin uniform info from ir_to_mesa to shared code.Eric Anholt
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.
2010-09-28mesa: Pull ir_to_mesa's sampler number fetcher out to shared code.Eric Anholt
2010-09-23mesa: Remove SGI_color_matrix.Eric Anholt
Another optional ARB_imaging subset extension.
2010-09-22ir_to_mesa: Only compare vector_elements present for any_nequal/all_equalEric Anholt
Fixes: glsl-mat-from-int-ctor-03
2010-09-22glsl: Rework assignments with write_masks to have LHS chan count match RHS.Eric Anholt
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 <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-17ir_to_mesa: Remove unused member array_indexed from struct statevar_element.Vinson Lee
Fixes this GCC warning. warning: missing initializer for member 'statevar_element::array_indexed'
2010-09-17glsl2: Add flags to enable variable index loweringIan Romanick
2010-09-15glsl2: fix signed/unsigned comparison warningBrian Paul
2010-09-14mesa: Include missing header in program.h.Vinson Lee
Include compiler.h for ASSERT symbol.
2010-09-13glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmpsLuca Barbieri
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 <ian.d.romanick@intel.com>
2010-09-13glsl: call ir_lower_jumps according to compiler optionsLuca Barbieri
2010-09-09glsl2: Add EmitNoNoise flag, use it to remove noise opcodesIan Romanick
2010-09-09glsl2: Add ir_unop_noiseIan Romanick
2010-09-08glsl: add several EmitNo* options, and MaxUnrollIterationsLuca Barbieri
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 <ian.d.romanick@intel.com>
2010-09-08glsl: make compiler options per-targetLuca Barbieri
This allows us to specify different options, especially useful for chips without unified shaders. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08mesa: add PIPE_SHADER_* like constants and conversions to/from enums (v2)Luca Barbieri
Changes in v2: - No longer adds tessellation enums
2010-09-07glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.Kenneth Graunke
Also define it if #version 100 is encountered.
2010-09-07ir_to_mesa: Add support for gl_NormalScale.Eric Anholt
Bug #30040.