mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
zink: correctly handle 64 valid timestamp bits
We can't shift up 1ull by more than 63 without triggering undefined behavior here. But in that case, doing nothing is perfectly fine. While we're at it, remove some needless parens. This fixes the spec@ext_timer_query@time-elapsed piglit test on top of Lavapipe. Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8977>
This commit is contained in:
parent
d906c007d6
commit
b65093c0cf
1 changed files with 3 additions and 1 deletions
|
|
@ -49,7 +49,9 @@ timestamp_to_nanoseconds(struct zink_screen *screen, uint64_t *timestamp)
|
|||
* the VkQueueFamilyProperties::timestampValidBits property of the queue on which the timestamp is written.
|
||||
* - 17.5. Timestamp Queries
|
||||
*/
|
||||
*timestamp &= ((1ull << screen->timestamp_valid_bits) - 1);
|
||||
if (screen->timestamp_valid_bits < 64)
|
||||
*timestamp &= (1ull << screen->timestamp_valid_bits) - 1;
|
||||
|
||||
/* The number of nanoseconds it takes for a timestamp value to be incremented by 1
|
||||
* can be obtained from VkPhysicalDeviceLimits::timestampPeriod
|
||||
* - 17.5. Timestamp Queries
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue