Skip to content

Commit

Permalink
Merge gfx-rs#521
Browse files Browse the repository at this point in the history
521: Texture component type r=kvark a=kvark

Matching the upstream spec...

Co-authored-by: Dzmitry Malyshau <[email protected]>
  • Loading branch information
bors[bot] and kvark authored Mar 17, 2020
2 parents f836db8 + c4e3fb4 commit d3e47fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ffi/wgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ typedef enum {
WGPUTextureAspect_DepthOnly,
} WGPUTextureAspect;

typedef enum {
WGPUTextureComponentType_Float,
WGPUTextureComponentType_Sint,
WGPUTextureComponentType_Uint,
} WGPUTextureComponentType;

typedef enum {
WGPUTextureDimension_D1,
WGPUTextureDimension_D2,
Expand Down Expand Up @@ -482,6 +488,7 @@ typedef struct {
bool multisampled;
bool has_dynamic_offset;
WGPUTextureViewDimension view_dimension;
WGPUTextureComponentType texture_component_type;
WGPUTextureFormat storage_texture_format;
} WGPUBindGroupLayoutEntry;

Expand Down
10 changes: 10 additions & 0 deletions wgpu-core/src/binding_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand All @@ -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,
}

Expand Down

0 comments on commit d3e47fc

Please sign in to comment.