Mesa (10.4): st/mesa: Don' t use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB

Emil Velikov evelikov at kemper.freedesktop.org
Wed Feb 18 22:22:17 UTC 2015


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

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Feb  5 12:46:04 2015 +0900

st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB

The latter currently implies CPU read access, so only PIPE_USAGE_STAGING
can be expected to be fast.

Mesa demos src/tests/streaming_rect on Kaveri (radeonsi):

Unpatched:  42 frames in  1.023 seconds = 41.056 FPS
Patched:   615 frames in  1.000 seconds = 615.000 FPS

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88658
Cc: "10.3 10.4" <mesa-stable at lists.freedestkop.org>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
(cherry picked from commit a338dc01866ce50bf7555ee8dc08491c7f63b585)

---

 src/mesa/state_tracker/st_cb_bufferobjects.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 55f3644..90f786c 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -256,8 +256,15 @@ st_bufferobj_data(struct gl_context *ctx,
          break;
       case GL_STREAM_DRAW:
       case GL_STREAM_COPY:
-         pipe_usage = PIPE_USAGE_STREAM;
-         break;
+         /* XXX: Remove this test and fall-through when we have PBO unpacking
+          * acceleration. Right now, PBO unpacking is done by the CPU, so we
+          * have to make sure CPU reads are fast.
+          */
+         if (target != GL_PIXEL_UNPACK_BUFFER_ARB) {
+            pipe_usage = PIPE_USAGE_STREAM;
+            break;
+         }
+         /* fall through */
       case GL_STATIC_READ:
       case GL_DYNAMIC_READ:
       case GL_STREAM_READ:




More information about the mesa-commit mailing list