r300: handle presubtract when rewriting non-native swizzles

The extra presubtract limitations were completelly ignored.
Fixes 4 dEQP asin and atan tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7554
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
This commit is contained in:
Pavel Ondračka 2022-11-15 21:50:51 +01:00 committed by Marge Bot
parent 8cfc44aace
commit 14d97e1e42
2 changed files with 6 additions and 5 deletions

View file

@ -618,10 +618,6 @@ dEQP-GLES2.functional.shaders.loops.while_uniform_iterations.unconditional_conti
dEQP-GLES2.functional.shaders.loops.while_uniform_iterations.unconditional_continue_vertex,Fail
dEQP-GLES2.functional.shaders.loops.while_uniform_iterations.vector_counter_fragment,Fail
dEQP-GLES2.functional.shaders.loops.while_uniform_iterations.vector_counter_vertex,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.asin.highp_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.asin.mediump_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan.highp_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan.mediump_vec2_fragment,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.1,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.5,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.6,Fail

View file

@ -64,6 +64,9 @@ static const struct swizzle_data native_swizzles[] = {
};
static const int num_native_swizzles = ARRAY_SIZE(native_swizzles);
/* Only swizzles with srcp_stride != 0 can be used for presub, so
* just the first five from the list. */
static const int num_presub_swizzles = 5;
/**
* Find a native RGB swizzle that matches the given swizzle.
@ -158,7 +161,9 @@ static void r300_swizzle_split(
unsigned int best_matchmask = 0;
int i, comp;
for(i = 0; i < num_native_swizzles; ++i) {
unsigned num_swizzles = src.File == RC_FILE_PRESUB ? num_presub_swizzles : num_native_swizzles;
for(i = 0; i < num_swizzles; ++i) {
const struct swizzle_data *sd = &native_swizzles[i];
unsigned int matchcount = 0;
unsigned int matchmask = 0;