aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_hv_accept.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: add ir_emit_vertex and ir_end_primitive instruction typesBryan Cain2013-08-011-0/+13
| | | | | | | | | | | | | | These correspond to the EmitVertex and EndPrimitive functions in GLSL. v2 (Paul Berry <[email protected]>): Add stub implementations of new pure visitor functions to i965's vec4_visitor and fs_visitor classes. v3 (Paul Berry <[email protected]>): Rename classes to be more consistent with the names used in the GL spec. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Implement ARB_texture_query_lodDave Airlie2013-03-291-0/+1
| | | | | | | | | | | | | | | | | | | v2 [mattst88]: - Rebase. - #define GL_ARB_texture_query_lod to 1. - Remove comma after ir_lod in ir.h for MSVC. - Handled ir_lod in ir_hv_accept.cpp, ir_rvalue_visitor.cpp, opt_tree_grafting.cpp. - Rename textureQueryLOD to textureQueryLod, see https://www.khronos.org/bugzilla/show_bug.cgi?id=821 - Fix ir_reader of (lod ...). v3 [mattst88]: - Rename textureQueryLod to textureQueryLOD, pending resolution of Khronos 821. - Add ir_lod case to ir_to_mesa.cpp. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add support for ARB_texture_multisampleChris Forbes2013-03-021-0/+5
| | | | | | | | | | | | | | | | | | V2: - emit `sample` parameter properly for multisample texelFetch() - fix spurious whitespace change - introduce a new opcode ir_txf_ms rather than overloading the existing ir_txf further. This makes doing the right thing in the driver somewhat simpler. V3: - fix weird whitespace V4: - don't forget to include the new opcode in tex_opcode_strs[] (thanks Kenneth for spotting this) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Eric Anholt <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Convert ir_call to be a statement rather than a value.Kenneth Graunke2012-04-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aside from ir_call, our IR is cleanly split into two classes: - Statements (typeless; used for side effects, control flow) - Values (deeply nestable, pure, typed expression trees) Unfortunately, ir_call confused all this: - For void functions, we placed ir_call directly in the instruction stream, treating it as an untyped statement. Yet, it was a subclass of ir_rvalue, and no other ir_rvalue could be used in this way. - For functions with a return value, ir_call could be placed in arbitrary expression trees. While this fit naturally with the source language, it meant that expressions might not be pure, making it difficult to transform and optimize them. To combat this, we always emitted ir_call directly in the RHS of an ir_assignment, only using a temporary variable in expression trees. Many passes relied on this assumption; the acos and atan built-ins violated it. This patch makes ir_call a statement (ir_instruction) rather than a value (ir_rvalue). Non-void calls now take a ir_dereference of a variable, and store the return value there---effectively a call and assignment rolled into one. They cannot be embedded in expressions. All expression trees are now pure, without exception. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Use ir_rvalue to represent generic error_type values.Kenneth Graunke2012-04-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | Currently, ir_call can be used as either a statement (for void functions) or a value (for non-void functions). This is rather awkward, as it's the only class that can be used in both forms. A number of places use ir_call::get_error_instruction() to construct a generic value of error_type. If ir_call is to become a statement, it can no longer serve this purpose. Unfortunately, none of our classes are particularly well suited for this, and creating a new one would be rather aggrandizing. So, this patch introduces ir_rvalue::error_value(), a static method that creates an instance of the base class, ir_rvalue. This has the nice property that you can't accidentally try and access uninitialized fields (as it doesn't have any). The downside is that the base class is no longer abstract. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.Paul Berry2011-09-231-6/+15
| | | | | | | | | | | | | | This patch fixes a bug in ir_hirearchical_visitor: when traversing an exec_list representing the formal or actual parameters of a function, it modified base_ir to point to each parameter in turn, rather than leaving it as a pointer to the enclosing statement. This was a problem, since base_ir is used by visitor classes to locate the statement containing the node being visited (usually so that additional statements can be inserted before or after it). Without this fix, visitors might attempt to insert statements into parameter lists. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add a new ir_txs (textureSize) opcode to ir_texture.Kenneth Graunke2011-08-231-3/+6
| | | | | | | | One unique aspect of TXS is that it doesn't have a coordinate. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* glsl: Change texel offsets to a single vector rvalue.Kenneth Graunke2011-01-311-0/+6
| | | | | | | | | | | Having these as actual integer values makes it difficult to implement the texture*Offset built-in functions, since the offset is actually a function parameter (which doesn't have a constant value). The original rationale was that some hardware needs these offset baked into the instruction opcode. However, at least i965 should be able to support non-constant offsets. Others should be able to rely on inlining and constant propagation.
* glsl2: Set a flag when visiting the assignee of an assignmentIan Romanick2010-09-031-0/+9
|
* glsl2: Make the HV actually call ir_texture's visit_leave.Eric Anholt2010-08-051-1/+1
|
* exec_list: Fix foreach_list_safe.Kenneth Graunke2010-07-191-2/+3
| | | | | | | | It now works correctly when nodes are removed, as it was originally intended to do; it no longer processes nodes added to the list before the current node, nor those added immediately after the current node. This matches the behavior of Linux's list_for_each_safe.
* glsl2: Use new foreach_list_safe abstraction.Kenneth Graunke2010-07-091-7/+3
|
* glsl2: Don't forget to walk the parameters to a function in the hv.Eric Anholt2010-07-071-0/+4
| | | | | Fixes segfaults from use after free after the steal of ir nodes and free of the compile context.
* glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).Eric Anholt2010-07-011-1/+4
| | | | This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
* glsl2: Define new ir_discard instruction.Kenneth Graunke2010-06-301-0/+17
|
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+348