Mesa (main): r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 20 21:57:31 UTC 2022


Module: Mesa
Branch: main
Commit: a4840e15ab77b44a72cabd7d503172e8357477eb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4840e15ab77b44a72cabd7d503172e8357477eb

Author: Emma Anholt <emma at anholt.net>
Date:   Fri Dec 10 15:17:01 2021 -0800

r600: Use nir-to-tgsi instead of TGSI when the NIR debug opt is disabled.

For !8044 I'm working on getting all drivers to accept NIR.  The NIR
compiler in the driver is apparently not quite ready, so use NIR-to-TGSI
instead.  This is a net win in testcases working on my RV770 and Turks
cards (especially in some important piglit tests involving YUV dma-buf
decode), though it's not regression-free.

shader-db (R600):
total dw in shared programs: 8553412 -> 8358918 (-2.27%)
dw in affected programs: 7476702 -> 7282208 (-2.60%)
total gprs in shared programs: 217286 -> 213217 (-1.87%)
gprs in affected programs: 72747 -> 68678 (-5.59%)
total loops in shared programs: 398 -> 330 (-17.09%)
loops in affected programs: 68 -> 0
total cf in shared programs: 558835 -> 332768 (-40.45%)
cf in affected programs: 420475 -> 194408 (-53.76%)

shader-db (Turks):
total dw in shared programs: 14104598 -> 13556782 (-3.88%)
dw in affected programs: 12161972 -> 11614156 (-4.50%)
total gprs in shared programs: 321068 -> 313690 (-2.30%)
gprs in affected programs: 114899 -> 107521 (-6.42%)
total loops in shared programs: 736 -> 651 (-11.55%)
loops in affected programs: 111 -> 26 (-76.58%)
total cf in shared programs: 925771 -> 581226 (-37.22%)
cf in affected programs: 678600 -> 334055 (-50.77%)
total stack in shared programs: 27853 -> 27855 (<.01%)
stack in affected programs: 5 -> 7 (40.00%)

glmark2 terrain: 0.137649% +/- 0.0511938% (n=6)
glmark2 jellyfish: no change (n=8)
unigine valley (extreme) 5.36 -> 5.45 (n=1 it takes so long to run)
unigine heaven (basic) 16.13 -> 16.15 (n=1)

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14319>

---

 src/gallium/drivers/r600/ci/r600-rv770-fails.txt  |  89 ++-----------
 src/gallium/drivers/r600/ci/r600-rv770-skips.txt  |   7 ++
 src/gallium/drivers/r600/ci/r600-turks-fails.txt  | 145 ++++++----------------
 src/gallium/drivers/r600/ci/r600-turks-flakes.txt |   9 +-
 src/gallium/drivers/r600/ci/r600-turks-skips.txt  |   3 +
 src/gallium/drivers/r600/evergreen_compute.c      |   1 -
 src/gallium/drivers/r600/r600_pipe.c              |  13 +-
 src/gallium/drivers/r600/r600_pipe.h              |   1 +
 src/gallium/drivers/r600/r600_pipe_common.c       |  32 ++++-
 src/gallium/drivers/r600/r600_state_common.c      |  15 ++-
 src/gallium/drivers/r600/sb/notes.markdown        |   1 +
 11 files changed, 115 insertions(+), 201 deletions(-)

diff --git a/src/gallium/drivers/r600/ci/r600-rv770-fails.txt b/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
index bdcecd7540d..6a8ac0c7509 100644
--- a/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
+++ b/src/gallium/drivers/r600/ci/r600-rv770-fails.txt
@@ -2,61 +2,18 @@ KHR-GL33.clip_distance.functional,Fail
 KHR-GL33.cull_distance.functional,Fail
 KHR-GL33.nearest_edge.offset_right,Fail
 
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_0_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_0_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_0_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_1_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_1_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_1_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_2_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_2_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_11x131_2_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_0_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_0_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_0_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_1_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_1_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_1_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_2_clamp_to_edge,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_2_mirrored_repeat,Fail
-KHR-GL33.texture_repeat_mode.rgba32ui_49x23_2_repeat,Fail
-
 KHR-GL33.texture_size_promotion.functional,Fail
 
 KHR-GL33.texture_swizzle.functional,Fail
 
 KHR-GLES3.core.nearest_edge.offset_right,Fail
 
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_repeat,Fail
-
 dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_center,Fail
 dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_corner,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_center,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_corner,Fail
 
-dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_component_read_fragment,Fail
-dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_dynamic_subscript_read_fragment,Fail
-dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
-dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_subscript_read_fragment,Fail
-
 dEQP-GLES2.functional.texture.size.cube.15x15_l8,Fail
 dEQP-GLES2.functional.texture.size.cube.15x15_rgb888,Fail
 dEQP-GLES2.functional.texture.size.cube.15x15_rgba4444,Fail
@@ -118,11 +75,6 @@ dEQP-GLES3.functional.shaders.derivate.fwidth.nicest.fbo_msaa4.vec2_highp,Fail
 dEQP-GLES3.functional.shaders.derivate.fwidth.nicest.fbo_msaa4.vec3_highp,Fail
 dEQP-GLES3.functional.shaders.derivate.fwidth.nicest.fbo_msaa4.vec4_highp,Fail
 
