From c4e3fb4d36ae15419dd15bdf8ecb5d25c86de577 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 16 Mar 2020 12:01:57 -0400 Subject: [PATCH] Add texture component type field to BGL entry --- ffi/wgpu.h | 7 +++++++ wgpu-core/src/binding_model.rs | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/ffi/wgpu.h b/ffi/wgpu.h index 905955eae..c8c97d65d 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -180,6 +180,12 @@ typedef enum { WGPUTextureAspect_DepthOnly, } WGPUTextureAspect; +typedef enum { + WGPUTextureComponentType_Float, + WGPUTextureComponentType_Sint, + WGPUTextureComponentType_Uint, +} WGPUTextureComponentType; + typedef enum { WGPUTextureDimension_D1, WGPUTextureDimension_D2, @@ -482,6 +488,7 @@ typedef struct { bool multisampled; bool has_dynamic_offset; WGPUTextureViewDimension view_dimension; + WGPUTextureComponentType texture_component_type; WGPUTextureFormat storage_texture_format; } WGPUBindGroupLayoutEntry; diff --git a/wgpu-core/src/binding_model.rs b/wgpu-core/src/binding_model.rs index 55d1ef1fe..ff6729e9d 100644 --- a/wgpu-core/src/binding_model.rs +++ b/wgpu-core/src/binding_model.rs @@ -33,6 +33,15 @@ pub enum BindingType { WriteonlyStorageTexture = 7, } +#[repr(C)] +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))] +pub enum TextureComponentType { + Float, + Sint, + Uint, +} + #[repr(C)] #[derive(Clone, Debug, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))] @@ -43,6 +52,7 @@ pub struct BindGroupLayoutEntry { pub multisampled: bool, pub has_dynamic_offset: bool, pub view_dimension: wgt::TextureViewDimension, + pub texture_component_type: TextureComponentType, pub storage_texture_format: wgt::TextureFormat, }