radv/gfx10: compute the correct buffer size for NGG streamout
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 9 Sep 2019 09:04:07 +0000 (11:04 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 16 Sep 2019 10:08:22 +0000 (12:08 +0200)
It's used to determined the max emit per buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 22b89760bbbe179e17805795a2f1d5a2e993d282..5b736c67ae83199967bb615f1f0bedb473fa9db1 100644 (file)
@@ -2495,9 +2495,18 @@ radv_flush_streamout_descriptors(struct radv_cmd_buffer *cmd_buffer)
                         * the buffer will be considered not bound and store
                         * instructions will be no-ops.
                         */
+                       uint32_t size = 0xffffffff;
+
+                       /* Compute the correct buffer size for NGG streamout
+                        * because it's used to determine the max emit per
+                        * buffer.
+                        */
+                       if (cmd_buffer->device->physical_device->use_ngg_streamout)
+                               size = buffer->size - sb[i].offset;
+
                        desc[0] = va;
                        desc[1] = S_008F04_BASE_ADDRESS_HI(va >> 32);
-                       desc[2] = 0xffffffff;
+                       desc[2] = size;
                        desc[3] = S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) |
                                  S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |
                                  S_008F0C_DST_SEL_Z(V_008F0C_SQ_SEL_Z) |