-dEQP-GLES3.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_component_read_fragment,Fail
-dEQP-GLES3.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_dynamic_subscript_read_fragment,Fail
-dEQP-GLES3.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
-dEQP-GLES3.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_subscript_read_fragment,Fail
-
 dEQP-GLES3.functional.shaders.texture_functions.texture.samplercubeshadow_bias_fragment,Fail
 dEQP-GLES3.functional.shaders.texture_functions.texture.samplercubeshadow_fragment,Fail
 dEQP-GLES3.functional.shaders.texture_functions.texture.samplercubeshadow_vertex,Fail
@@ -425,22 +377,14 @@ dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component1
 dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component24_2d_array,Fail
 dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component32f_2d_array,Fail
 
-# "../src/gallium/drivers/r600/sb/sb_ra_init.cpp:718:split_vec: Assertion `!o->is_dead()' failed."
-glslparsertest at glsl2@loop-03.vert,Crash
-glslparsertest at glsl2@loop-04.vert,Crash
-
-# crash at:
-# 618			if (r->loop_phi) {
-# 619				split_phi_dst(r->get_entry_code_location(), r->loop_phi,
-# 620						true);
-glslparsertest at shaders@correctfull.frag,Crash
-
-glslparsertest at shaders@correctpreprocess5.frag,Crash
-
 shaders at glsl-bug-110796,Fail
 
+shaders at glsl-max-varyings,Fail
+shaders at glsl-max-varyings >max_varying_components,Fail
+
 spec@!opengl 1.0 at gl-1.0-dlist-bitmap,Fail
 spec@!opengl 1.0 at gl-1.0-no-op-paths,Fail
+spec@!opengl 1.0 at gl-1.0-spot-light,Fail
 spec@!opengl 1.0 at gl-1.0-swapbuffers-behavior,Fail
 spec@!opengl 1.0 at gl-1.0-user-clip-all-planes,Fail
 
@@ -906,16 +850,11 @@ spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB12,Fail
 spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB16,Fail
 spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB8,Fail
 
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_ayuv,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_nv12,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_uyvy,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_xyuv,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y210,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y212,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y216,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y410,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y412,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y416,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuyv,Fail
 
 spec at ext_packed_float@texwrap formats bordercolor-swizzled,Fail
@@ -1042,13 +981,6 @@ spec at ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled at GL_COMPRESSED_SR
 
 spec at ext_transform_feedback@immediate-reuse-index-buffer,Fail
 
-spec at glsl-1.10@execution at function-calls@glsl-function-chain16-in-array-indirect,Fail
-spec at glsl-1.10@execution at function-calls@glsl-function-chain16-in-array-indirect2,Fail
-
-spec at glsl-1.10@execution at varying-packing@simple float arrays_of_arrays,Fail
-spec at glsl-1.10@execution at varying-packing@simple int arrays_of_arrays,Fail
-spec at glsl-1.10@execution at varying-packing@simple uint arrays_of_arrays,Fail
-
 spec at glsl-1.20@compiler at invalid-vec4-array-to-vec3-array-conversion.vert,Fail
 
 spec at glsl-1.20@execution at clipping@vs-clip-vertex-primitives,Fail
@@ -1056,14 +988,15 @@ spec at glsl-1.20@execution at clipping@vs-clip-vertex-primitives,Fail
 spec at glsl-1.20@execution at fs-nan-builtin-max,Fail
 spec at glsl-1.20@execution at fs-nan-builtin-min,Fail
 
-spec at glsl-1.20@execution at matrix-out-of-bounds-access@fs-mat4-out-of-bounds-6,Crash
-
 spec at glsl-1.20@execution at vs-nan-builtin-max,Fail
 spec at glsl-1.20@execution at vs-nan-builtin-min,Fail
-
-spec at glsl-1.30@execution at clipping@vs-clip-distance-deadcode,Fail
 spec at glsl-1.30@execution at clipping@vs-clip-distance-primitives,Fail
 
+# "error: (dest->reg->num_array_elems == 0 || dest->base_offset < dest->reg->num_array_elems) && "definitely out-of-bounds array access" (../src/compiler/nir/nir_validate.c:277)"
+spec at glsl-1.30@execution at fs-large-local-array-out-of-bounds-read,Crash
+spec at glsl-1.30@execution at fs-large-local-array-out-of-bounds-write,Crash
+
+spec at glsl-1.30@execution at range_analysis_fsat_of_nan,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texture(bias) 1darrayshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texture(bias) cubeshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texturegrad cube,Fail
@@ -1071,8 +1004,6 @@ spec at glsl-1.30@execution at tex-miplevel-selection texturegrad cubeshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texturelod 1darrayshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texturelodoffset 1darrayshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection textureoffset(bias) 1darrayshadow,Fail
-
-spec at glsl-1.50@execution at geometry@dynamic_input_array_index,Fail
 spec at glsl-1.50@execution at geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
 spec at glsl-1.50@execution at geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
 spec at glsl-1.50@execution at texelfetchoffset@gs-isampler2drect,Fail
