Bug 100622 - Depth-stencil clears trigger occlusion query object stalls
Summary: Depth-stencil clears trigger occlusion query object stalls
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 17.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-08 18:51 UTC by Riku Salminen
Modified: 2018-06-12 16:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Test case which clears a depth-stencil attachment (6.94 KB, text/x-c)
2017-04-08 18:51 UTC, Riku Salminen
Details

Description Riku Salminen 2017-04-08 18:51:04 UTC
Created attachment 130759 [details]
Test case which clears a depth-stencil attachment

Attached: test application to reproduce bug (see https://github.com/rikusalminen/querystall for build scripts, etc. needs c99 compiler and CFLAGS).

Clearing a depth-stencil buffer when occlusion query (GL_SAMPLES_PASSED) is enabled causes the following GL debug message (via glDebugMessageCallback):
GL_DEBUG_SOURCE_API GL_DEBUG_TYPE_PERFORMANCE GL_DEBUG_SEVERITY_MEDIUM  id: 0xb
CPU mapping a busy query object BO stalled and took 2.003 ms.

Clearing GL_DEPTH_COMPONENT24 target (instead of GL_DEPTH24_STENCIL8) does not cause this behavior.

GL_TIME_ELAPSED or GL_PRIMITIVES_GENERATED queries do not give this error.

Here are some helpful notes from #intel-gfx IRC log:

21:12 < Kayden> ugh.  the query code is fine.
21:13 < Kayden> you're hitting lunacy in meta
21:13 < Kayden> https://cgit.freedesktop.org/mesa/mesa/commit/?h=bb77745681e179b53ea64da7bc1987b57643b7b0
21:14 < Kayden> the clear isn't hitting our best-case scenario, and is falling back to a meta use-GL-to-implement-GL path, that wants to disable occlusion queries so our internal usage doesn't contribute fragments
21:14 < Kayden> and the way it does that stalls
21:14 < Kayden> we've been killing off this awful code for a while now, but some bits are still left
21:21 < Kayden> wow, that's in a sorrier state than I thought :/
21:21 < Kayden> jekstrand: it looks like we always fall through to meta for stencil clears
21:21 < Kayden> blorp only does color...
21:21 < Kayden> fast depth only does depth...
21:22 < Kayden> I don't know why we wouldn't be using blorp for stencil
21:23 < Kayden> erm
21:23 < Kayden> jekstrand: it looks like the GL driver is never using  
                blorp_clear_depth_stencil
Comment 1 Danylo 2018-06-12 13:10:56 UTC
Is not reproducible with latest mesa. Seems to be fixed by commit 862493f7 - https://gitlab.freedesktop.org/mesa/mesa/commit/862493f7cb2d7d065eae52e45abbd226898af37c "i965: Use blorp for depth/stencil clears on gen6+"
Comment 2 Kenneth Graunke 2018-06-12 16:06:34 UTC
Yep, that would fix it.  Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.