r300: fix generation of invalid swizzles in regalloc
rc_adjust_channels is inteded for moving the swizzles to a new channels when rewriting the writemask of an instruction. However for readers one needs to keep the swizzles in the old channels but rather convert to the new values, so use the proper helper rc_rewrite_swizzle. With the new swizzle fixed, we should properly detect that it would be invalid and thus we can select the proper register class to prevent the writemask rewrite in the regalloc. Documentation was added to rc_adjust_channels to make it more clear what it actually does. Fixes a bunch of dEQP tests. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7521 Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com> Reviewed-by: Filip Gawin <filip@gawin.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19158>
This commit is contained in:

committed by
Marge Bot

parent
842a0c6ef1
commit
1e9e561811
@@ -159,7 +159,6 @@ dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_loop_subscr
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_loop_subscript_write_static_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_dynamic_loop_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_dynamic_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_static_loop_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_static_loop_subscript_write_dynamic_loop_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_static_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
@@ -180,13 +179,8 @@ dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_loop_subscr
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_loop_subscript_write_static_loop_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_loop_subscript_write_static_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_loop_subscript_write_static_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_component_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_direct_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_dynamic_loop_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_dynamic_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_loop_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_dynamic_loop_subscript_read_vertex
|
||||
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_static_subscript_write_dynamic_loop_subscript_read_fragment
|
||||
@@ -640,7 +634,6 @@ dEQP-GLES2.functional.shaders.operator.angle_and_trigonometry.atan.mediump_vec2_
|
||||
dEQP-GLES2.functional.shaders.random.all_features.fragment.1
|
||||
dEQP-GLES2.functional.shaders.random.all_features.fragment.5
|
||||
dEQP-GLES2.functional.shaders.random.all_features.fragment.6
|
||||
dEQP-GLES2.functional.shaders.random.all_features.fragment.91
|
||||
dEQP-GLES2.functional.shaders.random.texture.fragment.141
|
||||
dEQP-GLES2.functional.shaders.random.texture.fragment.42
|
||||
dEQP-GLES2.functional.shaders.return.return_in_dynamic_loop_dynamic_fragment
|
||||
|
@@ -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,
|
||||
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user