@@ -1089,7 +1020,7 @@ spec at glsl-1.50@execution at texelfetchoffset@gs-texelfetch-usampler3d,Fail
 spec at glsl-1.50@execution at texelfetchoffset@gs-usampler2drect,Fail
 
 spec at glsl-1.50@execution at variable-indexing@gs-input-array-vec3-index-rd,Fail
-spec at glsl-1.50@execution at variable-indexing@gs-input-array-vec4-index-rd,Crash
+spec at glsl-1.50@execution at variable-indexing@gs-input-array-vec4-index-rd,Fail
 
 spec at intel_performance_query@intel_performance_query-issue_2235,Fail
 
diff --git a/src/gallium/drivers/r600/ci/r600-rv770-skips.txt b/src/gallium/drivers/r600/ci/r600-rv770-skips.txt
index c88a1ecd9ea..8ec2d1bc478 100644
--- a/src/gallium/drivers/r600/ci/r600-rv770-skips.txt
+++ b/src/gallium/drivers/r600/ci/r600-rv770-skips.txt
@@ -5,5 +5,12 @@ glx@
 built-in-functions at gs
 texelfetch at gs
 
+# GPU hangs now
+variable-indexing at gs-in
+fs-multiple-large-local-arrays
+
 # intermittent GL_OOMs, let's make sure that doesn't impact other tests.
 spec@!opengl 1.2 at tex3d-maxsize
+
+# 1-minute timeouts
+KHR-GL33.texture_swizzle.smoke
diff --git a/src/gallium/drivers/r600/ci/r600-turks-fails.txt b/src/gallium/drivers/r600/ci/r600-turks-fails.txt
index 8d5ceaeb1ff..399a4c25574 100644
--- a/src/gallium/drivers/r600/ci/r600-turks-fails.txt
+++ b/src/gallium/drivers/r600/ci/r600-turks-fails.txt
@@ -1,35 +1,19 @@
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_0_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_1_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_0_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_1_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_clamp_to_edge,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_mirrored_repeat,Fail
-KHR-GLES3.texture_repeat_mode.rgba32ui_49x23_2_repeat,Fail
-
 KHR-GLES31.core.compute_shader.pipeline-compute-chain,Fail
-KHR-GLES31.core.compute_shader.resources-max,Fail
-KHR-GLES31.core.compute_shader.shared-struct,Fail
 
 KHR-GLES31.core.draw_buffers_indexed.blending,Fail
 
 KHR-GLES31.core.draw_indirect.basic-indicesDataType-unsigned_byte,Fail
 
+# "find_hw_atomic_counter: Assertion `0' failed."
+#
+# nir_to_tgsi's gives us a .Index of -1, and we obviously can't find that in a
+# counter declaration.
+KHR-GLES31.core.geometry_shader.api.max_atomic_counters,Crash
+
 KHR-GLES31.core.gpu_shader5.texture_gather_offset_color_clamp_to_border,Fail
 KHR-GLES31.core.gpu_shader5.texture_gather_offset_color_clamp_to_edge,Fail
 
 KHR-GLES31.core.layout_binding.image2D_layout_binding_imageLoad_ComputeShader,Fail
-KHR-GLES31.core.layout_binding.image2D_layout_binding_imageLoad_FragmentShader,Fail
 
 KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-dispatches,Fail
 KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2,Fail
@@ -38,14 +22,13 @@ KHR-GLES31.core.shader_atomic_counters.advanced-usage-multi-stage,Fail
 KHR-GLES31.core.shader_image_load_store.basic-allFormats-loadStoreComputeStage,Fail
 KHR-GLES31.core.shader_image_load_store.basic-allTargets-loadStoreCS,Fail
 
-KHR-GLES31.core.shader_storage_buffer_object.advanced-matrix-cs,Fail
 KHR-GLES31.core.shader_storage_buffer_object.advanced-readWrite-case1-cs,Fail
-KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-matR,Fail
-KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-struct,Fail
-KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-matC-pad,Fail
-KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-vec,Fail
-KHR-GLES31.core.shader_storage_buffer_object.advanced-usage-operators-cs,Fail
-KHR-GLES31.core.shader_storage_buffer_object.basic-operations-case1-cs,Fail
+
+# r600_shader.c:10547: fc_pushlevel: Assertion `ctx->bc->fc_sp < ARRAY_SIZE(ctx->bc->fc_stack)' failed.
+# Yeah, that's some deep flow control there.  Previously PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH would
+# do GLSL lower_if_to_cond_assign (which is incorrect for instructions with side effects) after 32
+# ifs deep, but we don't have the equivalent for NIR.
+KHR-GLES31.core.tessellation_shader.single.max_patch_vertices,Crash
 
 KHR-GLES31.core.tessellation_shader.tessellation_shader_tessellation.TCS_TES,Fail
 KHR-GLES31.core.tessellation_shader.tessellation_shader_tessellation.gl_InvocationID_PatchVerticesIn_PrimitiveID,Fail
