mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 10:03:58 +01:00
API update with naming, formats, and extra fields
This commit is contained in:
1 parent
75201773a7
commit
6a1dcb9565
15 files changed
+308
-311
No files matched your search
@@ -1,4 +1,4 @@
|
||||
use crate::{hub::HUB, AdapterHandle, AdapterId, DeviceHandle, InstanceId, SurfaceHandle};
|
||||
use crate::{binding_model::MAX_BIND_GROUPS, hub::HUB, AdapterHandle, AdapterId, DeviceHandle, InstanceId, SurfaceHandle};
|
||||
#[cfg(feature = "local")]
|
||||
use crate::{DeviceId, SurfaceId};
|
||||
|
||||
@@ -26,17 +26,33 @@ pub struct AdapterDescriptor {
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
#[cfg_attr(feature = "remote", derive(Clone, Serialize, Deserialize))]
|
||||
pub struct Extensions {
|
||||
pub anisotropic_filtering: bool,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "remote", derive(Clone, Serialize, Deserialize))]
|
||||
pub struct Limits {
|
||||
pub max_bind_groups: u32,
|
||||
}
|
||||
|
||||
impl Default for Limits {
|
||||
fn default() -> Self {
|
||||
Limits {
|
||||
max_bind_groups: MAX_BIND_GROUPS as u32,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(feature = "remote", derive(Clone, Serialize, Deserialize))]
|
||||
pub struct DeviceDescriptor {
|
||||
pub extensions: Extensions,
|
||||
pub limits: Limits,
|
||||
}
|
||||
|
||||
pub fn create_instance() -> ::back::Instance {
|
||||
@@ -186,7 +202,7 @@ pub fn adapter_create_device(adapter_id: AdapterId, _desc: &DeviceDescriptor) ->
|
||||
|
||||
#[cfg(feature = "local")]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_adapter_create_device(
|
||||
pub extern "C" fn wgpu_adapter_request_device(
|
||||
adapter_id: AdapterId,
|
||||
desc: &DeviceDescriptor,
|
||||
) -> DeviceId {
|
||||
|
||||
Reference in new issue
Block a user