Add optional border_color to SamplerDescriptor

This commit is contained in:
Justin Shrake committed 2020-08-22 22:00:33 -07:00
1 parent 854b3f1c5d
commit 04da221db4
4 files changed
+17 -12

No files matched your search

+6 -6
View File
@@ -24,16 +24,16 @@ vulkan-portability = ["wgc/gfx-backend-vulkan"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
version = "0.6"
#git = "https://github.com/gfx-rs/wgpu"
#rev = "096c57008f2907c07ddaa7d0ff02fae21a5e676b"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "0bb6bb8647a652e82c795fdc27a282e131d7cba3"
features = ["raw-window-handle"]
[dependencies.wgt]
package = "wgpu-types"
version = "0.6"
#git = "https://github.com/gfx-rs/wgpu"
#rev = "096c57008f2907c07ddaa7d0ff02fae21a5e676b"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "0bb6bb8647a652e82c795fdc27a282e131d7cba3"
[dependencies]
arrayvec = "0.5"
+1
View File
@@ -846,6 +846,7 @@ impl crate::Context for Context {
lod_max_clamp: desc.lod_max_clamp,
compare: desc.compare,
anisotropy_clamp: desc.anisotropy_clamp,
border_color: desc.border_color,
},
PhantomData
))
+1
View File
@@ -610,6 +610,7 @@ fn map_address_mode(mode: wgt::AddressMode) -> web_sys::GpuAddressMode {
wgt::AddressMode::ClampToEdge => web_sys::GpuAddressMode::ClampToEdge,
wgt::AddressMode::Repeat => web_sys::GpuAddressMode::Repeat,
wgt::AddressMode::MirrorRepeat => web_sys::GpuAddressMode::MirrorRepeat,
wgt::AddressMode::ClampToBorder => unimplemented!(),
}
}
+9 -6
View File
@@ -37,12 +37,12 @@ pub use wgt::{
ColorStateDescriptor, ColorWrite, CommandBufferDescriptor, CompareFunction, CullMode,
DepthStencilStateDescriptor, DeviceDescriptor, DynamicOffset, Extent3d, Features, FilterMode,
FrontFace, IndexFormat, InputStepMode, Limits, Origin3d, PowerPreference, PresentMode,
PrimitiveTopology, PushConstantRange, RasterizationStateDescriptor, ShaderLocation,
ShaderStage, StencilOperation, StencilStateDescriptor, StencilStateFaceDescriptor,
SwapChainDescriptor, SwapChainStatus, TextureAspect, TextureComponentType, TextureDataLayout,
TextureDimension, TextureFormat, TextureUsage, TextureViewDimension, VertexAttributeDescriptor,
VertexFormat, BIND_BUFFER_ALIGNMENT, COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT,
PUSH_CONSTANT_ALIGNMENT,
PrimitiveTopology, PushConstantRange, RasterizationStateDescriptor, SamplerBorderColor,
ShaderLocation, ShaderStage, StencilOperation, StencilStateDescriptor,
StencilStateFaceDescriptor, SwapChainDescriptor, SwapChainStatus, TextureAspect,
TextureComponentType, TextureDataLayout, TextureDimension, TextureFormat, TextureUsage,
TextureViewDimension, VertexAttributeDescriptor, VertexFormat, BIND_BUFFER_ALIGNMENT,
COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
};
use backend::Context as C;
@@ -1052,6 +1052,8 @@ pub struct SamplerDescriptor<'a> {
pub compare: Option<CompareFunction>,
/// Valid values: 1, 2, 4, 8, and 16.
pub anisotropy_clamp: Option<NonZeroU8>,
/// Border color to use when address_mode is [`AddressMode::ClampToBorder`]
pub border_color: Option<SamplerBorderColor>,
}
impl Default for SamplerDescriptor<'_> {
@@ -1068,6 +1070,7 @@ impl Default for SamplerDescriptor<'_> {
lod_max_clamp: std::f32::MAX,
compare: None,
anisotropy_clamp: None,
border_color: None,
}
}
}