freedreno/ir3: fix has_latency_to_hide
authorRob Clark <robdclark@chromium.org>
Fri, 28 Feb 2020 23:45:53 +0000 (15:45 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 16:01:39 +0000 (16:01 +0000)
Also count tex-prefetch instructions.  And only let the no-latency rule
kick in for frag shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>

src/freedreno/ir3/ir3.h

index a44663f4238b16615aeeee20bfc5faa81cf1ec82..5cde264a580058713f370f5221da3387831a7261 100644 (file)
@@ -1201,9 +1201,16 @@ void ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary);
 static inline bool
 ir3_has_latency_to_hide(struct ir3 *ir)
 {
+       /* VS/GS/TCS/TESS  co-exist with frag shader invocations, but we don't
+        * know the nature of the fragment shader.  Just assume it will have
+        * latency to hide:
+        */
+       if (ir->type != MESA_SHADER_FRAGMENT)
+               return true;
+
        foreach_block (block, &ir->block_list) {
                foreach_instr (instr, &block->instr_list) {
-                       if (is_tex(instr))
+                       if (is_tex_or_prefetch(instr))
                                return true;
 
                        if (is_load(instr)) {