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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Vec::set_len() after checking for Vulkan errors #684

Merged
merged 1 commit into from Nov 22, 2022

Commits on Nov 22, 2022

  1. Call Vec::set_len() after checking for Vulkan errors

    The entire reason for calling `unsafe` `set_len()` after the Vulkan
    driver function call is to ensure the `Vec` never gives safe access to
    uninitialized values (as allocted via `Vec::with_capacity()`).  This
    contract is broken within the implementation of these functions by
    temporarily setting a nonzero length when the Vulkan driver may not have
    initialized the underlying data at all, and communicated this by
    returning an error code.
    
    Simply check the error code first, before jumping to a now-infallible
    codepath that calls `.set_len()` and always returns `Ok()`.
    MarijnS95 committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    8f22389 View commit details
    Browse the repository at this point in the history