Skip to content
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

PhysicalDevice::surface_present_modes should return Vec result #2496

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

maratik123
Copy link
Contributor

@maratik123 maratik123 commented Mar 13, 2024

PhysicalDevice::surface_present_modes should return Vec result as any other this struct functions for consistency and to eliminate composing result back to Vec in outer crate usages, such as:

    let present_mode = physical_device
        .surface_present_modes(surface, SurfaceInfo::default())?
        .collect();
    Ok(SwapChainSupportDetails {
        _capabilities: capabilities,
        formats,
        present_mode,
    })
  1. Update documentation to reflect any user-facing changes - in this repository.

  2. Make sure that the changes are covered by unit-tests: no unit-test exists to cover these functions

  3. Run cargo clippy on the changes.

  4. Run cargo +nightly fmt on the changes.

  5. Please put changelog entries in the description of this Pull Request
    if knowledge of this change could be valuable to users. No need to put the
    entries to the changelog directly, they will be transferred to the changelog
    file by maintainers right after the Pull Request merge.

    Please remove any items from the template below that are not applicable.

  6. Describe in common words what is the purpose of this change, related
    Github Issues, and highlight important implementation aspects.

Changelog:

### Breaking changes
Changes to `PhysicalDevice`:
- Return type of function `surface_present_modes` changed to `Result<Vec<PresentMode>, VulkanError>`.
- Return type of function `surface_present_modes_unchecked` changed to `Result<Vec<PresentMode>, VulkanError>`.

… other this struct functions for consistency and to eliminate composing result back to Vec in outer usages, such as:

```rust
    let present_mode = physical_device
        .surface_present_modes(surface, SurfaceInfo::default())?
        .collect();
    Ok(SwapChainSupportDetails {
        _capabilities: capabilities,
        formats,
        present_mode,
    })
```
@Rua Rua merged commit 3472daa into vulkano-rs:master Mar 13, 2024
5 checks passed
Rua added a commit that referenced this pull request Mar 13, 2024
@maratik123 maratik123 deleted the surface_present_modes_vec branch March 13, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants