Skip to content

Commit

Permalink
Expose PARTIALLY_BOUND_BINDING_ARRAY & STORAGE_RESOURCE_BINDING_ARRAY (
Browse files Browse the repository at this point in the history
  • Loading branch information
rajveermalviya authored Mar 7, 2024
1 parent de6a6ec commit 0e726fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ffi/wgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ typedef enum WGPUNativeFeature {
WGPUNativeFeature_TextureBindingArray = 0x00030006,
WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing = 0x00030007,
WGPUNativeFeature_PipelineStatisticsQuery = 0x00030008,
WGPUNativeFeature_StorageResourceBindingArray = 0x00030009,
WGPUNativeFeature_PartiallyBoundBindingArray = 0x0003000A,
WGPUNativeFeature_Force32 = 0x7FFFFFFF
} WGPUNativeFeature;

Expand Down
8 changes: 8 additions & 0 deletions src/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,12 @@ pub fn features_to_native(features: wgt::Features) -> Vec<native::WGPUFeatureNam
if features.contains(wgt::Features::PIPELINE_STATISTICS_QUERY) {
temp.push(native::WGPUNativeFeature_PipelineStatisticsQuery);
}
if features.contains(wgt::Features::STORAGE_RESOURCE_BINDING_ARRAY) {
temp.push(native::WGPUNativeFeature_StorageResourceBindingArray);
}
if features.contains(wgt::Features::PARTIALLY_BOUND_BINDING_ARRAY) {
temp.push(native::WGPUNativeFeature_PartiallyBoundBindingArray);
}

temp
}
Expand Down Expand Up @@ -1140,6 +1146,8 @@ pub fn map_feature(feature: native::WGPUFeatureName) -> Option<wgt::Features> {
native::WGPUNativeFeature_TextureBindingArray => Some(Features::TEXTURE_BINDING_ARRAY),
native::WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing => Some(Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING),
native::WGPUNativeFeature_PipelineStatisticsQuery => Some(Features::PIPELINE_STATISTICS_QUERY),
native::WGPUNativeFeature_StorageResourceBindingArray => Some(Features::STORAGE_RESOURCE_BINDING_ARRAY),
native::WGPUNativeFeature_PartiallyBoundBindingArray => Some(Features::PARTIALLY_BOUND_BINDING_ARRAY),
// fallback, probably not available in wgpu-core
_ => None,
}
Expand Down

0 comments on commit 0e726fd

Please sign in to comment.