gallivm: fix up size queries for dx10 sviewinfo opcode
authorRoland Scheidegger <sroland@vmware.com>
Tue, 5 Feb 2013 21:37:57 +0000 (13:37 -0800)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 9 Feb 2013 02:54:40 +0000 (18:54 -0800)
commit614982d320985c04e247293b54b66d7df5c19004
tree53a17cb7593ba82d1140bd218a7f192606cf332a
parent0a8043bb766f9c38af559438b646c3659614b103
gallivm: fix up size queries for dx10 sviewinfo opcode

Need to calculate the number of mip levels (if it would be worthwile could
store it in dynamic state).
While here, the query code also used chan 2 for the lod value.
This worked with mesa state tracker but it seems safer to use chan 0.
Still passes piglit textureSize (with some handwaving), though the non-GL
parts are (largely) untested.

v2: clarify and expect the sviewinfo opcode to return ints, not floats,
just like the OpenGL textureSize (dx10 supports dst modifiers with resinfo).
Also simplify some code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_llvm_sample.c
src/gallium/auxiliary/gallivm/lp_bld_sample.h
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/auxiliary/tgsi/tgsi_info.c
src/gallium/docs/source/tgsi.rst
src/gallium/drivers/llvmpipe/lp_tex_sample.c