Skip to content

Commit

Permalink
Improve vk format msaa capabilities detection (#3429)
Browse files Browse the repository at this point in the history
* Improve vk format msaa capabilities detection

* Update CHANGELOG

* Follow the suggestions

* Update wgpu-hal/src/vulkan/adapter.rs

Co-authored-by: Teodor Tanasoaia <[email protected]>
  • Loading branch information
2 people authored and cwfitzgerald committed Feb 9, 2023
1 parent 959b9bb commit 736989b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Bottom level categories:

- Implement `CommandEncoder::clear_buffer`. By @raphlinus in [#3426](https://github.com/gfx-rs/wgpu/pull/3426)

#### Vulkan

- Improve format MSAA capabilities detection. By @jinleili in [#3429](https://github.com/gfx-rs/wgpu/pull/3429)

## wgpu-0.15.0 (2023-01-25)

### Major Changes
Expand Down
15 changes: 9 additions & 6 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,11 +1502,15 @@ impl crate::Adapter<super::Api> for super::Adapter {
.framebuffer_stencil_sample_counts
.min(limits.sampled_image_stencil_sample_counts)
} else {
limits
.framebuffer_color_sample_counts
.min(limits.sampled_image_color_sample_counts)
.min(limits.sampled_image_integer_sample_counts)
.min(limits.storage_image_sample_counts)
match format.describe().sample_type {
wgt::TextureSampleType::Float { filterable: _ } => limits
.framebuffer_color_sample_counts
.min(limits.sampled_image_color_sample_counts),
wgt::TextureSampleType::Sint | wgt::TextureSampleType::Uint => {
limits.sampled_image_integer_sample_counts
}
_ => unreachable!(),
}
};

flags.set(
Expand All @@ -1517,7 +1521,6 @@ impl crate::Adapter<super::Api> for super::Adapter {
Tfc::MULTISAMPLE_X4,
sample_flags.contains(vk::SampleCountFlags::TYPE_4),
);

flags.set(
Tfc::MULTISAMPLE_X8,
sample_flags.contains(vk::SampleCountFlags::TYPE_8),
Expand Down

0 comments on commit 736989b

Please sign in to comment.