@@ -491,14 +474,10 @@ dEQP-GLES31.functional.primitive_bounding_box.wide_points.tessellation_set_per_d
 dEQP-GLES31.functional.primitive_bounding_box.wide_points.tessellation_set_per_primitive.vertex_tessellation_fragment.default_framebuffer,Fail
 dEQP-GLES31.functional.primitive_bounding_box.wide_points.tessellation_set_per_primitive.vertex_tessellation_fragment.fbo,Fail
 
-dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec2_fragment,Fail
-dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec2_vertex,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec3_fragment,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec3_vertex,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec4_fragment,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.int_to_uvec4_vertex,Fail
-dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.ivec2_to_uvec2_fragment,Fail
-dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.ivec2_to_uvec2_vertex,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.ivec3_to_uvec3_fragment,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.ivec3_to_uvec3_vertex,Fail
 dEQP-GLES31.functional.shaders.implicit_conversions.es31.arithmetic.input_before_literal.div.ivec4_to_uvec4_fragment,Fail
@@ -549,37 +528,6 @@ dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.a
 dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.at_sample_id.singlesample_rbo,Fail
 dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.at_sample_id.singlesample_texture,Fail
 
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.isampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.isampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.isampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.isamplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.isamplercubearray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.sampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.sampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.sampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.samplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.samplercubearray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.usampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.usampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.usampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.usamplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.dynamically_uniform.geometry.usamplercubearray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.isampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.isampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.isampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.isamplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.isamplercubearray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.sampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.sampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.sampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.samplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.samplercubearray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.usampler2d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.usampler2darray,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.usampler3d,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.usamplercube,Crash
-dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.uniform.geometry.usamplercubearray,Crash
-
 # Mask bit count in range only on the diagonal.
 dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bit_count_per_two_samples.multisample_rbo_4,Fail
 dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bit_count_per_two_samples.multisample_rbo_8,Fail
@@ -601,7 +549,6 @@ dEQP-GLES31.functional.synchronization.in_invocation.ssbo_alias_overwrite,Fail
 dEQP-GLES31.functional.synchronization.in_invocation.ssbo_alias_write,Fail
 dEQP-GLES31.functional.synchronization.in_invocation.ssbo_overwrite,Fail
 dEQP-GLES31.functional.synchronization.in_invocation.ssbo_write_read,Fail
-dEQP-GLES31.functional.synchronization.inter_invocation.image_overwrite,Fail
 dEQP-GLES31.functional.synchronization.inter_invocation.ssbo_alias_overwrite,Fail
 dEQP-GLES31.functional.synchronization.inter_invocation.ssbo_alias_write,Fail
 dEQP-GLES31.functional.synchronization.inter_invocation.ssbo_overwrite,Fail
@@ -811,19 +758,9 @@ dEQP-GLES31.functional.texture.specification.teximage3d_pbo.rgb16f_cube_array,Fa
 dEQP-GLES31.functional.texture.specification.teximage3d_pbo.rgb16i_cube_array,Fail
 dEQP-GLES31.functional.texture.specification.teximage3d_pbo.rgb16ui_cube_array,Fail
 
-# split_vec: Assertion `!o->is_dead()' failed
-glslparsertest at glsl2@loop-03.vert,Crash
-glslparsertest at glsl2@loop-04.vert,Crash
-
-# segfaults
-glslparsertest at shaders@correctfull.frag,Crash
-glslparsertest at shaders@correctpreprocess5.frag,Crash
-
 shaders at glsl-bug-110796,Fail
 
-spec at arb_compute_shader@execution at shared-atomicadd-int,Fail
-spec at arb_compute_shader@execution at shared-atomiccompswap-int,Fail
-spec at arb_compute_shader@execution at shared-atomicexchange-int,Fail
+spec at arb_compute_shader@local-id-explosion,Fail
 
 spec at arb_depth_buffer_float@fbo-clear-formats stencil,Fail
 spec at arb_depth_buffer_float@fbo-clear-formats stencil at GL_DEPTH32F_STENCIL8,Fail
@@ -831,7 +768,19 @@ spec at arb_depth_buffer_float@fbo-clear-formats stencil at GL_DEPTH32F_STENCIL8,Fail
 spec at arb_draw_indirect@gl_vertexid used with gldrawarraysindirect,Fail
 spec at arb_draw_indirect@gl_vertexid used with gldrawelementsindirect,Fail
 
-spec at arb_enhanced_layouts@execution at component-layout@sso-vs-gs-fs-array-interleave,Fail
+
+# "ureg_DECL_fs_input_centroid_layout: Assertion `(ureg->input[i].usage_mask & usage_mask) == 0' failed."
+spec at arb_enhanced_layouts@execution at component-layout@sso-vs-gs-fs-array-interleave,Crash
+spec at arb_enhanced_layouts@execution at component-layout@tcs-tes-fs-array-with-non-array-interleave,Crash
+spec at arb_enhanced_layouts@execution at component-layout@vs-tcs-tes-fs-array-interleave,Crash
+spec at arb_enhanced_layouts@execution at component-layout@vs-tcs-tes-fs-ifc-array-interleave,Crash
+spec at arb_enhanced_layouts@execution at component-layout@vs-tcs-tes-fs-patch-array-interleave,Crash
+spec at arb_enhanced_layouts@execution at component-layout@vs-to-fs-array-interleave,Crash
+
+# "	intrinsic copy_deref (ssa_2, ssa_3) (dst_access=0, src_access=0)
+#  error: glsl_get_bare_type(dst->type) == glsl_get_bare_type(src->type) (../src/compiler/nir/nir_validate.c:643)"
+# since ntt copy-deref optimization, probably.
+spec at arb_tessellation_shader@execution at tcs-tes-levels-out-of-bounds-write,Crash
 
 # "Testing level 3
 # Probe at (0,8)
