From 3e2d4cc9b9d9bd749bd54dc87dff9426fb0ad49a 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 regalloc from swizzling texture operands v2 https://bugs.freedesktop.org/show_bug.cgi?id=63520 --- .../drivers/r300/compiler/radeon_pair_regalloc.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c index 6442e0d..35ee546 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c @@ -318,6 +318,7 @@ 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); + if (!r300_swizzle_is_native_basic(new_swizzle)) { *d->can_change_writemask = 0; } @@ -383,6 +384,14 @@ static enum rc_reg_class variable_get_class( RC_INSTRUCTION_PAIR ) { old_swizzle = r.U.P.Arg->Swizzle; } else { + /* Source operands of TEX + * instructions can't be + * swizzle on r300/r400 GPUs. + */ + if (!variable->C->is_r500) { + can_change_writemask = 0; + break; + } old_swizzle = r.U.I.Src->Swizzle; } new_swizzle = rc_adjust_channels( -- 1.7.3.4