i965/fs: fix integer textures with swizzles
authorConnor Abbott <connor.abbott@intel.com>
Fri, 15 Aug 2014 17:22:20 +0000 (10:22 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 16 Oct 2014 00:05:16 +0000 (17:05 -0700)
This happened to work before, but it would convert the output to a float
and then back to an integer which seems bad.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 2251bae55d0a028939bcedd416022d92ea0b3df6..c16de4ddd1474f27a7eab11606ac915ae873cb68 100644 (file)
@@ -2147,6 +2147,7 @@ fs_visitor::swizzle_result(ir_texture *ir, fs_reg orig_val, uint32_t sampler)
       assert(ir->sampler->type->sampler_shadow);
    } else if (tex->swizzles[sampler] != SWIZZLE_NOOP) {
       fs_reg swizzled_result = fs_reg(this, glsl_type::vec4_type);
+      swizzled_result.type = orig_val.type;
 
       for (int i = 0; i < 4; i++) {
         int swiz = GET_SWZ(tex->swizzles[sampler], i);