@@ -846,9 +795,6 @@ spec at arb_gpu_shader5@execution at built-in-functions@fs-interpolateatsample-array-n
 spec at arb_gpu_shader5@execution at built-in-functions@fs-interpolateatsample-array-of-array,Fail
 spec at arb_gpu_shader5@execution at built-in-functions@fs-interpolateatsample-block-array,Fail
 
-# "../src/gallium/drivers/r600/sb/sb_bc_parser.cpp:130: int r600_sb::bc_parser::parse_decls(): Assertion `pshader->num_arrays' failed."
-spec at arb_gpu_shader5@execution at samplemaskin-indirect,Crash
-
 spec at arb_multi_draw_indirect@arb_draw_elements_base_vertex-multidrawelements -indirect,Fail
 spec at arb_multi_draw_indirect@gl-3.0-multidrawarrays-vertexid -indirect,Fail
 
@@ -937,6 +883,8 @@ spec at arb_sample_shading@samplemask 8 at noms mask_in_one,Fail
 # "find_hw_atomic_counter: Assertion `0' failed."
 spec at arb_shader_atomic_counter_ops@execution at atomic-counter-array-out-of-bounds-access,Crash
 
+spec at arb_shader_atomic_counter_ops@execution at all_touch_test,Fail
+
 spec at arb_shader_image_load_store@host-mem-barrier,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Atomic counter/RaW/full barrier test/64x64,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Atomic counter/RaW/one bit barrier test/16x16,Fail
@@ -944,7 +892,6 @@ spec at arb_shader_image_load_store@host-mem-barrier at Atomic counter/RaW/one bit bar
 spec at arb_shader_image_load_store@host-mem-barrier at Atomic counter/RaW/one bit barrier test/64x64,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Buffer update/WaW/one bit barrier test/16x16,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Buffer update/WaW/one bit barrier test/4x4,Fail
-spec at arb_shader_image_load_store@host-mem-barrier at Buffer update/WaW/one bit barrier test/64x64,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Element array/RaW/full barrier test/4x4,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Element array/RaW/one bit barrier test/16x16,Fail
 spec at arb_shader_image_load_store@host-mem-barrier at Element array/RaW/one bit barrier test/4x4,Fail
@@ -957,7 +904,6 @@ spec at arb_shader_image_load_store@host-mem-barrier at Uniform buffer/RaW/one bit bar
 spec at arb_shader_image_load_store@host-mem-barrier at Uniform buffer/RaW/one bit barrier test/64x64,Fail
 spec at arb_shader_image_load_store@indexing,Fail
 spec at arb_shader_image_load_store@indexing at Compute shader/dynamically uniform indexing test,Fail
-spec at arb_shader_image_load_store@indexing at Fragment shader/dynamically uniform indexing test,Fail
 spec at arb_shader_image_load_store@invalid,Fail
 spec at arb_shader_image_load_store@invalid at imageAtomicAdd/address bounds test/imageBuffer/r32ui,Fail
 spec at arb_shader_image_load_store@invalid at imageAtomicAdd/incompatible format test,Fail
@@ -1037,15 +983,11 @@ spec at arb_shader_image_load_store@invalid at imageLoad/invalid format test,Fail
 spec at arb_shader_image_load_store@invalid at imageLoad/layer bounds test,Fail
 spec at arb_shader_image_load_store@invalid at imageLoad/level bounds test,Fail
 spec at arb_shader_image_load_store@invalid at imageLoad/unbound image test,Fail
-spec at arb_shader_image_load_store@max-images,Fail
-spec at arb_shader_image_load_store@max-images at Combined max image uniforms test,Fail
-spec at arb_shader_image_load_store@max-images at Fragment shader max image uniforms test,Fail
 
 spec at arb_shader_storage_buffer_object@array-ssbo-auto-binding,Fail
 spec at arb_shader_storage_buffer_object@compiler at atomicmin-swizzle.vert,Fail
 spec at arb_shader_storage_buffer_object@execution at ssbo-atomicadd-int,Fail
 spec at arb_shader_storage_buffer_object@linker at instance-matching-shader-storage-blocks-member-array-size-mismatch,Fail
-spec at arb_shader_storage_buffer_object@maxblocks,Fail
 
 spec at arb_shader_texture_lod@execution at arb_shader_texture_lod-texgradcube,Fail
 spec at arb_shader_texture_lod@execution at tex-miplevel-selection *gradarb cube,Fail
