summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_variables.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add gl_{Max,Min}ProgramTexelOffset built-in constants.Matt Turner2013-06-141-0/+7
| | | | | | | | Required by ARB_shading_language_420pack. Note that the 420pack spec incorrectly specifies their values as (Min, Max) = (-7, 8) when they should be (-8, 7) as listed in the GLSL 4.30 and ESSL 3.0 specs. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add AMD_vertex_shader_layer supportJordan Justen2013-05-131-0/+31
| | | | | | | | This GLSL extension requires that AMD_vertex_shader_layer be enabled by the driver. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: fix the value of gl_MaxFragmentUniformVectorsMarek Olšák2013-05-111-1/+1
| | | | | | | NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Replace gl_frag_attrib enum with gl_varying_slot.Paul Berry2013-03-151-13/+13
| | | | | | | | | | | | This patch makes the following search-and-replace changes: gl_frag_attrib -> gl_varying_slot FRAG_ATTRIB_* -> VARYING_SLOT_* FRAG_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* Replace gl_vert_result enum with gl_varying_slot.Paul Berry2013-03-151-10/+10
| | | | | | | | | | | This patch makes the following search-and-replace changes: gl_vert_result -> gl_varying_slot VERT_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* glsl: allow GLSL compiler version to be overridden to 1.50Jordan Justen2013-02-281-0/+2
| | | | | | | | | | | | | Although GLSL 1.50 compiler support is not available, this change will allow MESA_GLSL_VERSION_OVERRIDE=150 to be used while 1.50 support is being developed. Since no drivers claim 1.50 GLSL support, this change should only impact Mesa when MESA_GLSL_VERSION_OVERRIDE=150 is set. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Eliminate ambiguity between function ins/outs and shader ins/outsPaul Berry2013-01-241-43/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the three ir_variable_mode enums: - ir_var_in - ir_var_out - ir_var_inout with the following five: - ir_var_shader_in - ir_var_shader_out - ir_var_function_in - ir_var_function_out - ir_var_function_inout This eliminates a frustrating ambiguity: it used to be impossible to tell whether an ir_var_{in,out} variable was a shader in/out or a function in/out without seeing where the variable was declared in the IR. This complicated some optimization and lowering passes, and would have become a problem for implementing varying structs. In the lisp-style serialization of GLSL IR to strings performed by ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in", "out", and "inout" for function parameters, to avoid introducing code churn to the src/glsl/builtins/ir/ directory. Note: a couple of comments in the code seemed to indicate that we were planning for a possible future in which geometry shaders could have shader-scope inout variables. Our GLSL grammar rejects shader-scope inout variables, and I've been unable to find any evidence in the GLSL standards documents (or extensions) that this will ever be allowed, so I've eliminated these comments. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Clean up case statement in builtin_variables.cpp's add_variable.Paul Berry2013-01-241-2/+4
| | | | | | | | | | | The case statement purported to handle the addition of ir_var_const_in and ir_var_inout builtin variables. But no such variables exist. This patch removes the unnecessary cases, and adds a comment explaining why they're not needed. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Add builtin variables for GLSL 3.00 ES.Paul Berry2012-12-061-42/+151
| | | | | | | | | | | | This patch also adds assertions so that when we add new GLSL versions, we'll notice that we need to update the builtin variables. [v2, idr]: s/Frab/Frag/ Noticed by Eric. Reviewed-by: Ian Romanick <[email protected]> [v1] Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: make _mesa_builtin_uniform_desc staticDave Airlie2012-09-181-1/+1
| | | | | | | I can't see any reason this is global (unless for debugging) Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: add support for ARB_blend_func_extended (v3)Dave Airlie2012-04-131-0/+1
| | | | | | | | | | | | | | | | | | | This adds index support to the GLSL compiler. I'm not 100% sure of my approach here, esp without how output ordering happens wrt location, index pairs, in the "mark" function. Since current hw doesn't ever have a location > 0 with an index > 0, we don't have to work out if the output ordering the hw requires is location, index, location, index or location, location, index, index. But we have no hw to know, so punt on it for now. v2: index requires layout - catch and error setup explicit index properly. v3: drop idx_offset stuff, assume index follow location Signed-off-by: Dave Airlie <[email protected]>
* glsl: Update builtin variables for GLSL 1.40.Eric Anholt2012-03-151-109/+150
| | | | | | | | | | Mostly this is a matter of removing variables that have been moved to the compatibility profile. There's one addition: gl_InstanceID is present in the core now. This fixes the new piglit tests for GLSL 1.40 builtin variables. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.Eric Anholt2012-03-151-0/+6
| | | | | | This gets a basic #version 140 shader compiling. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extensionIan Romanick2012-02-291-1/+13
| | | | | | | | | | | Originally ARB_draw_instanced only specified that ARB decorated name. Since no vendor actually implemented that behavior and some apps use the undecorated name, the extension now specifies that both names are available. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Make gl_VertexID be a system value like gl_InstanceID.Eric Anholt2011-11-111-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glsl: Move builtin_variables.h into .cpp.Eric Anholt2011-11-111-1/+86
| | | | | | | This used to be script-generated, but now it's just a bunch of static variables in a .h file for no good reason. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Move ir_variable.cpp to builtin_variables.cpp.Eric Anholt2011-11-111-0/+916
It's only about builtins, not variables in general. Reviewed-by: Ian Romanick <[email protected]>