r300: check for the extra restrictions on presubtract swizzles

And don't use presubtract in the first place instead of relying on the
dataflow swizzle pass to sort things up later.

Just two shaders in shader-db hits this, but this patch prevents some
regressions in dEQP when we later move presubtract after the dataflow
swizzle pass.

RV420:
presub helped:   shaders/chromeos/24.shader_test FS:               6 -> 2 (-66.67%)
presub helped:   shaders/chromeos/21.shader_test FS:               6 -> 2 (-66.67%)
cycles helped:   shaders/chromeos/24.shader_test FS:               79 -> 78 (-1.27%)
cycles helped:   shaders/chromeos/21.shader_test FS:               47 -> 46 (-2.13%)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28428>
This commit is contained in:
Pavel Ondračka 2024-03-27 16:29:57 +01:00 committed by Marge Bot
parent ede4e4aae3
commit a35a158b09
1 changed files with 6 additions and 0 deletions

View File

@ -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) {