@@ -1056,10 +998,6 @@ spec at arb_tessellation_shader@arb_tessellation_shader-tes-gs-max-output -small -s
 spec at arb_tessellation_shader@execution at fs-primitiveid-instanced,Fail
 spec at arb_tessellation_shader@execution at gs-primitiveid-instanced,Fail
 spec at arb_tessellation_shader@execution at tcs-primitiveid-instanced,Fail
-
-# ../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:3355: virtual void glsl_to_tgsi_visitor::visit(ir_assignment*): Assertion `!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector()' failed.
-spec at arb_tessellation_shader@execution at tcs-tes-levels-out-of-bounds-write,Crash
-
 spec at arb_tessellation_shader@execution at tes-no-tcs-primitiveid-instanced,Fail
 spec at arb_tessellation_shader@execution at tes-primitiveid-instanced,Fail
 
@@ -1378,14 +1316,11 @@ spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB12,Fail
 spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB16,Fail
 spec at ext_framebuffer_object@fbo-blending-formats at GL_RGB8,Fail
 
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_ayuv,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_nv12,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_uyvy,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_xyuv,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y210,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y212,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y216,Fail
-spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y410,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y412,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_y416,Fail
 spec at ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuyv,Fail
@@ -1523,25 +1458,18 @@ spec at ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled at GL_COMPRESSED_SR
 spec at ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled at GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT- swizzled- border color only,Fail
 spec at ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled at GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- swizzled- border color only,Fail
 
-spec at glsl-1.10@execution at function-calls@glsl-function-chain16-in-array-indirect,Fail
-spec at glsl-1.10@execution at function-calls@glsl-function-chain16-in-array-indirect2,Fail
-
-spec at glsl-1.10@execution at varying-packing@simple float arrays_of_arrays,Fail
-spec at glsl-1.10@execution at varying-packing@simple float separate,Fail
-spec at glsl-1.10@execution at varying-packing@simple int arrays_of_arrays,Fail
-spec at glsl-1.10@execution at varying-packing@simple int separate,Fail
-spec at glsl-1.10@execution at varying-packing@simple uint arrays_of_arrays,Fail
-spec at glsl-1.10@execution at varying-packing@simple uint separate,Fail
-
 spec at glsl-1.20@compiler at invalid-vec4-array-to-vec3-array-conversion.vert,Fail
 
 spec at glsl-1.20@execution at clipping@vs-clip-vertex-primitives,Fail
 
-spec at glsl-1.20@execution at matrix-out-of-bounds-access@fs-mat4-out-of-bounds-6,Crash
-
-spec at glsl-1.30@execution at clipping@vs-clip-distance-deadcode,Fail
 spec at glsl-1.30@execution at clipping@vs-clip-distance-primitives,Fail
 
+# "error: (src->reg.reg->num_array_elems == 0 || src->reg.base_offset < src->reg.reg->num_array_elems) && "definitely out-of-bounds array access" (../src/compiler/nir/nir_validate.c:174)"
+spec at glsl-1.30@execution at fs-large-local-array-out-of-bounds-read,Crash
+spec at glsl-1.30@execution at fs-large-local-array-out-of-bounds-write,Crash
+
+spec at glsl-1.30@execution at range_analysis_fsat_of_nan,Fail
+
 spec at glsl-1.30@execution at tex-miplevel-selection texture(bias) 1darrayshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texture(bias) cubeshadow,Fail
 spec at glsl-1.30@execution at tex-miplevel-selection texturegrad cube,Fail
@@ -1554,9 +1482,9 @@ spec at glsl-1.30@execution at tex-miplevel-selection textureoffset(bias) 1darrayshado
 spec at glsl-1.50@execution at geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
 spec at glsl-1.50@execution at geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
 
-spec at glsl-1.50@execution at variable-indexing@gs-input-array-vec3-index-rd,Fail
+spec at glsl-1.50@execution at variable-indexing@gs-input-array-vec2-index-rd,Fail
 
-# "void glsl_to_tgsi_visitor::visit_expression(ir_expression*, st_src_reg*): Assertion `ir->operands[2]->type->vector_elements == 1' failed."
+# fc_pushlevel: Assertion `ctx->bc->fc_sp < ARRAY_SIZE(ctx->bc->fc_stack)' failed.
 spec at glsl-1.50@gs-max-output,Crash
 
 spec at intel_performance_query@intel_performance_query-issue_2235,Fail
@@ -1578,6 +1506,7 @@ spec at oes_shader_io_blocks@compiler at layout-location-aliasing.vert,Fail
 
 spec@!opengl 1.0 at gl-1.0-dlist-bitmap,Fail
 spec@!opengl 1.0 at gl-1.0-no-op-paths,Fail
+spec@!opengl 1.0 at gl-1.0-spot-light,Fail
 spec@!opengl 1.0 at gl-1.0-user-clip-all-planes,Fail
 spec@!opengl 1.1 at linestipple,Fail
 spec@!opengl 1.1 at linestipple@Factor 2x,Fail
