Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release wgpu-core-0.12.2 and wgpu-hal-0.12.2 #2373

Merged
merged 5 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Change Log

## Unreleased
- Fix tracy compile error
## wgpu-core-0.12.2, wgpu-hal-0.12.2 (2022-01-10)
- fix tracy compile error
- fix buffer binding limits beyond 2Gb
- fix zero initialization of 3D textures
- Metal:
- fix surface texture views
- Gles:
- extend `libwayland` search paths

## wgpu-core-0.12.1, wgpu-hal-0.12.1 (2021-12-29)
- zero initialization uses now render target clears when possible (faster and doesn't enforce COPY_DST internally if not necessary)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wgpu-core"
version = "0.12.1"
version = "0.12.2"
authors = ["wgpu developers"]
edition = "2018"
description = "WebGPU core logic on wgpu-hal"
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl<A: HalApi> Device<A> {
format_features,
initialization_status: TextureInitTracker::new(
desc.mip_level_count,
desc.size.depth_or_array_layers,
desc.array_layer_count(),
),
full_range: TextureSelector {
levels: 0..desc.mip_level_count,
Expand Down
12 changes: 3 additions & 9 deletions wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When this texture is presented, we remove it from the device tracker as well as
extract it from the hub.
!*/

use std::{borrow::Borrow, num::NonZeroU32};
use std::borrow::Borrow;

#[cfg(feature = "trace")]
use crate::device::trace::Action;
Expand Down Expand Up @@ -128,17 +128,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
let (texture_id, status) = match unsafe { suf.raw.acquire_texture(FRAME_TIMEOUT_MS) } {
Ok(Some(ast)) => {
let clear_view_desc = hal::TextureViewDescriptor {
label: Some("clear texture view"),
label: Some("clear surface texture view"),
format: config.format,
dimension: wgt::TextureViewDimension::D2,
usage: hal::TextureUses::COLOR_TARGET,
range: wgt::ImageSubresourceRange {
aspect: wgt::TextureAspect::All,
base_mip_level: 0,
mip_level_count: NonZeroU32::new(1),
base_array_layer: 0,
array_layer_count: NonZeroU32::new(1),
},
range: wgt::ImageSubresourceRange::default(),
};
let mut clear_views = smallvec::SmallVec::new();
clear_views.push(
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wgpu-hal"
version = "0.12.1"
version = "0.12.2"
authors = ["wgpu developers"]
edition = "2018"
description = "WebGPU hardware abstraction layer"
Expand Down
6 changes: 6 additions & 0 deletions wgpu-hal/src/auxil/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub mod db {
}
}

/// Maximum binding size for the shaders that only support `i32` indexing.
/// Interestingly, the index itself can't reach that high, because the minimum
/// element size is 4 bytes, but the compiler toolchain still computes the
/// offset at some intermediate point, internally, as i32.
pub const MAX_I32_BINDING_SIZE: u32 = 1 << 31;

pub fn map_naga_stage(stage: naga::ShaderStage) -> wgt::ShaderStages {
match stage {
naga::ShaderStage::Vertex => wgt::ShaderStages::VERTEX,
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/dx12/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl super::Adapter {
max_uniform_buffers_per_shader_stage: full_heap_count,
max_uniform_buffer_binding_size: d3d12::D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT
* 16,
max_storage_buffer_binding_size: !0,
max_storage_buffer_binding_size: crate::auxil::MAX_I32_BINDING_SIZE,
max_vertex_buffers: d3d12::D3D12_VS_INPUT_REGISTER_COUNT
.min(crate::MAX_VERTEX_BUFFERS as u32),
max_vertex_attributes: d3d12::D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT,
Expand Down
14 changes: 12 additions & 2 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,30 @@ fn open_x_display() -> Option<(ptr::NonNull<raw::c_void>, libloading::Library)>
}
}

unsafe fn find_library(paths: &[&str]) -> Option<libloading::Library> {
for path in paths {
match libloading::Library::new(path) {
Ok(lib) => return Some(lib),
_ => continue,
};
}
None
}

fn test_wayland_display() -> Option<libloading::Library> {
/* We try to connect and disconnect here to simply ensure there
* is an active wayland display available.
*/
log::info!("Loading Wayland library to get the current display");
let library = unsafe {
let client_library = libloading::Library::new("libwayland-client.so").ok()?;
let client_library = find_library(&["libwayland-client.so.0", "libwayland-client.so"])?;
let wl_display_connect: libloading::Symbol<WlDisplayConnectFun> =
client_library.get(b"wl_display_connect").unwrap();
let wl_display_disconnect: libloading::Symbol<WlDisplayDisconnectFun> =
client_library.get(b"wl_display_disconnect").unwrap();
let display = ptr::NonNull::new(wl_display_connect(ptr::null()))?;
wl_display_disconnect(display.as_ptr());
libloading::Library::new("libwayland-egl.so").ok()?
find_library(&["libwayland-egl.so.1", "libwayland-egl.so"])?
};
Some(library)
}
Expand Down
2 changes: 2 additions & 0 deletions wgpu-hal/src/metal/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ impl crate::Device<super::Api> for super::Device {
conv::map_texture_view_dimension(desc.dimension)
};

//Note: this doesn't check properly if the mipmap level count or array layer count
// is explicitly set to 1.
let raw = if raw_format == texture.raw_format
&& raw_type == texture.raw_type
&& desc.range == wgt::ImageSubresourceRange::default()
Expand Down
8 changes: 6 additions & 2 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,12 @@ impl PhysicalDeviceCapabilities {
max_storage_buffers_per_shader_stage: max_storage_buffers,
max_storage_textures_per_shader_stage: max_storage_textures,
max_uniform_buffers_per_shader_stage: max_uniform_buffers,
max_uniform_buffer_binding_size: limits.max_uniform_buffer_range,
max_storage_buffer_binding_size: limits.max_storage_buffer_range,
max_uniform_buffer_binding_size: limits
.max_uniform_buffer_range
.min(crate::auxil::MAX_I32_BINDING_SIZE),
max_storage_buffer_binding_size: limits
.max_storage_buffer_range
.min(crate::auxil::MAX_I32_BINDING_SIZE),
max_vertex_buffers: limits
.max_vertex_input_bindings
.min(crate::MAX_VERTEX_BUFFERS as u32),
Expand Down