summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.h
Commit message (Collapse)AuthorAgeFilesLines
* glsl/linker: validate explicit locations for SSO programsIago Toral Quiroga2017-10-261-0/+6
| | | | | | | | | | | v2: - we only need to validate inputs to the first stage and outputs from the last stage, everything else has already been validated during cross_validate_outputs_to_inputs (Timothy). - Use MAX_VARYING instead of MAX_VARYINGS_INCL_PATCH (Illia) Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* glsl/linker: produce error when invalid explicit locations are usedIago Toral Quiroga2017-10-191-1/+2
| | | | | | | | | | | | | | We only need to add a check to validate output locations here. For inputs with invalid locations we will fail to link when we can't find a matching output in the same (invalid) location. v2: compute location slots properly depending on shader stage and variable type / direction Fixes: KHR-GL45.enhanced_layouts.varying_location_limit Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: consistently use ifndef guards over pragma onceEmil Velikov2017-03-221-1/+0
| | | | | | | | | | | | | | | | | Through the glsl headers we had an odd mix of guards be that "ifndef", "pragma once" neither or both. Simplify things by using the more common ones (ifndef) and annotating all the sources, barring the generated builting header - builtin_int64.h. The final header - udivmod64.h - is [seemingly] unused and on its way out (patch purge it is on the mailing list). Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl/varyings: Add 64-bit integer support.Dave Airlie2017-01-201-0/+8
| | | | | | | | This adds 64-bit ints to the link_varyings 64-bit support. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: make a bunch of varying linking functions staticTimothy Arceri2017-01-191-47/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: move more varying linking code to link_varyings.cppTimothy Arceri2017-01-191-0/+3
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/mesa: split gl_shader in twoTimothy Arceri2016-06-301-7/+10
| | | | | | | | | | | | | | | | | There are two distinctly different uses of this struct. The first is to store GL shader objects. The second is to store information about a shader stage thats been linked. The two uses actually share few fields and there is clearly confusion about their use. For example the linked shaders map one to one with a program so can simply be destroyed along with the program. However previously we were calling reference counting on the linked shaders. We were also creating linked shaders with a name even though it is always 0 and called the driver version of the _mesa_new_shader() function unnecessarily for GL shader objects. Acked-by: Iago Toral Quiroga <[email protected]>
* glsl: fix max varyings count for ARB_enhanced_layoutsTimothy Arceri2016-06-121-3/+9
| | | | | | | | | | | Since this extension allows more than one varying to share a single location we can't just count the number of slots a varying takes and add it to the total. Instead we now reuse the reserved varyings bitfield to determine how many slots are reserved for explicit locations instead. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/link_varyings: switch to 64bit check instead of double.Dave Airlie2016-06-091-2/+2
| | | | | | | This is prep work for int64 support. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: Add arb_cull_distance support (v3)Tobias Klausmann2016-05-141-0/+1
| | | | | | | | | v2: make too large array a compile error v3: squash mesa/prog patch to avoid static compiler errors in bisect Signed-off-by: Tobias Klausmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: add support to query GL_TRANSFORM_FEEDBACK_BUFFER_INDEXTimothy Arceri2016-03-311-2/+2
| | | | Reviewed-by: Dave Airlie <[email protected]>
* glsl: handle varyings that are not written to but have an xfb_offsetTimothy Arceri2016-03-311-0/+8
| | | | Reviewed-by: Dave Airlie <[email protected]>
* glsl: add xfb_stride link time validationTimothy Arceri2016-03-311-1/+2
| | | | | | | | | | | | | | | | From the ARB_enhanced_layous spec: "It is a compile-time or link-time error to have any *xfb_offset* that overflows *xfb_stride*, whether stated on declarations before or after the *xfb_stride*, or in different compilation units. ... When no *xfb_stride* is specified for a buffer, the stride of a buffer will be the smallest needed to hold the variable placed at the highest offset, including any required padding." Reviewed-by: Dave Airlie <[email protected]>
* glsl: basic linking support for xfb qualifiersTimothy Arceri2016-03-311-2/+3
| | | | | | | This adds the initial infrastructure for enabling transform feedback mode via in shader qualifiers and adds initial buffer support. Reviewed-by: Dave Airlie <[email protected]>
* glsl: add xfb helpers and fields to the tfeedback_decl classTimothy Arceri2016-03-311-0/+20
| | | | | | We also apply any array/struct offsets. Reviewed-by: Dave Airlie <[email protected]>
* glsl: add helper to process xfb qualifiers during linkingTimothy Arceri2016-03-311-0/+5
| | | | | | | | | | | | This function checks for any xfb_* qualifiers which will enable transform feedback mode and cause any API defined xfb varyings to be ignored. It also counts the number of varyings that have a xfb_offset qualifier and finally it calls the create_xfb_varying_names() helper to generate the names of varyings to be caputured. Reviewed-by: Dave Airlie <[email protected]>
* glsl: move to compiler/Emil Velikov2016-01-261-0/+299
Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>