diff --git a/src/gallium/drivers/r600/ci/r600-turks-flakes.txt b/src/gallium/drivers/r600/ci/r600-turks-flakes.txt
index 4ad2178c585..4b8489e94d0 100644
--- a/src/gallium/drivers/r600/ci/r600-turks-flakes.txt
+++ b/src/gallium/drivers/r600/ci/r600-turks-flakes.txt
@@ -1,10 +1,13 @@
 # Sometimes passes.
+KHR-GLES31.core.compute_shader.pipeline-compute-chain
 KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-dispatches
 KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2
 
-dEQP-GLES31.functional.compute.basic.ssbo_local_barrier_single_invocation
-dEQP-GLES31.functional.synchronization.inter_invocation.image_overwrite
-dEQP-GLES31.functional.synchronization.inter_invocation.image_read_write
+# Occasional "args_equal: Assertion `l.size() == r.size()' failed."
+dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.uniform_geometry
+spec at arb_gpu_shader5@execution at ubo_array_indexing@fs-nonuniform-control-flow
+
+spec at arb_shader_atomic_counter_ops@execution at all_touch_test
 
 spec at arb_shader_image_load_store@host-mem-barrier at Atomic counter/RaW/full barrier test/16x16
 spec at arb_shader_image_load_store@host-mem-barrier at Element array/RaW/full barrier test/16x16
diff --git a/src/gallium/drivers/r600/ci/r600-turks-skips.txt b/src/gallium/drivers/r600/ci/r600-turks-skips.txt
index 2d40a6f707b..cf8d0648691 100644
--- a/src/gallium/drivers/r600/ci/r600-turks-skips.txt
+++ b/src/gallium/drivers/r600/ci/r600-turks-skips.txt
@@ -3,4 +3,7 @@ glx@
 
 # Hangs the GPU
 spec at arb_shader_image_load_store@atomicity
+spec at glsl-1.10@execution at temp_arrays
+spec at glsl-1.20@execution at glsl-vs-varying-array
 shader_storage_buffer_object at execution@ssbo-atomic
+variable-indexing at .*-output-array-vec4-index-wr
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 7ddee6ea630..f7eb788bfb4 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -512,7 +512,6 @@ static void evergreen_bind_compute_state(struct pipe_context *ctx, void *state)
 	if (cstate->ir_type == PIPE_SHADER_IR_TGSI ||
 	    cstate->ir_type == PIPE_SHADER_IR_NIR) {
 		bool compute_dirty;
-		cstate->sel->ir_type = cstate->ir_type;
 		if (r600_shader_select(ctx, cstate->sel, &compute_dirty, false))
 			R600_ERR("Failed to select compute shader\n");
 	}
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 9a23ff9b82a..acc2a8b94ea 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -317,9 +317,11 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 	case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
 	case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
 	case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
-        case PIPE_CAP_NIR_ATOMICS_AS_DEREF:
 		return 1;
 
+        case PIPE_CAP_NIR_ATOMICS_AS_DEREF:
+		return rscreen->b.debug_flags & DBG_NIR_PREFERRED;
+
 	case PIPE_CAP_TEXTURE_TRANSFER_MODES:
 		return PIPE_TEXTURE_TRANSFER_BLIT;
 
