Skip to content

Commit

Permalink
[mtl] fix immutable samplers in combined descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Sep 5, 2019
1 parent 143848c commit 23a49e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

### backend-metal-0.3.3 (05-09-2019)
- fix immutable samplers in combined image-samplers

### backend-vulkan-0.3.3 (03-09-2019)
- fix iOS build

Expand Down
4 changes: 2 additions & 2 deletions src/backend/metal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gfx-backend-metal"
version = "0.3.2"
version = "0.3.3"
description = "Metal API backend for gfx-rs"
homepage = "https://github.com/gfx-rs/gfx"
repository = "https://github.com/gfx-rs/gfx"
Expand Down Expand Up @@ -37,7 +37,7 @@ cocoa = "0.19"
core-graphics = "0.17"
smallvec = "0.6"
spirv_cross = { version = "0.15", features = ["msl"] }
parking_lot = "0.9.0"
parking_lot = "0.9"
storage-map = "0.2"
raw-window-handle = "0.1"

Expand Down
9 changes: 4 additions & 5 deletions src/backend/metal/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1939,8 +1939,9 @@ impl hal::Device<Backend> for Device {

for set_layout_binding in binding_iter {
let slb = set_layout_binding.borrow();
let mut content = n::DescriptorContent::from(slb.ty);

let content = if slb.immutable_samplers {
if slb.immutable_samplers {
tmp_samplers.extend(
immutable_sampler_iter
.by_ref()
Expand All @@ -1952,10 +1953,8 @@ impl hal::Device<Backend> for Device {
array_index,
}),
);
n::DescriptorContent::IMMUTABLE_SAMPLER
} else {
n::DescriptorContent::from(slb.ty)
};
content |= n::DescriptorContent::IMMUTABLE_SAMPLER
}

desc_layouts.extend((0 .. slb.count).map(|array_index| n::DescriptorLayout {
content,
Expand Down

0 comments on commit 23a49e9

Please sign in to comment.