summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.h
Commit message (Collapse)AuthorAgeFilesLines
* glsl: push vertex count determination down one levelChris Forbes2015-07-231-2/+1
| | | | | | | We have the prog here, so we don't need the caller to work this out for us. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: lower gl_TessLevel* from float[n] to vecn.Fabian Bieler2015-07-231-4/+9
| | | | | | | | | | Similar to gl_ClipDistance -> gl_ClipDistanceMESA v2: - renamed is_mesa_var to lowered_builtin_array_variable - moved LowerTessLevel into gl_constants - cosmetic changes in lower_tess_level.cpp Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl: Add methods to retrive a varying's name and streamId.Iago Toral Quiroga2014-06-301-0/+10
| | | | | Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Assign GLSL StreamIds to transform feedback outputs.Iago Toral Quiroga2014-06-301-0/+7
| | | | | | Inter-shader outputs must be on stream 0, which is the default. Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
* glsl: Count shader inputs and outputs separatelyIan Romanick2013-10-071-3/+8
| | | | | | | | | | | | Starting with OpenGL 3.2 input limits and output limits for stages may not match. This means they need to be accounted separately. No piglit regressions. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: Remove unused prog parameter from tfeedback_decl::initIan Romanick2013-09-041-2/+1
| | | | | | | It looks like commit 53febac removed the last user of that parameter. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/linker: Properly pack GS input varyings.Paul Berry2013-08-011-1/+2
| | | | | | | | Since geometry shader inputs are arrays (where the array index indicates which vertex is being examined), varying packing needs to treat them differently. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Use a consistent technique for tracking link success/failure.Paul Berry2013-07-301-1/+1
| | | | | | | | | | | | | | | | | | This patch changes link_shaders() so that it sets prog->LinkStatus to true when it starts, and then relies on linker_error() to set it to false if a link failure occurs. Previously, link_shaders() would set prog->LinkStatus to true halfway through its execution; as a result, linker functions that executed during the first half of link_shaders() would have to do their own success/failure tracking; if they didn't, then calling linker_error() would add an error message to the log, but not cause the link to fail. Since it wasn't always obvious from looking at a linker function whether it was called before or after link_shaders() set prog->LinkStatus to true, this carried a high risk of bugs. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/linker: eliminate unused and set-but-unused built-in varyingsMarek Olšák2013-07-021-0/+4
| | | | | | | | | | | | | This eliminates built-in varyings such as gl_Color, gl_SecondaryColor, gl_TexCoord, and gl_FogFragCoord if they are unused by the next stage or not written at all (e.g. gl_TexCoord elements). The gl_TexCoord array is broken down into separate vec4s if needed. v2: - use a switch statement in varying_info_visitor::visit(ir_variable*) - use snprintf - disable the optimization for GLES2 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/linker: check against varying limit after unused varyings are eliminatedMarek Olšák2013-07-021-0/+5
| | | | | | | We counted even the varyings which were later eliminated, which was suboptimal. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Support transform feedback of varying structs.Paul Berry2013-02-041-4/+53
| | | | | | | | | | | | | | | | | | | Since transform feedback needs to be able to access individual fields of varying structs, we can no longer match up the arguments to glTransformFeedbackVaryings() with variables in the vertex shader. Instead, we build up a hashtable which records information about each possible name that is a candidate for transform feedback, and then match up the arguments to glTransformFeedbackVaryings() with the contents of that hashtable. Populating the hashtable uses the program_resource_visitor infrastructure, so the logic is shared with how we handle uniforms. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* glsl: Use parse_program_resource_name to parse transform feedback varyings.Paul Berry2013-02-041-1/+1
| | | | | | | | | | | | | | | | | | | Previously, transform feedback varyings were parsed in an ad-hoc fashion that wasn't compatible with structs (or array of structs). This patch makes it use parse_program_resource_name(), which correctly handles both. Note that parse_program_resource_name()'s technique for handling mal-formed input strings is to simply let them through and rely on the fact that a future name lookup will fail. Because of this, tfeedback_decl::init() no longer needs to return a boolean error code--it always succeeds, and if the input was mal-formed the error will be detected later. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* glsl: Separate varying linking code to its own file.Paul Berry2013-01-081-0/+186
linker.cpp is getting pretty big, and we're about to add even more varying packing code, so split out the linker code that concerns varyings to its own file. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>