diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c index 03422a37caa..f6ecd835c34 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c @@ -431,6 +431,12 @@ unsigned int rc_inst_can_use_presub( return 0; } + struct rc_src_register test_reg = *replace_reg; + test_reg.File = RC_FILE_PRESUB; + if (!c->SwizzleCaps->IsNative(info->Opcode, test_reg)) { + return 0; + } + /* We can't allow constant swizzles from presubtract, because it is not possible * to rewrite it to a native swizzle later. */ if (!c->is_r500) {