summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.h
Commit message (Collapse)AuthorAgeFilesLines
* glsl linker: compare interface blocks during interstage linkingKenneth Graunke2013-05-231-0/+4
| | | | | | | | | | | | Verify that interface blocks match when linking separate shader stages into a program. Fixes piglit glsl-1.50 tests: * linker/interface-blocks-vs-fs-member-count-mismatch.shader_test * linker/interface-blocks-vs-fs-member-order-mismatch.shader_test Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* glsl linker: compare interface blocks during intrastage linkingJordan Justen2013-05-231-0/+4
| | | | | | | | | | | | | | | | Verify that interface blocks match when combining compilation units at the same stage. (For example, when merging all vertex shaders.) Fixes piglit glsl-1.50 test: * linker/interface-blocks-multiple-vs-member-count-mismatch.shader_test v5 (Ken): Rename to link_interface_blocks.cpp and drop the separate .h file for consistency with other linker code. Remove "ok" variable. Fold cross_validate_interface_blocks into its caller. Signed-off-by: Jordan Justen <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Rename uniform_field_visitor to program_resource_visitor.Paul Berry2013-02-041-16/+17
| | | | | | | | | | | | | | | | There's actually nothing uniform-specific in uniform_field_visitor. It is potentially useful for all kinds of program resources (in particular, future patches will use it for transform feedback varyings). This patch renames it to program_resource_visitor, and clarifies several comments, to reflect the fact that it is useful for more than just uniforms. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Add link_uniform_blocks to calculate all UBO data at link-timeIan Romanick2013-01-251-0/+7
| | | | | | | | Calculate all of the block member offsets, the IndexNames, and everything else to do with every UBO. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Add new uniform_field_visitor::process variantIan Romanick2013-01-251-0/+17
| | | | | | | | | | This flavor takes a type and a base name. It will be used to handle cases where the block name (instead of the instance name) is used for an interface block. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add new uniform_field_visitor::visit_field variantIan Romanick2013-01-251-0/+10
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Modify uniform_field_visitor::visit_field to take a row_major parameterIan Romanick2013-01-251-1/+3
| | | | | | | | | | Not used yet, but the UBO layout visitor will use this. v2: Remove a spruious hunk. This is moved to the patch "glsl: Remove ir_variable::uniform_block". Suggested by Carl Worth. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Modify uniform_field_visitor::recursion to take a row_major parameterIan Romanick2013-01-251-1/+8
| | | | | | | | | | | Not used yet, but the UBO layout visitor will use this. v2: Add some commentary as to why row_major is always set to false in process. Suggesed by Paul Berry. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* linker: Refactor intra-stage block compatabililty testingIan Romanick2013-01-251-0/+4
| | | | | | | | | | | | | | | | Also slightly change the compatibility test. Instead of comparing the offsets of the block variables, compare the packing mode of the blocks. Ideally we don't want to assign the offsets until a later stage of linking. This is put in a new file called link_uniform_blocks.cpp. Some new functions related to uniform blocks are going to live in that file as well. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Separate varying linking code to its own file.Paul Berry2013-01-081-0/+9
| | | | | | | | 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 <[email protected]>
* glsl: Assign locations for uniforms in UBOs using the std140 rules.Eric Anholt2012-07-201-0/+3
| | | | | | Fixes piglit layout-std140. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Merge the lists of uniform blocks into the linked shader program.Eric Anholt2012-07-201-0/+6
| | | | | | This attempts error-checking, but the layout isn't done yet. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Set initial values for uniforms in the linkerIan Romanick2012-05-231-0/+3
| | | | | | | | | | | | | | v2: Fix handling of arrays-of-structure. Thanks to Eric Anholt for pointing this out. v3: Minor comment change based on feedback from Ken. Fixes piglit glsl-1.20/execution/uniform-initializer/fs-structure-array and glsl-1.20/execution/uniform-initializer/vs-structure-array. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ralloc: Make rewrite_tail increase "start" by the new text's length.Kenneth Graunke2012-02-281-1/+1
| | | | | | | | | | | | | | | | | | Both callers of rewrite_tail immediately compute the new total string length by adding the (known) length of the existing string plus the length of the newly appended text. Unfortunately, callers generally won't know the length of the new text, as it's printf-formatted. Since ralloc already computes this length, it makes sense to add it in and save the caller the effort. This simplifies both existing callers, but more importantly, will allow for cheap-appending in the next commit. v2: The link_uniforms code needs both the old and new length. Apply the obvious fix (which sadly makes it less of a cleanup). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1] Acked-by: José Fonseca <[email protected]> [v1]
* linker: Track uniform locations to new tracking structuresIan Romanick2011-11-071-0/+3
| | | | | | | This is just the infrastructure and the code. It's not used yet. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* linker: Make invalidate_variable_locations available outside the compilation ↵Ian Romanick2011-11-071-0/+4
| | | | | | | unit Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* linker: Add uniform_field_visitor class to process leaf fields of a uniformIan Romanick2011-10-251-0/+43
| | | | | Signed-off-by: Ian Romanick <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* linker: Make linker_{error,warning} generally availableIan Romanick2011-08-021-3/+0
| | | | | | | | | | linker_warning is a new function. It's identical to linker_error except that it doesn't set LinkStatus=false and it prepends "warning: " on messages instead of "error: ". Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: Make linker_error set LinkStatus to falseIan Romanick2011-08-021-1/+1
| | | | | | | | | | | | Remove the other places that set LinkStatus to false since they all immediately follow a call to linker_error. The function linker_error was previously known as linker_error_printf. The name was changed because it may seem surprising that a printf function will set an error flag. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: First bits of intrastage, intershader function linkingIan Romanick2010-07-191-0/+35
This handles the easy case of linking a function in a different compilation unit that doesn't call any functions or reference any global variables.