Mesa (master): i965: Allow mapped VBOs during drawing in non-debug contexts.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Oct 11 19:23:14 UTC 2017


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sun Jul 30 16:15:56 2017 -0700

i965: Allow mapped VBOs during drawing in non-debug contexts.

Section 6.3.2 of the GL 4.5 spec says:

   "Any GL command which attempts to read from, write to, or change
    the state of a buffer object may generate an INVALID_OPERATION error
    if all or part of the buffer object is mapped ... However, only
    commands which explicitly describe this error are required to do so.
    If an error is not generated, such commands will have undefined
    results and may result in GL interruption or termination."

Setting this flag allows us to skip walking over the buffer bindings
for every enabled vertex attribute (_mesa_all_buffers_are_unmapped).

Improves performance in GFXBench4's gl_driver2_off microbenchmark by
3.05797% +/- 0.709031% (n=33) on Apollolake.

This breaks KHR-*.draw_elements_base_vertex_tests.invalid_mapped_bos,
but that test is invalid and has been removed from the upstream CTS.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/brw_context.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 751b026439..609d815064 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -694,6 +694,9 @@ brw_initialize_context_constants(struct brw_context *brw)
     */
    if (devinfo->gen >= 7)
       ctx->Const.UseSTD430AsDefaultPacking = true;
+
+   if (!(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT))
+      ctx->Const.AllowMappedBuffersDuringExecution = true;
 }
 
 static void




More information about the mesa-commit mailing list