draw: fix vsplit code when the (post-bias) index value is -1
authorRoland Scheidegger <sroland@vmware.com>
Tue, 16 Jan 2018 02:01:56 +0000 (03:01 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 16 Jan 2018 23:01:19 +0000 (00:01 +0100)
commit1f462eaf394517dac98b0c41f09e995f2940fdb8
tree4830877502b869ca68759259bcf1c78a79e2f987
parent0ad73031ec2f9dee6d3ad20dd625b0134ea8ec8b
draw: fix vsplit code when the (post-bias) index value is -1

vsplit_add_cache uses the post-bias index for hashing, but the
vsplit_add_cache_uint/ushort/ubyte ones used the pre-bias index, therefore
the code for handling the special case (because -1 matches the initialization
value of the cache) wasn't actually working.
Commit 78a997f72841310620d18daa9015633343d04db1 actually simplified the
cache logic somewhat, but it looks like this particular problem carried over
(and duplicated to the ushort/ubyte cases, since before only uint needed it).
This could lead to the vsplit cache doing the wrong thing, in particular
later fetch_info might indicate there are 0 values to fetch. This only really
affected edge cases which were bogus to begin with, but it could lead to a
crash with the jit vertex shader, since it cannot handle this case correctly
(the count loop is always executed at least once and we would not allocate
any memory for the shader outputs), so add another assert to catch it there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
src/gallium/auxiliary/draw/draw_pt_vsplit.c