type DeviceResult<T> = Result<T, crate::DeviceError>;
implcrate::Api for Api { const VARIANT: wgt::Backend = wgt::Backend::Noop;
type Instance = Context; type Surface = Context; type Adapter = Context; type Device = Context;
type Queue = Context; type CommandEncoder = CommandBuffer; type CommandBuffer = CommandBuffer;
type Buffer = Buffer; type Texture = Resource; type SurfaceTexture = Resource; type TextureView = Resource; type Sampler = Resource; type QuerySet = Resource; type Fence = Fence; type AccelerationStructure = Resource; type PipelineCache = Resource;
type BindGroupLayout = Resource; type BindGroup = Resource; type PipelineLayout = Resource; type ShaderModule = Resource; type RenderPipeline = Resource; type ComputePipeline = Resource;
}
implcrate::DynAccelerationStructure for Resource {} implcrate::DynBindGroup for Resource {} implcrate::DynBindGroupLayout for Resource {} implcrate::DynBuffer for Buffer {} implcrate::DynCommandBuffer for CommandBuffer {} implcrate::DynComputePipeline for Resource {} implcrate::DynFence for Fence {} implcrate::DynPipelineCache for Resource {} implcrate::DynPipelineLayout for Resource {} implcrate::DynQuerySet for Resource {} implcrate::DynRenderPipeline for Resource {} implcrate::DynSampler for Resource {} implcrate::DynShaderModule for Resource {} implcrate::DynSurfaceTexture for Resource {} implcrate::DynTexture for Resource {} implcrate::DynTextureView for Resource {}
/// Returns the adapter info for the noop backend. /// /// This is used in the test harness to construct info about /// the noop backend adapter without actually initializing wgpu. pubfn adapter_info() -> wgt::AdapterInfo {
wgt::AdapterInfo {
name: String::from("noop wgpu backend"),
driver: String::from("wgpu"),
..wgt::AdapterInfo::new(wgt::DeviceType::Cpu, wgt::Backend::Noop)
}
}
/// The capabilities of the noop backend. /// /// This is used in the test harness to construct capabilities /// of the noop backend without actually initializing wgpu. pubconst CAPABILITIES: crate::Capabilities = { crate::Capabilities {
limits: wgt::Limits::unlimited(),
alignments: crate::Alignments { // All maximally permissive
buffer_copy_offset: wgt::BufferSize::MIN,
buffer_copy_pitch: wgt::BufferSize::MIN,
uniform_bounds_check_alignment: wgt::BufferSize::MIN,
raw_tlas_instance_size: 0,
ray_tracing_scratch_buffer_alignment: 1,
},
downlevel: wgt::DownlevelCapabilities {
flags: wgt::DownlevelFlags::all(),
limits: wgt::DownlevelLimits {},
shader_model: wgt::ShaderModel::Sm5,
},
cooperative_matrix_properties: Vec::new(),
}
};
unsafefn map_buffer(
&self,
buffer: &Buffer,
range: crate::MemoryRange,
) -> DeviceResult<crate::BufferMapping> { // Safety: the `wgpu-core` validation layer will prevent any user-accessible aliasing // mappings from being created, so we don’t need to perform any checks here, except for // bounds checks on the range which are built into `get_slice_ptr()`.
Ok(crate::BufferMapping {
ptr: ptr::NonNull::new(buffer.get_slice_ptr(range).cast::<u8>()).unwrap(),
is_coherent: true,
})
} unsafefn unmap_buffer(&self, buffer: &Buffer) {} unsafefn flush_mapped_ranges<I>(&self, buffer: &Buffer, ranges: I) {} unsafefn invalidate_mapped_ranges<I>(&self, buffer: &Buffer, ranges: I) {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.