Struct wgpu_core::hub::Global [−][src]
pub struct Global<G: GlobalIdentityHandlerFactory> {
pub instance: Instance,
pub surfaces: Registry<Surface, SurfaceId, G>,
// some fields omitted
}
Fields
instance: Instance
surfaces: Registry<Surface, SurfaceId, G>
Implementations
pub fn command_encoder_clear_buffer<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
dst: BufferId,
offset: BufferAddress,
size: Option<BufferSize>
) -> Result<(), ClearError>
pub fn command_encoder_clear_image<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
dst: TextureId,
subresource_range: &ImageSubresourceRange
) -> Result<(), ClearError>
pub fn command_encoder_run_compute_pass<A: HalApi>(
&self,
encoder_id: CommandEncoderId,
pass: &ComputePass
) -> Result<(), ComputePassError>
pub fn command_encoder_write_timestamp<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
query_set_id: QuerySetId,
query_index: u32
) -> Result<(), QueryError>
pub fn command_encoder_resolve_query_set<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
query_set_id: QuerySetId,
start_query: u32,
query_count: u32,
destination: BufferId,
destination_offset: BufferAddress
) -> Result<(), QueryError>
pub fn command_encoder_run_render_pass<A: HalApi>(
&self,
encoder_id: CommandEncoderId,
pass: &RenderPass
) -> Result<(), RenderPassError>
pub fn command_encoder_copy_buffer_to_buffer<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
source: BufferId,
source_offset: BufferAddress,
destination: BufferId,
destination_offset: BufferAddress,
size: BufferAddress
) -> Result<(), CopyError>
pub fn command_encoder_copy_buffer_to_texture<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
source: &ImageCopyBuffer,
destination: &ImageCopyTexture,
copy_size: &Extent3d
) -> Result<(), CopyError>
pub fn command_encoder_copy_texture_to_buffer<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
source: &ImageCopyTexture,
destination: &ImageCopyBuffer,
copy_size: &Extent3d
) -> Result<(), CopyError>
pub fn command_encoder_copy_texture_to_texture<A: HalApi>(
&self,
command_encoder_id: CommandEncoderId,
source: &ImageCopyTexture,
destination: &ImageCopyTexture,
copy_size: &Extent3d
) -> Result<(), CopyError>
pub fn command_encoder_finish<A: HalApi>(
&self,
encoder_id: CommandEncoderId,
_desc: &CommandBufferDescriptor<Label<'_>>
) -> (CommandBufferId, Option<CommandEncoderError>)
pub fn command_encoder_push_debug_group<A: HalApi>(
&self,
encoder_id: CommandEncoderId,
label: &str
) -> Result<(), CommandEncoderError>
pub fn command_encoder_insert_debug_marker<A: HalApi>(
&self,
encoder_id: CommandEncoderId,
label: &str
) -> Result<(), CommandEncoderError>
pub fn command_encoder_pop_debug_group<A: HalApi>(
&self,
encoder_id: CommandEncoderId
) -> Result<(), CommandEncoderError>
pub fn queue_write_buffer<A: HalApi>(
&self,
queue_id: QueueId,
buffer_id: BufferId,
buffer_offset: BufferAddress,
data: &[u8]
) -> Result<(), QueueWriteError>
pub fn queue_write_texture<A: HalApi>(
&self,
queue_id: QueueId,
destination: &ImageCopyTexture,
data: &[u8],
data_layout: &ImageDataLayout,
size: &Extent3d
) -> Result<(), QueueWriteError>
pub fn queue_submit<A: HalApi>(
&self,
queue_id: QueueId,
command_buffer_ids: &[CommandBufferId]
) -> Result<(), QueueSubmitError>
pub fn queue_get_timestamp_period<A: HalApi>(
&self,
queue_id: QueueId
) -> Result<f32, InvalidQueue>
pub fn queue_on_submitted_work_done<A: HalApi>(
&self,
queue_id: QueueId,
closure: SubmittedWorkDoneClosure
) -> Result<(), InvalidQueue>
pub fn adapter_is_surface_supported<A: HalApi>(
&self,
adapter_id: AdapterId,
surface_id: SurfaceId
) -> Result<bool, IsSurfaceSupportedError>
pub fn surface_get_preferred_format<A: HalApi>(
&self,
surface_id: SurfaceId,
adapter_id: AdapterId
) -> Result<TextureFormat, GetSurfacePreferredFormatError>
pub fn device_features<A: HalApi>(
&self,
device_id: DeviceId
) -> Result<Features, InvalidDevice>
pub fn device_downlevel_properties<A: HalApi>(
&self,
device_id: DeviceId
) -> Result<DownlevelCapabilities, InvalidDevice>
pub fn device_create_buffer<A: HalApi>(
&self,
device_id: DeviceId,
desc: &BufferDescriptor<'_>,
id_in: Input<G, BufferId>
) -> (BufferId, Option<CreateBufferError>)
pub fn device_create_texture<A: HalApi>(
&self,
device_id: DeviceId,
desc: &TextureDescriptor<'_>,
id_in: Input<G, TextureId>
) -> (TextureId, Option<CreateTextureError>)
pub unsafe fn create_texture_from_hal<A: HalApi>(
&self,
hal_texture: A::Texture,
device_id: DeviceId,
desc: &TextureDescriptor<'_>,
id_in: Input<G, TextureId>
) -> (TextureId, Option<CreateTextureError>)
pub unsafe fn create_texture_from_hal<A: HalApi>(
&self,
hal_texture: A::Texture,
device_id: DeviceId,
desc: &TextureDescriptor<'_>,
id_in: Input<G, TextureId>
) -> (TextureId, Option<CreateTextureError>)
Safety
hal_texture
must be created fromdevice_id
corresponding raw handle.hal_texture
must be created respectingdesc
pub fn texture_create_view<A: HalApi>(
&self,
texture_id: TextureId,
desc: &TextureViewDescriptor<'_>,
id_in: Input<G, TextureViewId>
) -> (TextureViewId, Option<CreateTextureViewError>)
pub fn texture_view_drop<A: HalApi>(
&self,
texture_view_id: TextureViewId,
wait: bool
) -> Result<(), TextureViewDestroyError>
pub fn device_create_sampler<A: HalApi>(
&self,
device_id: DeviceId,
desc: &SamplerDescriptor<'_>,
id_in: Input<G, SamplerId>
) -> (SamplerId, Option<CreateSamplerError>)
pub fn device_create_bind_group_layout<A: HalApi>(
&self,
device_id: DeviceId,
desc: &BindGroupLayoutDescriptor<'_>,
id_in: Input<G, BindGroupLayoutId>
) -> (BindGroupLayoutId, Option<CreateBindGroupLayoutError>)
pub fn device_create_pipeline_layout<A: HalApi>(
&self,
device_id: DeviceId,
desc: &PipelineLayoutDescriptor<'_>,
id_in: Input<G, PipelineLayoutId>
) -> (PipelineLayoutId, Option<CreatePipelineLayoutError>)
pub fn device_create_bind_group<A: HalApi>(
&self,
device_id: DeviceId,
desc: &BindGroupDescriptor<'_>,
id_in: Input<G, BindGroupId>
) -> (BindGroupId, Option<CreateBindGroupError>)
pub fn device_create_shader_module<A: HalApi>(
&self,
device_id: DeviceId,
desc: &ShaderModuleDescriptor<'_>,
source: ShaderModuleSource<'_>,
id_in: Input<G, ShaderModuleId>
) -> (ShaderModuleId, Option<CreateShaderModuleError>)
pub unsafe fn device_create_shader_module_spirv<A: HalApi>(
&self,
device_id: DeviceId,
desc: &ShaderModuleDescriptor<'_>,
source: Cow<'_, [u32]>,
id_in: Input<G, ShaderModuleId>
) -> (ShaderModuleId, Option<CreateShaderModuleError>)
pub unsafe fn device_create_shader_module_spirv<A: HalApi>(
&self,
device_id: DeviceId,
desc: &ShaderModuleDescriptor<'_>,
source: Cow<'_, [u32]>,
id_in: Input<G, ShaderModuleId>
) -> (ShaderModuleId, Option<CreateShaderModuleError>)
Safety
This function passes SPIR-V binary to the backend as-is and can potentially result in a driver crash.
pub fn device_create_command_encoder<A: HalApi>(
&self,
device_id: DeviceId,
desc: &CommandEncoderDescriptor<Label<'_>>,
id_in: Input<G, CommandEncoderId>
) -> (CommandEncoderId, Option<DeviceError>)
pub fn device_create_render_bundle_encoder(
&self,
device_id: DeviceId,
desc: &RenderBundleEncoderDescriptor<'_>
) -> (RenderBundleEncoderId, Option<CreateRenderBundleError>)
pub fn render_bundle_encoder_finish<A: HalApi>(
&self,
bundle_encoder: RenderBundleEncoder,
desc: &RenderBundleDescriptor<'_>,
id_in: Input<G, RenderBundleId>
) -> (RenderBundleId, Option<RenderBundleError>)
pub fn device_create_query_set<A: HalApi>(
&self,
device_id: DeviceId,
desc: &QuerySetDescriptor<'_>,
id_in: Input<G, QuerySetId>
) -> (QuerySetId, Option<CreateQuerySetError>)
pub fn device_create_render_pipeline<A: HalApi>(
&self,
device_id: DeviceId,
desc: &RenderPipelineDescriptor<'_>,
id_in: Input<G, RenderPipelineId>,
implicit_pipeline_ids: Option<ImplicitPipelineIds<'_, G>>
) -> (RenderPipelineId, Option<CreateRenderPipelineError>)
pub fn render_pipeline_get_bind_group_layout<A: HalApi>(
&self,
pipeline_id: RenderPipelineId,
index: u32,
id_in: Input<G, BindGroupLayoutId>
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
pub fn render_pipeline_get_bind_group_layout<A: HalApi>(
&self,
pipeline_id: RenderPipelineId,
index: u32,
id_in: Input<G, BindGroupLayoutId>
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
Get an ID of one of the bind group layouts. The ID adds a refcount,
which needs to be released by calling bind_group_layout_drop
.
pub fn device_create_compute_pipeline<A: HalApi>(
&self,
device_id: DeviceId,
desc: &ComputePipelineDescriptor<'_>,
id_in: Input<G, ComputePipelineId>,
implicit_pipeline_ids: Option<ImplicitPipelineIds<'_, G>>
) -> (ComputePipelineId, Option<CreateComputePipelineError>)
pub fn compute_pipeline_get_bind_group_layout<A: HalApi>(
&self,
pipeline_id: ComputePipelineId,
index: u32,
id_in: Input<G, BindGroupLayoutId>
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
pub fn compute_pipeline_get_bind_group_layout<A: HalApi>(
&self,
pipeline_id: ComputePipelineId,
index: u32,
id_in: Input<G, BindGroupLayoutId>
) -> (BindGroupLayoutId, Option<GetBindGroupLayoutError>)
Get an ID of one of the bind group layouts. The ID adds a refcount,
which needs to be released by calling bind_group_layout_drop
.
pub fn surface_configure<A: HalApi>(
&self,
surface_id: SurfaceId,
device_id: DeviceId,
config: &SurfaceConfiguration
) -> Option<ConfigureSurfaceError>
pub fn device_poll<A: HalApi>(
&self,
device_id: DeviceId,
force_wait: bool
) -> Result<(), WaitIdleError>
pub fn buffer_map_async<A: HalApi>(
&self,
buffer_id: BufferId,
range: Range<BufferAddress>,
op: BufferMapOperation
) -> Result<(), BufferAccessError>
pub fn buffer_get_mapped_range<A: HalApi>(
&self,
buffer_id: BufferId,
offset: BufferAddress,
size: Option<BufferAddress>
) -> Result<(*mut u8, u64), BufferAccessError>
pub unsafe fn from_hal_instance<A: HalApi>(
name: &str,
factory: G,
hal_instance: A::Instance
) -> Self
pub unsafe fn from_hal_instance<A: HalApi>(
name: &str,
factory: G,
hal_instance: A::Instance
) -> Self
Safety
Refer to the creation of wgpu-hal Instance for every backend.
pub fn enumerate_adapters(
&self,
inputs: AdapterInputs<'_, Input<G, AdapterId>>
) -> Vec<AdapterId>
pub fn request_adapter(
&self,
desc: &RequestAdapterOptions,
inputs: AdapterInputs<'_, Input<G, AdapterId>>
) -> Result<AdapterId, RequestAdapterError>
pub unsafe fn create_adapter_from_hal<A: HalApi>(
&self,
hal_adapter: ExposedAdapter<A>,
input: Input<G, AdapterId>
) -> AdapterId
pub unsafe fn create_adapter_from_hal<A: HalApi>(
&self,
hal_adapter: ExposedAdapter<A>,
input: Input<G, AdapterId>
) -> AdapterId
Safety
hal_adapter
must be created from this global internal instance handle.
pub fn adapter_get_info<A: HalApi>(
&self,
adapter_id: AdapterId
) -> Result<AdapterInfo, InvalidAdapter>
pub fn adapter_get_texture_format_features<A: HalApi>(
&self,
adapter_id: AdapterId,
format: TextureFormat
) -> Result<TextureFormatFeatures, InvalidAdapter>
pub fn adapter_features<A: HalApi>(
&self,
adapter_id: AdapterId
) -> Result<Features, InvalidAdapter>
pub fn adapter_limits<A: HalApi>(
&self,
adapter_id: AdapterId
) -> Result<Limits, InvalidAdapter>
pub fn adapter_downlevel_properties<A: HalApi>(
&self,
adapter_id: AdapterId
) -> Result<DownlevelCapabilities, InvalidAdapter>
pub fn adapter_request_device<A: HalApi>(
&self,
adapter_id: AdapterId,
desc: &DeviceDescriptor<'_>,
trace_path: Option<&Path>,
id_in: Input<G, DeviceId>
) -> (DeviceId, Option<RequestDeviceError>)
pub unsafe fn create_device_from_hal<A: HalApi>(
&self,
adapter_id: AdapterId,
hal_device: OpenDevice<A>,
desc: &DeviceDescriptor<'_>,
trace_path: Option<&Path>,
id_in: Input<G, DeviceId>
) -> (DeviceId, Option<RequestDeviceError>)
pub unsafe fn create_device_from_hal<A: HalApi>(
&self,
adapter_id: AdapterId,
hal_device: OpenDevice<A>,
desc: &DeviceDescriptor<'_>,
trace_path: Option<&Path>,
id_in: Input<G, DeviceId>
) -> (DeviceId, Option<RequestDeviceError>)
Safety
hal_device
must be created fromadapter_id
or its internal handle.desc
must be a subset ofhal_device
features and limits.