Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Aug 29, 2024
1 parent 9fc9fbf commit a8896cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 0 additions & 7 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,6 @@ impl PhysicalDeviceFeatures {
None
},
robustness2: if enabled_extensions.contains(&ext::robustness2::NAME) {
// Ordinary `robust_buffer_access`, as provided by Vulkan 1.0
// without extensions, is not sufficient to meet WebGPU's
// requirements: it only promises that
//
// Note: enabling `robust_buffer_access2` isn't required, strictly speaking
// since we can enable `robust_buffer_access` all the time. But it improves
// program portability, so we opt into it if they are supported.
Some(
vk::PhysicalDeviceRobustness2FeaturesEXT::default()
.robust_buffer_access2(private_caps.robust_buffer_access2)
Expand Down
19 changes: 19 additions & 0 deletions wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,27 @@ struct PrivateCapabilities {
/// Ability to present contents to any screen. Only needed to work around broken platform configurations.
can_present: bool,
non_coherent_map_mask: wgt::BufferAddress,

/// True if this adapter advertises the [`robustBufferAccess`][vrba] feature.
///
/// Note that `robustBufferAccess` *would* suffice to meet WebGPU's
/// requirements for out-of-bounds accesses, but not if `wgpu-core` uses
/// deferred buffer initialization.
///
/// Vulkan and WebGPU agree on the definition of out-of-bounds access, and
/// enabling `robustBufferAccess` ensures that out-of-bounds accesses will,
/// at worst, read other contents from the same buffer. However,
///
/// [vrba]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-robustBufferAccess
robust_buffer_access: bool,
robust_image_access: bool,
// Ordinary `robust_buffer_access`, as provided by Vulkan 1.0
// without extensions, is sufficient to meet WebGPU's
// requirements, but not sufficient
//
// Note: enabling `robust_buffer_access2` isn't required, strictly speaking
// since we can enable `robust_buffer_access` all the time. But it improves
// program portability, so we opt into it if they are supported.
robust_buffer_access2: bool,
robust_image_access2: bool,
zero_initialize_workgroup_memory: bool,
Expand Down

0 comments on commit a8896cd

Please sign in to comment.