mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
feat: const feature defaults (#5343)
* feat: make downlevel feature defaults const * docs: add 5343 to changelog
This commit is contained in:
parent
44faebf167
commit
badb3c88ea
@ -115,6 +115,7 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325).
|
||||
- `wgpu::Id` now implements `PartialOrd`/`Ord` allowing it to be put in `BTreeMap`s. By @cwfitzgerald and @9291Sam in [#5176](https://github.com/gfx-rs/wgpu/pull/5176)
|
||||
- `wgpu::CommandEncoder::write_timestamp` requires now the new `wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS` feature which is available on all native backends but not on WebGPU (due to a spec change `write_timestamp` is no longer supported on WebGPU). By @wumpf in [#5188](https://github.com/gfx-rs/wgpu/pull/5188)
|
||||
- Breaking change: [`wgpu_core::pipeline::ProgrammableStageDescriptor`](https://docs.rs/wgpu-core/latest/wgpu_core/pipeline/struct.ProgrammableStageDescriptor.html#structfield.entry_point) is now optional. By @ErichDonGubler in [#5305](https://github.com/gfx-rs/wgpu/pull/5305).
|
||||
- `Features::downlevel{_webgl2,}_features` was made const by @MultisampledNight in [#5343](https://github.com/gfx-rs/wgpu/pull/5343)
|
||||
|
||||
#### GLES
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ impl Limits {
|
||||
/// max_non_sampler_bindings: 1_000_000,
|
||||
/// });
|
||||
/// ```
|
||||
pub fn downlevel_defaults() -> Self {
|
||||
pub const fn downlevel_defaults() -> Self {
|
||||
Self {
|
||||
max_texture_dimension_1d: 2048,
|
||||
max_texture_dimension_2d: 2048,
|
||||
@ -1295,7 +1295,7 @@ impl Limits {
|
||||
/// max_non_sampler_bindings: 1_000_000,
|
||||
/// });
|
||||
/// ```
|
||||
pub fn downlevel_webgl2_defaults() -> Self {
|
||||
pub const fn downlevel_webgl2_defaults() -> Self {
|
||||
Self {
|
||||
max_uniform_buffers_per_shader_stage: 11,
|
||||
max_storage_buffers_per_shader_stage: 0,
|
||||
@ -1323,7 +1323,7 @@ impl Limits {
|
||||
/// This is useful because the swapchain might need to be larger than any other image in the application.
|
||||
///
|
||||
/// If your application only needs 512x512, you might be running on a 4k display and need extremely high resolution limits.
|
||||
pub fn using_resolution(self, other: Self) -> Self {
|
||||
pub const fn using_resolution(self, other: Self) -> Self {
|
||||
Self {
|
||||
max_texture_dimension_1d: other.max_texture_dimension_1d,
|
||||
max_texture_dimension_2d: other.max_texture_dimension_2d,
|
||||
@ -1335,7 +1335,7 @@ impl Limits {
|
||||
/// Modify the current limits to use the buffer alignment limits of the adapter.
|
||||
///
|
||||
/// This is useful for when you'd like to dynamically use the "best" supported buffer alignments.
|
||||
pub fn using_alignment(self, other: Self) -> Self {
|
||||
pub const fn using_alignment(self, other: Self) -> Self {
|
||||
Self {
|
||||
min_uniform_buffer_offset_alignment: other.min_uniform_buffer_offset_alignment,
|
||||
min_storage_buffer_offset_alignment: other.min_storage_buffer_offset_alignment,
|
||||
|
Loading…
Reference in New Issue
Block a user