OSDN Git Service

draw: remove fishy num_samplers/num_sampler_views check in llvm path
authorRoland Scheidegger <sroland@vmware.com>
Tue, 26 Aug 2014 23:39:44 +0000 (01:39 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 29 Aug 2014 23:17:46 +0000 (01:17 +0200)
commit99105454b000c5c665dca1d4767450ac668a43e7
tree0a7a78ec152c9c2e6220808e1317ecc0836c5cf9
parent85d4cc479050fbedf194d5d89f63e5fd0309f22c
draw: remove fishy num_samplers/num_sampler_views check in llvm path

This was meant for softpipe to not crash at some point if vertex texturing
was used. It is, however, fishy because it uses values from
draw_set_samplers/draw_set_sampler_views and not from the shader key. Albeit
we should still in all cases actually generate a new shader if this changes
(because the samplers and views themselves are in the key) I don't want to
think again wondering if that's really correct in the future.
Besides, at least today, it does not actually work for softpipe, as this was
relying on softpipe not actually calling draw_set_samplers/sampler_views at
all - I've verified it crashes regardless (if there were a tex instruction in
the vs, which normally should not happen anyway). For drivers which do indeed
not call these functions because they don't support vertex texturing at all
(r300), this should still not crash because the static texture data is all
zero, which causes the sampling functions to take an early out (same as is done
if no texture is bound at the slot used for sampling - verified with hacked up
softpipe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c