Bug 95259 - [Vulkan] vkResetFences fails to reset fence to the unsignaled state
Summary: [Vulkan] vkResetFences fails to reset fence to the unsignaled state
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
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: 2016-05-04 12:35 UTC by Constantinos Vryonides
Modified: 2017-03-23 19:03 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Simple program to reproduce bug (4.60 KB, text/plain)
2016-05-04 12:37 UTC, Constantinos Vryonides
Details
Test case to show fences alway behaving as though signalled (5.09 KB, text/x-csrc)
2016-06-01 09:39 UTC, Kai
Details

Description Constantinos Vryonides 2016-05-04 12:35:06 UTC
As the title suggests vkResetFences fails to reset the supplied fences to the unsignaled state. I am using the latest master branch on Ubuntu 15.10 and the version of LunarG's loader is 1.0.11.0. My laptop has a Broadwell cpu and I have experienced the same bug on another laptop that uses an Ivy Bridge cpu. I am attaching a simple program that reproduces the bug.
Comment 1 Constantinos Vryonides 2016-05-04 12:37:11 UTC
Created attachment 123453 [details]
Simple program to reproduce bug
Comment 2 Kai 2016-06-01 09:39:09 UTC
I can confirm this on Haswell - but I think the root cause is misdiagnosed. Fences behave as though they were always signalled, I've added another test case to illustrate. Even if a fence is created in the unsignalled state, vkGetFenceStatus and vkWaitForFences always return VK_SUCCESS.
Comment 3 Kai 2016-06-01 09:39:55 UTC
Created attachment 124229 [details]
Test case to show fences alway behaving as though signalled
Comment 4 Constantinos Vryonides 2016-06-03 10:27:17 UTC
Indeed, I think the problem is not vkResetFences().

I had a look at the source code and it seems that there is logic in vkGetFenceStatus() to actually reset the fence to the signalled state if it is not in use. You can find the logic in anv_device.c lines 1516-1520. Maybe the same logic is found in  vkWaitForFences() as well.

Also, I noticed that vkCreateFence() always creates the fence in the unsignalled state and ignores the flags from the creation info struct.
Comment 5 Constantinos Vryonides 2016-06-06 10:26:30 UTC
Just to clarify, I do not think that the current behaviour of vkGetFenceStatus() is correct according to the specification. As far as I understand the specification does not state that an unsignalled fence which is not in use should be reset to the signalled state after a call to vkGetFenceStatus(). My understanding is that vkGetFenceStatus() should be a simple getter method that returns the signalled state of the fence.
Comment 6 Kai 2016-11-17 23:19:15 UTC
This seems to be resolved, at least on mesa git-0cee3fd5c73acf7e3841a7d790e3ec3031b0fe41.
Comment 7 Jason Ekstrand 2017-03-23 19:03:22 UTC
I think this is probably fixed.  Feel free to re-open if it isn't.


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.