vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.48k stars 433 forks source link

PhysicalDevice::surface_present_modes should return Vec result #2496

Closed maratik123 closed 6 months ago

maratik123 commented 6 months ago

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. [x] Run cargo clippy on the changes.

  4. [x] Run cargo +nightly fmt on the changes.

  5. [x] 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. [x] 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>`.