From 653b6dc651a4ceba060cdfe481b1418886813e1d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 20 May 2013 08:05:03 -0700 Subject: [PATCH] r300g/compiler: Prevent the register allocator from swizzling texture operands https://bugs.freedesktop.org/show_bug.cgi?id=63520 --- src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c index 6442e0d..d6f9deb 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c @@ -318,6 +318,12 @@ static void variable_get_class_read_cb( struct variable_get_class_cb_data * d = userdata; unsigned int new_swizzle = rc_adjust_channels(arg->Swizzle, d->conversion_swizzle); + + /* We can't change source swizzles for texture instructions. */ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + *d->can_change_writemask = 0; + } + if (!r300_swizzle_is_native_basic(new_swizzle)) { *d->can_change_writemask = 0; } -- 1.7.11.4