@@ -630,17 +632,16 @@ static int r600_get_shader_param(struct pipe_screen* pscreen,
 	case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
 		return 16;
 	case PIPE_SHADER_CAP_PREFERRED_IR:
-		if (is_nir_enabled(&rscreen->b))
-			return PIPE_SHADER_IR_NIR;
-		return PIPE_SHADER_IR_TGSI;
+		if (rscreen->b.debug_flags & DBG_USE_TGSI)
+			return PIPE_SHADER_IR_TGSI;
+		return PIPE_SHADER_IR_NIR;
 	case PIPE_SHADER_CAP_SUPPORTED_IRS: {
 		int ir = 0;
 		if (shader == PIPE_SHADER_COMPUTE)
 			ir = 1 << PIPE_SHADER_IR_NATIVE;
 		if (rscreen->b.family >= CHIP_CEDAR) {
 			ir |= 1 << PIPE_SHADER_IR_TGSI;
-			if (is_nir_enabled(&rscreen->b))
-				ir |= 1 << PIPE_SHADER_IR_NIR;
+			ir |= 1 << PIPE_SHADER_IR_NIR;
 		}
 		return ir;
 	}
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index bcda9850a25..777f003e1ba 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -268,6 +268,7 @@ struct r600_gs_rings_state {
 #define DBG_SB_DISASM	(1 << 27)
 #define DBG_SB_SAFEMATH	(1 << 28)
 #define DBG_NIR_SB	(1 << 28)
+#define DBG_USE_TGSI	(1 << 29)
 
 #define DBG_NIR_PREFERRED (DBG_NIR_SB | DBG_NIR)
 
diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c
index 6801bd9f996..e14ad85b609 100644
--- a/src/gallium/drivers/r600/r600_pipe_common.c
+++ b/src/gallium/drivers/r600/r600_pipe_common.c
@@ -691,6 +691,7 @@ static const struct debug_named_value common_debug_options[] = {
 	{ "tes", DBG_TES, "Print tessellation evaluation shaders" },
 	{ "preoptir", DBG_PREOPT_IR, "Print the LLVM IR before initial optimizations" },
 	{ "checkir", DBG_CHECK_IR, "Enable additional sanity checks on shader IR" },
+	{ "use_tgsi", DBG_USE_TGSI, "Take TGSI directly instead of using NIR-to-TGSI"},
 
 	{ "testdma", DBG_TEST_DMA, "Invoke SDMA tests and exit." },
 	{ "testvmfaultcp", DBG_TEST_VMFAULT_CP, "Invoke a CP VM fault test and exit." },
@@ -776,7 +777,8 @@ static void r600_disk_cache_create(struct r600_common_screen *rscreen)
 	uint64_t shader_debug_flags =
 		rscreen->debug_flags &
 		(DBG_NIR |
-		 DBG_NIR_PREFERRED);
+		 DBG_NIR_PREFERRED |
+		 DBG_USE_TGSI);
 
 	rscreen->disk_shader_cache =
 		disk_cache_create(r600_get_family_name(rscreen),
@@ -1361,6 +1363,34 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 
 	rscreen->nir_options = nir_options;
 
+	if (rscreen->info.chip_class < EVERGREEN) {
+		/* Pre-EG doesn't have these ALU ops */
+		rscreen->nir_options.lower_bit_count = true;
+		rscreen->nir_options.lower_bitfield_reverse = true;
+	}
+
+	if (!(rscreen->debug_flags & DBG_NIR_PREFERRED)) {
+		/* TGSI is vector, and NIR-to-TGSI doesn't like it when the
+		 * input vars have been scalarized.
+		 */
+		rscreen->nir_options.lower_to_scalar = false;
+
+		/* NIR-to-TGSI can't do fused integer csel, and it can't just
+		 * override the flag and get the code lowered back when we ask
+		 * it to handle it.
+		 */
+		rscreen->nir_options.has_fused_comp_and_csel = false;
+
+		/* r600 has a bitfield_select and bitfield_extract opcode
+		 * (called bfi/bfe), but TGSI's BFI/BFE isn't that.
+		 */
+		rscreen->nir_options.lower_bitfield_extract = false;
+		rscreen->nir_options.lower_bitfield_insert_to_bitfield_select = false;
+
+		/* TGSI's ifind is reversed from ours, keep it the TGSI way. */
+		rscreen->nir_options.lower_find_msb_to_reverse = false;
+	}
+
 	return true;
 }
 
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 231e6592382..2c7b47807b2 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -39,6 +39,7 @@
 #include "tgsi/tgsi_ureg.h"
 
 #include "nir.h"
+#include "nir/nir_to_tgsi.h"
 #include "nir/nir_to_tgsi_info.h"
 #include "tgsi/tgsi_from_mesa.h"
 
@@ -979,14 +980,23 @@ struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_co
 								  unsigned pipe_shader_type)
 {
 	struct r600_pipe_shader_selector *sel = CALLOC_STRUCT(r600_pipe_shader_selector);
+	struct r600_screen *rscreen = (struct r600_screen *)ctx->screen;
 
 	sel->type = pipe_shader_type;
 	if (ir == PIPE_SHADER_IR_TGSI) {
 		sel->tokens = tgsi_dup_tokens((const struct tgsi_token *)prog);
 		tgsi_scan_shader(sel->tokens, &sel->info);
 	} else if (ir == PIPE_SHADER_IR_NIR){
-		sel->nir = nir_shader_clone(NULL, (const nir_shader *)prog);
-		nir_tgsi_scan_shader(sel->nir, &sel->info, true);
+		nir_shader *s = (nir_shader *)prog;
+
+		if (!(rscreen->b.debug_flags & DBG_NIR_PREFERRED)) {
+			sel->tokens = (void *)nir_to_tgsi(s, ctx->screen);
+			ir = PIPE_SHADER_IR_TGSI;
+			tgsi_scan_shader(sel->tokens, &sel->info);
+		} else {
+			sel->nir = nir_shader_clone(NULL, s);
+			nir_tgsi_scan_shader(sel->nir, &sel->info, true);
+		}
 	}
 	sel->ir_type = ir;
 	return sel;
@@ -1006,7 +1016,6 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
 	} else
 		assert(0 && "Unknown shader type\n");
 	
-	sel->ir_type = state->type;
 	sel->so = state->stream_output;
 
 	switch (pipe_shader_type) {
diff --git a/src/gallium/drivers/r600/sb/notes.markdown b/src/gallium/drivers/r600/sb/notes.markdown
index e48135c69cd..4444c0bac81 100644
--- a/src/gallium/drivers/r600/sb/notes.markdown
+++ b/src/gallium/drivers/r600/sb/notes.markdown
@@ -21,6 +21,7 @@ Debugging
     -   **sbnofallback** - Abort on errors instead of fallback
     -   **sbdisasm** - Use sb disassembler for shader dumps
     -   **sbsafemath** - Disable unsafe math optimizations
+    -   **use_tgsi** - Take in TGSI from the frontend instead of asking for NIR
 
 ### Regression debugging
 



More information about the mesa-commit mailing list