Add more wgpu helpers/types (#19548)
Split off from https://github.com/bevyengine/bevy/pull/19058
This commit is contained in:
parent
56f26cfb02
commit
ec307bcb9f
@ -147,6 +147,13 @@ impl<'a> IntoBinding<'a> for &'a TextureView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoBinding<'a> for &'a wgpu::TextureView {
|
||||||
|
#[inline]
|
||||||
|
fn into_binding(self) -> BindingResource<'a> {
|
||||||
|
BindingResource::TextureView(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> IntoBinding<'a> for &'a [&'a wgpu::TextureView] {
|
impl<'a> IntoBinding<'a> for &'a [&'a wgpu::TextureView] {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn into_binding(self) -> BindingResource<'a> {
|
fn into_binding(self) -> BindingResource<'a> {
|
||||||
@ -161,6 +168,13 @@ impl<'a> IntoBinding<'a> for &'a Sampler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoBinding<'a> for &'a [&'a wgpu::Sampler] {
|
||||||
|
#[inline]
|
||||||
|
fn into_binding(self) -> BindingResource<'a> {
|
||||||
|
BindingResource::SamplerArray(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> IntoBinding<'a> for BindingResource<'a> {
|
impl<'a> IntoBinding<'a> for BindingResource<'a> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn into_binding(self) -> BindingResource<'a> {
|
fn into_binding(self) -> BindingResource<'a> {
|
||||||
@ -175,6 +189,13 @@ impl<'a> IntoBinding<'a> for wgpu::BufferBinding<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> IntoBinding<'a> for &'a [wgpu::BufferBinding<'a>] {
|
||||||
|
#[inline]
|
||||||
|
fn into_binding(self) -> BindingResource<'a> {
|
||||||
|
BindingResource::BufferArray(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub trait IntoBindingArray<'b, const N: usize> {
|
pub trait IntoBindingArray<'b, const N: usize> {
|
||||||
fn into_array(self) -> [BindingResource<'b>; N];
|
fn into_array(self) -> [BindingResource<'b>; N];
|
||||||
}
|
}
|
||||||
|
@ -568,4 +568,8 @@ pub mod binding_types {
|
|||||||
}
|
}
|
||||||
.into_bind_group_layout_entry_builder()
|
.into_bind_group_layout_entry_builder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn acceleration_structure() -> BindGroupLayoutEntryBuilder {
|
||||||
|
BindingType::AccelerationStructure.into_bind_group_layout_entry_builder()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,18 +38,21 @@ pub use wgpu::{
|
|||||||
BufferInitDescriptor, DispatchIndirectArgs, DrawIndexedIndirectArgs, DrawIndirectArgs,
|
BufferInitDescriptor, DispatchIndirectArgs, DrawIndexedIndirectArgs, DrawIndirectArgs,
|
||||||
TextureDataOrder,
|
TextureDataOrder,
|
||||||
},
|
},
|
||||||
AdapterInfo as WgpuAdapterInfo, AddressMode, AstcBlock, AstcChannel, BindGroupDescriptor,
|
AccelerationStructureFlags, AccelerationStructureGeometryFlags,
|
||||||
BindGroupEntry, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType,
|
AccelerationStructureUpdateMode, AdapterInfo as WgpuAdapterInfo, AddressMode, AstcBlock,
|
||||||
|
AstcChannel, BindGroupDescriptor, BindGroupEntry, BindGroupLayoutDescriptor,
|
||||||
|
BindGroupLayoutEntry, BindingResource, BindingType, Blas, BlasBuildEntry, BlasGeometries,
|
||||||
|
BlasGeometrySizeDescriptors, BlasTriangleGeometry, BlasTriangleGeometrySizeDescriptor,
|
||||||
BlendComponent, BlendFactor, BlendOperation, BlendState, BufferAddress, BufferAsyncError,
|
BlendComponent, BlendFactor, BlendOperation, BlendState, BufferAddress, BufferAsyncError,
|
||||||
BufferBinding, BufferBindingType, BufferDescriptor, BufferSize, BufferUsages, ColorTargetState,
|
BufferBinding, BufferBindingType, BufferDescriptor, BufferSize, BufferUsages, ColorTargetState,
|
||||||
ColorWrites, CommandEncoder, CommandEncoderDescriptor, CompareFunction, ComputePass,
|
ColorWrites, CommandEncoder, CommandEncoderDescriptor, CompareFunction, ComputePass,
|
||||||
ComputePassDescriptor, ComputePipelineDescriptor as RawComputePipelineDescriptor,
|
ComputePassDescriptor, ComputePipelineDescriptor as RawComputePipelineDescriptor,
|
||||||
DepthBiasState, DepthStencilState, DownlevelFlags, Extent3d, Face, Features as WgpuFeatures,
|
CreateBlasDescriptor, CreateTlasDescriptor, DepthBiasState, DepthStencilState, DownlevelFlags,
|
||||||
FilterMode, FragmentState as RawFragmentState, FrontFace, ImageSubresourceRange, IndexFormat,
|
Extent3d, Face, Features as WgpuFeatures, FilterMode, FragmentState as RawFragmentState,
|
||||||
Limits as WgpuLimits, LoadOp, Maintain, MapMode, MultisampleState, Operations, Origin3d,
|
FrontFace, ImageSubresourceRange, IndexFormat, Limits as WgpuLimits, LoadOp, Maintain, MapMode,
|
||||||
PipelineCompilationOptions, PipelineLayout, PipelineLayoutDescriptor, PolygonMode,
|
MultisampleState, Operations, Origin3d, PipelineCompilationOptions, PipelineLayout,
|
||||||
PrimitiveState, PrimitiveTopology, PushConstantRange, RenderPassColorAttachment,
|
PipelineLayoutDescriptor, PolygonMode, PrimitiveState, PrimitiveTopology, PushConstantRange,
|
||||||
RenderPassDepthStencilAttachment, RenderPassDescriptor,
|
RenderPassColorAttachment, RenderPassDepthStencilAttachment, RenderPassDescriptor,
|
||||||
RenderPipelineDescriptor as RawRenderPipelineDescriptor, Sampler as WgpuSampler,
|
RenderPipelineDescriptor as RawRenderPipelineDescriptor, Sampler as WgpuSampler,
|
||||||
SamplerBindingType, SamplerBindingType as WgpuSamplerBindingType, SamplerDescriptor,
|
SamplerBindingType, SamplerBindingType as WgpuSamplerBindingType, SamplerDescriptor,
|
||||||
ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, StencilFaceState,
|
ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, StencilFaceState,
|
||||||
@ -57,8 +60,9 @@ pub use wgpu::{
|
|||||||
TexelCopyBufferLayout, TexelCopyTextureInfo, TextureAspect, TextureDescriptor,
|
TexelCopyBufferLayout, TexelCopyTextureInfo, TextureAspect, TextureDescriptor,
|
||||||
TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures,
|
TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures,
|
||||||
TextureSampleType, TextureUsages, TextureView as WgpuTextureView, TextureViewDescriptor,
|
TextureSampleType, TextureUsages, TextureView as WgpuTextureView, TextureViewDescriptor,
|
||||||
TextureViewDimension, VertexAttribute, VertexBufferLayout as RawVertexBufferLayout,
|
TextureViewDimension, Tlas, TlasInstance, TlasPackage, VertexAttribute,
|
||||||
VertexFormat, VertexState as RawVertexState, VertexStepMode, COPY_BUFFER_ALIGNMENT,
|
VertexBufferLayout as RawVertexBufferLayout, VertexFormat, VertexState as RawVertexState,
|
||||||
|
VertexStepMode, COPY_BUFFER_ALIGNMENT,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use crate::mesh::VertexBufferLayout;
|
pub use crate::mesh::VertexBufferLayout;
|
||||||
|
Loading…
Reference in New Issue
Block a user