freedreno/a6xx: Sync TFB BO access against prior TFB writes.
authorEmma Anholt <emma@anholt.net>
Wed, 18 Aug 2021 20:30:57 +0000 (13:30 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Aug 2021 23:27:15 +0000 (23:27 +0000)
CTS draw_indirect usage of TFB output was flaking due to the TFB writes
possibly not having completed.  Since GL TFB doesn't require any other
barrier between TFB and use of the BO (as seen by the CTS not emitting any
memory barrier), we have to do it ourselves.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12457>

src/freedreno/ci/deqp-freedreno-a630-fails.txt
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt

index 767bb04783bc9eebc807ce9d84fd83639e22a38d..18325d68824e735e63f48697ae185e0c01cfe9d5 100644 (file)
@@ -28,10 +28,6 @@ KHR-GLES31.core.gpu_shader5.fma_precision_vec4,Fail
 # "Got red: 1, expected 0.00392157, at (1, 0)"
 KHR-GLES31.core.compute_shader.resource-image,Fail
 
-# "(x,y)= (0,0). Color RGBA(0,0,0,1) is different than expected RGBA(0.1,0.2,0.3,1)"
-KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-arrays,Fail
-KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-elements,Fail
-
 # Lots of errors like "[279] Check failed. Received: [3,0,0,2] instead of: [5,0,0,2]"
 KHR-GLES31.core.geometry_shader.layered_framebuffer.depth_support,Fail
 
index 3c4716ff68f0adea1173801571028ff867507200..bd9b39a71eb1b873cee2defc08c9886cafaed96a 100644 (file)
@@ -927,6 +927,23 @@ fd6_emit_streamout(struct fd_ringbuffer *ring, struct fd6_emit *emit) assert_dt
       }
    }
 
+   /* Make sure that any use of our TFB outputs (indirect draw source or shader
+    * UBO reads) comes after the TFB output is written.  From the GL 4.6 core
+    * spec:
+    *
+    *     "Buffers should not be bound or in use for both transform feedback and
+    *      other purposes in the GL.  Specifically, if a buffer object is
+    *      simultaneously bound to a transform feedback buffer binding point
+    *      and elsewhere in the GL, any writes to or reads from the buffer
+    *      generate undefined values."
+    *
+    * So we idle whenever SO buffers change.  Note that this function is called
+    * on every draw with TFB enabled, so check the dirty flag for the buffers
+    * themselves.
+    */
+   if (ctx->dirty & FD_DIRTY_STREAMOUT)
+      fd_wfi(ctx->batch, ring);
+
    ctx->last.streamout_mask = emit->streamout_mask;
 }
 
index 4e85532d401cc31e231b93ebca0083b191ba9876..61c1a5b0cda9eda241b2ea05acc121f7cea75c6a 100644 (file)
@@ -311,7 +311,6 @@ spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SR
 spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- swizzled- border color only,Fail
 spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SRGB- swizzled- border color only,Fail
 spec@ext_transform_feedback@geometry-shaders-basic,Fail
-spec@ext_transform_feedback@immediate-reuse-index-buffer,Fail
 spec@ext_transform_feedback@intervening-read prims_generated,Fail
 spec@ext_transform_feedback@intervening-read prims_generated use_gs,Fail
 spec@ext_transform_feedback@overflow-edge-cases,Fail