diff options
author | Roland Scheidegger <[email protected]> | 2013-01-29 08:39:09 -0800 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-01-29 08:40:52 -0800 |
commit | 0eb588a37cc0427fd5c6a1ed2b212ed5d68f4dab (patch) | |
tree | ae53d37a9ae0ce46717757f4c7714548224c4c72 /src/gallium/auxiliary/draw/draw_llvm.c | |
parent | 845130951f9f62a1baba9ae9ea2b234e83ac5c94 (diff) |
draw: fix draw_llvm_variant_key struct padding to avoid recompiles
The struct padding got broken by c789b981b244333cfc903bcd1e2fefc010500013.
This caused serious performance regression because part of the key was
uninitialized and hence the shader always recompiled (at least on release
builds...).
While here also fix key size calculation when the number of samplers
and the number of sampler views are different.
v2: add comment
Reviewed-by: Jose Fonseca <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index afb10a6a33a..dc83f805a0f 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -1378,7 +1378,8 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store) key->clip_halfz = !llvm->draw->rasterizer->gl_rasterization_rules; key->need_edgeflags = (llvm->draw->vs.edgeflag_output ? TRUE : FALSE); key->ucp_enable = llvm->draw->rasterizer->clip_plane_enable; - key->pad = 0; + key->pad1 = 0; + key->pad2 = 0; /* All variants of this shader will have the same value for * nr_samplers. Not yet trying to compact away holes in the |