aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen7_sol_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-09-09 16:21:56 -0700
committerKenneth Graunke <[email protected]>2015-09-26 11:59:56 -0700
commit99df02ca26f6127c8fa24d38a8a069ac6159356a (patch)
tree20ab0015cac03ed940b4faa70a7f9f1ac32df5cc /src/mesa/drivers/dri/i965/gen7_sol_state.c
parent1e5180316cd62c8c8aa46399ab6a17ad9604d48f (diff)
i965: Don't re-layout varyings for separate shader programs.
Previously, our VUE map code always assigned slots to varyings sequentially, in one contiguous block. This was a bad fit for separate shaders - the GS input layout depended or the VS output layout, so if we swapped out vertex shaders, we might have to recompile the GS on the fly - which rather defeats the point of using separate shader objects. (Tessellation would suffer from this as well - we could have to recompile the HS, DS, and GS.) Instead, this patch makes the VUE map for separate shaders use a fixed layout, based on the input/output variable's location field. (This is either specified by layout(location = ...) or assigned by the linker.) Corresponding inputs/outputs will match up by location; if there's a mismatch, we're allowed to have undefined behavior. This may be less efficient - depending what locations were chosen, we may have empty padding slots in the VUE. But applications presumably use small consecutive integers for locations, so it hopefully won't be much worse in practice. 3% of Dota 2 Reborn shaders are hurt, but only by 2 instructions. This seems like a small price to pay for avoiding recompiles. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_sol_state.c')
0 files changed, 0 insertions, 0 deletions