-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for offscreen frame boundary conversion #1440
base: dev
Are you sure you want to change the base?
Option for offscreen frame boundary conversion #1440
Conversation
CI gfxreconstruct build queued with queue ID 146186. |
CI gfxreconstruct build # 3826 running. |
94ec3ba
to
fe8f995
Compare
CI gfxreconstruct build queued with queue ID 146199. |
I just saw that I forgot that PR #1301 wasn't merged. So... This commit "relies" on this PR. There's no real dependency (this commit still has a point and can perfectly be written without PR #1301) but this commit applies modification to the override of |
fe8f995
to
dbc4e36
Compare
CI gfxreconstruct build queued with queue ID 146202. |
CI gfxreconstruct build # 3828 running. |
CI gfxreconstruct build # 3828 passed. |
Add `--use-ext-frame-boundary` option to convert all offscreen frame boundaries to `VK_EXT_frame_boundary` frame boundaries. Extensions used to specify an offscreen frame boundary can be unsupported by the replay device. As there are many of such extensions, it seems important to be able to "convert" these frame boundaries to a more "standard" one. The `VK_EXT_frame_boundary` seems to be the best choice as it is specialy designed for this purpose, platform independent, and supports all functionnalities supported by other extensions: - Specifying resources attached to the frame (images and buffers) - Depending on the execution of other commands - Specifying frame number, label and description Change-Id: I9fb932b219380c6f9098a16a83de2086f2b424ee
dbc4e36
to
3ef0c93
Compare
CI gfxreconstruct build queued with queue ID 150909. |
CI gfxreconstruct build # 3870 running. |
CI gfxreconstruct build # 3870 passed. |
VkSubmitInfo submitInfo; | ||
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; | ||
submitInfo.pNext = nullptr; | ||
submitInfo.waitSemaphoreCount = 1; | ||
submitInfo.pWaitSemaphores = &semaphore; | ||
submitInfo.pWaitDstStageMask = &dstStageMask; | ||
submitInfo.commandBufferCount = 1; | ||
submitInfo.pCommandBuffers = &it->second.second; | ||
submitInfo.signalSemaphoreCount = 0; | ||
submitInfo.pSignalSemaphores = nullptr; | ||
|
||
VkFrameBoundaryEXT frameBoundaryExt; | ||
frameBoundaryExt.sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; | ||
frameBoundaryExt.pNext = nullptr; | ||
frameBoundaryExt.flags = VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT; | ||
frameBoundaryExt.frameID = application_->GetCurrentFrameNumber(); | ||
frameBoundaryExt.imageCount = (image == VK_NULL_HANDLE ? 0 : 1); | ||
frameBoundaryExt.pImages = (image == VK_NULL_HANDLE ? nullptr : &image); | ||
frameBoundaryExt.bufferCount = 0; | ||
frameBoundaryExt.pBuffers = nullptr; | ||
frameBoundaryExt.tagName = frameBoundaryExt.frameID; | ||
frameBoundaryExt.tagSize = 0; | ||
frameBoundaryExt.pTag = nullptr; | ||
|
||
submitInfo.pNext = &frameBoundaryExt; | ||
|
||
VkQueue queue; | ||
device_table->GetDeviceQueue(device, queueFamily, 0, &queue); | ||
device_table->QueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the big concerns I have here is something we ran into before with the virtual swapchain code. We were running into a race condition when code was being submitted into a different Queue than the triggering semaphore completion work. This resulted in us performing the virtual swapchain update with incorrect content. Sometimes "future" content so we saw frame stuttering.
In this case, you may be receiving the semaphore from work that executed a queue that is not index 0. If this is the case, you're adding additional code to queue 0 potentially well after the work was done. This may result in the application already sending pending work onto that queue and the resultant "end of frame" may actually be after this content which correctly belongs to the next frame.
Add
--use-ext-frame-boundary
option to convert all offscreen frame boundaries toVK_EXT_frame_boundary
frame boundaries.Extensions used to specify an offscreen frame boundary can be unsupported by the replay device. As there are many of such extensions, it seems important to be able to "convert" these frame boundaries to a more "standard" one.
The
VK_EXT_frame_boundary
seems to be the best choice as it is specialy designed for this purpose, platform independent, and supports all functionnalities supported by other extensions:This commit depends on: