diff --git a/.pick_status.json b/.pick_status.json index ebfd9ff5b17..79649d7e7eb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7888,7 +7888,7 @@ "description": "r300: fix generation of invalid swizzles in regalloc", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c index 5d368299231..f4e4238c541 100644 --- a/src/gallium/drivers/r300/compiler/radeon_compiler_util.c +++ b/src/gallium/drivers/r300/compiler/radeon_compiler_util.c @@ -142,8 +142,15 @@ static unsigned int srcs_need_rewrite(const struct rc_opcode_info * info) } /** - * @return A swizzle the results from converting old_swizzle using - * conversion_swizzle + * This function moves the old swizzles to new channels using the values + * in the conversion swizzle. For example if the instruction writemask is + * changed from x to y, then conversion_swizzle should be y___ and this + * function will adjust the old argument swizzles (of the same instruction) + * to the new channels, so x___ will become _x__, etc... + * + * @param old_swizzle The swizzle to change + * @param conversion_swizzle Describes the conversion to perform on the swizzle + * @return A new swizzle */ unsigned int rc_adjust_channels( unsigned int old_swizzle, diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c index d3a589c98d1..53da5e5b48f 100644 --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c @@ -390,7 +390,7 @@ static enum rc_reg_class variable_get_class( can_change_writemask = 0; break; } - new_swizzle = rc_adjust_channels( + new_swizzle = rc_rewrite_swizzle( old_swizzle, conversion_swizzle); if (!r300_swizzle_is_native_basic( new_swizzle)) {