-
Notifications
You must be signed in to change notification settings - Fork 25
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
Port to the new swapchain model #210
Conversation
Compatibility list:
|
How does this interact with present modes? In particular, out of order presentation and acquiring multiple swapchain images? |
Should be unaffected.
multiple images of the same swapchain - not supported by this path |
Given the amount of testing I'm doing right now, will be confident to release portability-0.8 right after this merges, if we proceed 😄 |
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.
This is autogenerated code-style review, only first 25 of 73 new suggestions are shown
maxPerStageDescriptorStorageBuffers: limits.max_per_stage_descriptor_storage_buffers as _, | ||
maxPerStageDescriptorSampledImages: limits.max_per_stage_descriptor_sampled_images as _, | ||
maxPerStageDescriptorStorageImages: limits.max_per_stage_descriptor_storage_images as _, | ||
maxPerStageDescriptorInputAttachments: limits.max_per_stage_descriptor_input_attachments as _, |
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.
maxPerStageDescriptorInputAttachments: limits.max_per_stage_descriptor_input_attachments as _, | |
maxPerStageDescriptorInputAttachments: limits.max_per_stage_descriptor_input_attachments | |
as _, |
This comment was generated by: rustfmt
// Warning: spec violation | ||
// "The x/y rectangle of the viewport must lie entirely within the current attachment size." | ||
viewportBoundsRange: [0.0, viewport_size as f32], | ||
maxDescriptorSetUniformBuffersDynamic: limits.max_descriptor_set_uniform_buffers_dynamic.max(1) as _, |
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.
maxDescriptorSetUniformBuffersDynamic: limits.max_descriptor_set_uniform_buffers_dynamic.max(1) as _, | |
maxDescriptorSetUniformBuffersDynamic: limits | |
.max_descriptor_set_uniform_buffers_dynamic | |
.max(1) as _, |
This comment was generated by: rustfmt
viewportBoundsRange: [0.0, viewport_size as f32], | ||
maxDescriptorSetUniformBuffersDynamic: limits.max_descriptor_set_uniform_buffers_dynamic.max(1) as _, | ||
maxDescriptorSetStorageBuffers: limits.max_descriptor_set_storage_buffers as _, | ||
maxDescriptorSetStorageBuffersDynamic: limits.max_descriptor_set_storage_buffers_dynamic.max(1) as _, |
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.
maxDescriptorSetStorageBuffersDynamic: limits.max_descriptor_set_storage_buffers_dynamic.max(1) as _, | |
maxDescriptorSetStorageBuffersDynamic: limits | |
.max_descriptor_set_storage_buffers_dynamic | |
.max(1) as _, |
This comment was generated by: rustfmt
pointSizeGranularity: 0.0, | ||
lineWidthGranularity: 0.0, | ||
strictLines: 0, | ||
standardSampleLocations: if limits.standard_sample_locations { VK_TRUE } else { VK_FALSE }, |
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.
standardSampleLocations: if limits.standard_sample_locations { VK_TRUE } else { VK_FALSE }, | |
standardSampleLocations: if limits.standard_sample_locations { | |
VK_TRUE | |
} else { | |
VK_FALSE | |
}, |
This comment was generated by: rustfmt
@@ -6,21 +6,19 @@ use hal::{ | |||
pool::CommandPool as _, | |||
pso::DescriptorPool, | |||
queue::{CommandQueue as _, QueueFamily}, | |||
window::{PresentMode, Surface, Swapchain as _}, | |||
window::{PresentMode, PresentationSurface as _, Surface as _}, | |||
{command as com, memory, pass, pso, queue}, |
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.
{command as com, memory, pass, pso, queue}, | |
{command as com, memory, pass, pso, queue}, {Features, Instance}, |
This comment was generated by: rustfmt
@@ -1546,7 +1586,7 @@ pub extern "C" fn gfxCreateSemaphore( | |||
pSemaphore: *mut VkSemaphore, | |||
) -> VkResult { | |||
let semaphore = match gpu.device.create_semaphore() { | |||
Ok(s) => s, | |||
Ok(raw) => Semaphore { raw, is_fake: false }, |
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.
Ok(raw) => Semaphore { raw, is_fake: false }, | |
Ok(raw) => Semaphore { | |
raw, | |
is_fake: false, | |
}, |
This comment was generated by: rustfmt
@@ -1847,19 +1888,30 @@ pub extern "C" fn gfxCreateImageView( | |||
pView: *mut VkImageView, | |||
) -> VkResult { | |||
let info = unsafe { &*pCreateInfo }; | |||
if let Image::SwapchainFrame { swapchain, frame } = *info.image { | |||
unsafe { | |||
*pView = Handle::new(ImageView::SwapchainFrame { |
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.
*pView = Handle::new(ImageView::SwapchainFrame { | |
*pView = Handle::new(ImageView::SwapchainFrame { swapchain, frame }); |
This comment was generated by: rustfmt
if let Image::SwapchainFrame { swapchain, frame } = *info.image { | ||
unsafe { | ||
*pView = Handle::new(ImageView::SwapchainFrame { | ||
swapchain, |
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.
swapchain, |
This comment was generated by: rustfmt
unsafe { | ||
*pView = Handle::new(ImageView::SwapchainFrame { | ||
swapchain, | ||
frame, |
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.
frame, |
This comment was generated by: rustfmt
*pView = Handle::new(ImageView::SwapchainFrame { | ||
swapchain, | ||
frame, | ||
}); |
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.
}); |
This comment was generated by: rustfmt
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.
This is autogenerated code-style review, no new suggestions, fix old one
We can't hold this off forever. |
210: Port to the new swapchain model r=kvark a=kvark Closes #208 Fixes #212 Also has general fixes to: - push constant offsets in `gfxCreatePipelineLayout` - destination subresources in `gfxCmdResolveImage` The PR is inviting for discussion: @grovesNL @msiglreith I'm not 100% sure what to do yet. The Good: 1. Being able to remove the old swapchain from gfx-rs COMPLETELY. It was hacky on all the backends other than Vulkan, quite complicated on Metal, and didn't work very in general. 2. Fullscreen support! It's not ideal yet (occasional hitches), but it was pretty much non-functional before. In general, stuff that runs is more robust this change. The Bad: 1. Portability implementation is a bit more complex now, but not extraordinary so. In general, I think it's a win if we move some complication out of gfx-rs into gfx-portability, since gfx-rs has more users, it's more important to keep clean. 2. We can't support recording a render pass that uses a swapchain image if either: - the image is not acquired at the moment of recording - the command buffer is re-usable. We expect the users to strictly acquire-record-submit-present. The Ugly: 1. Our KHR swapchain implementation is more limited: no support for any usage other than COLOR_ATTACHMENT. This is technically valid in Vulkan, but for some reason many apps expect to transfer to/from swapchain images. So this is fine for the matter of CTS and VkPI, but can introduce some friction in real world testing. 2. The new swapchain model itself needs to be evolved a bit more, according to gfx-rs/gfx#3184 . We don't know how exactly: there is both a risk (that we'll need to redo something here) and an opportunity (that we'll support other usages, for example). Co-authored-by: Dzmitry Malyshau <[email protected]>
Timed out. |
bors retry |
210: Port to the new swapchain model r=kvark a=kvark Closes #208 Fixes #212 Also has general fixes to: - push constant offsets in `gfxCreatePipelineLayout` - destination subresources in `gfxCmdResolveImage` The PR is inviting for discussion: @grovesNL @msiglreith I'm not 100% sure what to do yet. The Good: 1. Being able to remove the old swapchain from gfx-rs COMPLETELY. It was hacky on all the backends other than Vulkan, quite complicated on Metal, and didn't work very in general. 2. Fullscreen support! It's not ideal yet (occasional hitches), but it was pretty much non-functional before. In general, stuff that runs is more robust this change. The Bad: 1. Portability implementation is a bit more complex now, but not extraordinary so. In general, I think it's a win if we move some complication out of gfx-rs into gfx-portability, since gfx-rs has more users, it's more important to keep clean. 2. We can't support recording a render pass that uses a swapchain image if either: - the image is not acquired at the moment of recording - the command buffer is re-usable. We expect the users to strictly acquire-record-submit-present. The Ugly: 1. Our KHR swapchain implementation is more limited: no support for any usage other than COLOR_ATTACHMENT. This is technically valid in Vulkan, but for some reason many apps expect to transfer to/from swapchain images. So this is fine for the matter of CTS and VkPI, but can introduce some friction in real world testing. 2. The new swapchain model itself needs to be evolved a bit more, according to gfx-rs/gfx#3184 . We don't know how exactly: there is both a risk (that we'll need to redo something here) and an opportunity (that we'll support other usages, for example). Co-authored-by: Dzmitry Malyshau <[email protected]>
Timed out. |
Closes #208
Fixes #212
Also has general fixes to:
gfxCreatePipelineLayout
gfxCmdResolveImage
The PR is inviting for discussion: @grovesNL @msiglreith
I'm not 100% sure what to do yet.
The Good:
The Bad:
- the image is not acquired at the moment of recording
- the command buffer is re-usable. We expect the users to strictly acquire-record-submit-present.
The Ugly: