From 614982d320985c04e247293b54b66d7df5c19004 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 5 Feb 2013 13:37:57 -0800 Subject: 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 --- src/gallium/auxiliary/tgsi/tgsi_info.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/auxiliary/tgsi') diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c index 94b6f60..f8a3cb6 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.c +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c @@ -293,7 +293,10 @@ tgsi_opcode_infer_src_type( uint opcode ) case TGSI_OPCODE_USHR: case TGSI_OPCODE_SHL: case TGSI_OPCODE_TXQ: + case TGSI_OPCODE_SVIEWINFO: case TGSI_OPCODE_TXF: + case TGSI_OPCODE_SAMPLE_I: + case TGSI_OPCODE_SAMPLE_I_MS: return TGSI_TYPE_UNSIGNED; case TGSI_OPCODE_MOD: case TGSI_OPCODE_I2F: @@ -343,6 +346,7 @@ tgsi_opcode_infer_dst_type( uint opcode ) case TGSI_OPCODE_SHL: case TGSI_OPCODE_TXQ: case TGSI_OPCODE_TXQ_LZ: + case TGSI_OPCODE_SVIEWINFO: return TGSI_TYPE_UNSIGNED; case TGSI_OPCODE_F2I: case TGSI_OPCODE_IDIV: -- cgit v1.1