diff options
author | Paul Berry <[email protected]> | 2012-12-05 14:37:19 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2012-12-14 10:51:21 -0800 |
commit | ca7e891e8aceaf1adb4c9ae776916fa3636747ee (patch) | |
tree | bbdedc3c50120d9ead8a8bd92f67f611a3a6ab5a /src/glsl/test_optpass.cpp | |
parent | df87722beccf0255d149668ca54a35cabf99a9c4 (diff) |
glsl/linker: Pack between varyings.
This patch implements varying packing between varyings.
Previously, each varying occupied components 0 through N-1 of its
assigned varying slot, so there was no way to pack two varyings into
the same slot. For example, if the varyings were a float, a vec2, a
vec3, and another vec2, they would be stored as follows:
<----slot1----> <----slot2----> <----slot3----> <----slot4----> slots
* * * * * * * * * * * * * * * *
flt x x x <vec2-> x x <--vec3---> x <vec2-> x x varyings
(Each * represents a varying component, and the "x"s represent wasted
space).
This change packs the varyings together to eliminate wasted space
between varyings, like so:
<----slot1----> <----slot2----> <----slot3----> <----slot4----> slots
* * * * * * * * * * * * * * * *
<vec2-> <vec2-> flt <--vec3---> x x x x x x x x varyings
Note that we take advantage of the sort order introduced in previous
patches (vec4's first, then vec2's, then scalars, then vec3's) to
minimize how often a varying is "double parked" (split across varying
slots).
Reviewed-by: Eric Anholt <[email protected]>
v2: Skip varying packing if ctx->Const.DisableVaryingPacking is true.
Diffstat (limited to 'src/glsl/test_optpass.cpp')
0 files changed, 0 insertions, 0 deletions