summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniform_blocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: mark link_uniform_blocks_are_compatible() as staticTimothy Arceri2016-07-051-1/+1
| | | | | | Missed this when doing 6d1a59d15b. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl: simplify link_uniform_blocks()Timothy Arceri2016-06-301-5/+2
| | | | | | There is only ever one shader so simplify the input params. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* glsl/mesa: split gl_shader in twoTimothy Arceri2016-06-301-1/+1
| | | | | | | | | | | | | | | | | 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 <itoral@igalia.com>
* glsl: use enum glsl_interface_packing in more places. (v2)Dave Airlie2016-06-061-3/+3
| | | | | | | | | | | | | | | Although the glsl_types.h stores this in a bitfield, we should hide that from everyone else. Hide the cast in an accessor method and use the enum everywhere. This makes things a bit nicer in gdb, and improves type safety. v2: fix a few pieces of interface I missed that caused some piglit regressions. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl: handle implicit sized arrays in ssboDave Airlie2016-05-261-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code disallows unsized arrays except at the end of an SSBO but it is a bit overzealous in doing so. struct a { int b[]; int f[4]; }; is valid as long as b is implicitly sized within the shader, i.e. it is accessed only by integer indices. I've submitted some piglit tests to test for this. This also has no regressions on piglit on my Haswell. This fixes: GL45-CTS.shader_storage_buffer_object.basic-syntax GL45-CTS.shader_storage_buffer_object.basic-syntaxSSO This patch moves a chunk of the linker code down, so that we don't link the uniform blocks until after we've merged all the variables. The logic went something like: Removing the checks for last ssbo member unsized from the compiler and into the linker, meant doing the check in the link_uniform_blocks code. However to do that the array sizing had to happen first, so we knew that the only unsized arrays were in the last block. But array sizing required the variable to be merged, otherwise you'd get two different array sizes in different version of two variables, and one would get lost when merged. So the solution was to move array sizing up, after variable merging, but before uniform block visiting. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: move uniform block validation to link_uniform_blocks.cppTimothy Arceri2016-04-271-0/+53
| | | | Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
* glsl: remove remaining tabs in link_uniform_blocks.cppTimothy Arceri2016-04-061-5/+5
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* mesa: remove unused IsShaderStorage fieldTimothy Arceri2016-04-061-1/+0
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl: fully split apart buffer block arraysTimothy Arceri2016-04-061-89/+115
| | | | | | | | | | | | With this change we create the UBO and SSBO arrays separately from the beginning rather than putting them into a combined array and splitting it apart later. A bug is with UBO and SSBO stage reference querying is also fixed as we now use the block index to lookup the references in the separate arrays not the combined buffer block array. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl: copy explicit offset to uniform storageTimothy Arceri2016-03-051-0/+5
| | | | Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
* glsl: move to compiler/Emil Velikov2016-01-261-0/+472
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>