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.11.3, wgpu-hal-0.11.5, and wgpu-0.11.1 #2240

Merged
merged 27 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
61710cc
Unset existing vertex attributes on gles set_render_pipeline (#2131)
dlunch Oct 30, 2021
651e04b
Fix invalid Rgba16Float format on gles
dlunch Oct 26, 2021
1dcd7a9
gles: Fix rendering to cubemap faces (#2139)
magcius Nov 1, 2021
fbf9200
queue: Another attempt at cube map rendering (#2143)
magcius Nov 1, 2021
5b4ab35
Validate device descriptor before opening (#2159)
kvark Nov 6, 2021
505584b
Add clippy non_send_fields_in_send_ty (#2156)
kvark Nov 5, 2021
a796ea3
gles backend: unbind PIXEL_UNPACK_BUFFER (#2162)
mrk-its Nov 9, 2021
89abe09
hal/vk: add physical device features for extensions (#2167)
msiglreith Nov 9, 2021
fb8b0a5
do not query work group params on gles < 3.1 (#2166)
mrk-its Nov 10, 2021
e130ac9
Populate sampling pairs for validation (#2188)
kvark Nov 19, 2021
265fd54
Unique HalManagedMetalLayerDelegate class (#2209)
xiaopengli89 Nov 25, 2021
b4184d0
hal/vulkan: use multiple semaphores in a relay (#2212)
kvark Nov 25, 2021
0862e18
Web backend: call set_index_buffer with size as optional
afiedler Nov 20, 2021
d27c4be
Web backend: call set_vertex_buffer with size as optional
afiedler Nov 20, 2021
7244c23
hal/gles: fix setting filtering on integer textures (#2222)
kvark Nov 29, 2021
05aeaf1
hal/gles: force unbind samplers (#2226)
kvark Nov 29, 2021
c16f794
hal/vk: require storage buffer class as the device extension, not ins…
kvark Nov 29, 2021
c0895f6
hal/vk: use more ergonomic GetPhysicalDeviceProperties2
kvark Nov 29, 2021
fa24992
hal/vk: use Option::insert() with push_next for adapter features
kvark Nov 29, 2021
ed281d9
hal/vk: fix adapter vulkan version check when requesting 1.2 capabili…
kvark Nov 29, 2021
364a3f3
hal/vk: check for optimus in addition to NV adapter
kvark Nov 29, 2021
8238733
hal/gles: error on given context below 3.0
kvark Nov 30, 2021
9ee5f7e
hal/gles: don't expose VERTEX_STORAGE if there is no storage
kvark Nov 30, 2021
c506004
hal/vk: fix vulkan-1.2 caps check, again
kvark Nov 30, 2021
346bdcb
hal/vk: fix app_version for Vulkan 1.1
kvark Nov 30, 2021
3664c15
Fix nightly warnings about docs
kvark Dec 2, 2021
8dace6f
Bump wgpu-core to 0.11.3 and wgpu-hal to 0.11.5
kvark Dec 2, 2021
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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Change Log

## wgpu-core-0.11.3, wgpu-hal-0.11.5, wgpu-0.11.1 (2021-12-01)
- Core:
- validate device descriptor before actually creating it
- fix validation of texture-sampler pairs
- Vulkan:
- fix running on Vulkan-1.1 instance
- improve detection of workaround for Intel+Nvidia on Linux
- fix resource limits on Vulkan-1.2
- fix the check for storage buffer requirement
- change internal semaphore logic to work around Linux+Intel bugs
- fix enabling extension-provided features
- GLES:
- fix running on old and bogus drivers
- fix stale samplers on bindings change
- fix integer textures
- fix querying work group parameters
- fix stale PBO bindings caused by resource copies
- fix rendering to cubemap faces
- fix `Rgba16Float` format
- fix stale vertex attributes when changing the pipeline
- Metal:
- fix window resizing for running in multiple processes
- Web:
- fix `set_index_buffer` and `set_vertex_buffer` to have optional sizes

## wgpu-core-0.11.2, wgpu-hal-0.11.4 (2021-10-22)
- fix buffer transition barriers
- Metal:
Expand Down
10 changes: 5 additions & 5 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.11.2"
version = "0.11.3"
authors = ["wgpu developers"]
edition = "2018"
description = "WebGPU core logic on wgpu-hal"
Expand Down
44 changes: 22 additions & 22 deletions wgpu-core/src/command/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
/*! Render Bundles

## Software implementation
## Software implementation

The path from nothing to using a render bundle consists of 3 phases.
The path from nothing to using a render bundle consists of 3 phases.

### Initial command encoding
### Initial command encoding

User creates a `RenderBundleEncoder` and populates it by issuing commands
from `bundle_ffi` module, just like with `RenderPass`, except that the
set of available commands is reduced. Everything is written into a `RawPass`.
User creates a `RenderBundleEncoder` and populates it by issuing commands
from `bundle_ffi` module, just like with `RenderPass`, except that the
set of available commands is reduced. Everything is written into a `RawPass`.

### Bundle baking
### Bundle baking

Once the commands are encoded, user calls `render_bundle_encoder_finish`.
This is perhaps the most complex part of the logic. It consumes the
commands stored in `RawPass`, while validating everything, tracking the state,
and re-recording the commands into a separate `Vec<RenderCommand>`. It
doesn't actually execute any commands.
Once the commands are encoded, user calls `render_bundle_encoder_finish`.
This is perhaps the most complex part of the logic. It consumes the
commands stored in `RawPass`, while validating everything, tracking the state,
and re-recording the commands into a separate `Vec<RenderCommand>`. It
doesn't actually execute any commands.

What's more important, is that the produced vector of commands is "normalized",
which means it can be executed verbatim without any state tracking. More
formally, "normalized" command stream guarantees that any state required by
a draw call is set explicitly by one of the commands between the draw call
and the last changing of the pipeline.
What's more important, is that the produced vector of commands is "normalized",
which means it can be executed verbatim without any state tracking. More
formally, "normalized" command stream guarantees that any state required by
a draw call is set explicitly by one of the commands between the draw call
and the last changing of the pipeline.

### Execution
### Execution

When the bundle is used in an actual render pass, `RenderBundle::execute` is
called. It goes through the commands and issues them into the native command
buffer. Thanks to the "normalized" property, it doesn't track any bind group
invalidations or index format changes.
When the bundle is used in an actual render pass, `RenderBundle::execute` is
called. It goes through the commands and issues them into the native command
buffer. Thanks to the "normalized" property, it doesn't track any bind group
invalidations or index format changes.
!*/
#![allow(clippy::reversed_empty_ranges)]

Expand Down
41 changes: 21 additions & 20 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,27 @@ impl<A: HalApi> Adapter<A> {
open: hal::OpenDevice<A>,
desc: &DeviceDescriptor,
trace_path: Option<&std::path::Path>,
) -> Result<Device<A>, RequestDeviceError> {
let caps = &self.raw.capabilities;
Device::new(
open,
Stored {
value: Valid(self_id),
ref_count: self.life_guard.add_ref(),
},
caps.alignments.clone(),
caps.downlevel.clone(),
desc,
trace_path,
)
.or(Err(RequestDeviceError::OutOfMemory))
}

fn create_device(
&self,
self_id: AdapterId,
desc: &DeviceDescriptor,
trace_path: Option<&std::path::Path>,
) -> Result<Device<A>, RequestDeviceError> {
// Verify all features were exposed by the adapter
if !self.raw.features.contains(desc.features) {
Expand Down Expand Up @@ -315,26 +336,6 @@ impl<A: HalApi> Adapter<A> {
return Err(RequestDeviceError::LimitsExceeded(failed));
}

Device::new(
open,
Stored {
value: Valid(self_id),
ref_count: self.life_guard.add_ref(),
},
caps.alignments.clone(),
caps.downlevel.clone(),
desc,
trace_path,
)
.or(Err(RequestDeviceError::OutOfMemory))
}

fn create_device(
&self,
self_id: AdapterId,
desc: &DeviceDescriptor,
trace_path: Option<&std::path::Path>,
) -> Result<Device<A>, RequestDeviceError> {
let open = unsafe { self.raw.adapter.open(desc.features, &desc.limits) }.map_err(
|err| match err {
hal::DeviceError::Lost => RequestDeviceError::DeviceLost,
Expand Down
12 changes: 6 additions & 6 deletions wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*! Presentation.

## Lifecycle
## Lifecycle

Whenever a submission detects the use of any surface texture, it adds it to the device
tracker for the duration of the submission (temporarily, while recording).
It's added with `UNINITIALIZED` state and transitioned into `empty()` state.
When this texture is presented, we remove it from the device tracker as well as
extract it from the hub.
Whenever a submission detects the use of any surface texture, it adds it to the device
tracker for the duration of the submission (temporarily, while recording).
It's added with `UNINITIALIZED` state and transitioned into `empty()` state.
When this texture is presented, we remove it from the device tracker as well as
extract it from the hub.
!*/

#[cfg(feature = "trace")]
Expand Down
5 changes: 5 additions & 0 deletions wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,11 @@ impl Interface {
}
}

for key in info.sampling_set.iter() {
ep.sampling_pairs
.insert((resource_mapping[&key.image], resource_mapping[&key.sampler]));
}

entry_points.insert((entry_point.stage, entry_point.name.clone()), ep);
}

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.11.4"
version = "0.11.5"
authors = ["wgpu developers"]
edition = "2018"
description = "WebGPU hardware abstraction layer"
Expand Down
10 changes: 10 additions & 0 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,17 @@ impl super::Adapter {
log::debug!("Extensions: {:#?}", extensions);

let ver = Self::parse_version(&version).ok()?;
if ver < (3, 0) {
log::warn!(
"Returned GLES context is {}.{}, when 3.0+ was requested",
ver.0,
ver.1
);
return None;
}

let supports_storage = ver >= (3, 1);

let shading_language_version = {
let sl_version = gl.get_parameter_string(glow::SHADING_LANGUAGE_VERSION);
log::info!("SL version: {}", &sl_version);
Expand Down Expand Up @@ -269,6 +278,7 @@ impl super::Adapter {
downlevel_flags.set(
wgt::DownlevelFlags::VERTEX_STORAGE,
max_storage_block_size != 0
&& max_storage_buffers_per_shader_stage != 0
&& (vertex_shader_storage_blocks != 0 || vertex_ssbo_false_zero),
);
downlevel_flags.set(wgt::DownlevelFlags::FRAGMENT_STORAGE, supports_storage);
Expand Down
34 changes: 18 additions & 16 deletions wgpu-hal/src/gles/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,17 @@ impl super::CommandEncoder {

fn rebind_sampler_states(&mut self, dirty_textures: u32, dirty_samplers: u32) {
for (texture_index, slot) in self.state.texture_slots.iter().enumerate() {
if let Some(sampler_index) = slot.sampler_index {
if dirty_textures & (1 << texture_index) != 0
|| dirty_samplers & (1 << sampler_index) != 0
{
if let Some(sampler) = self.state.samplers[sampler_index as usize] {
self.cmd_buffer
.commands
.push(C::BindSampler(texture_index as u32, sampler));
}
}
if dirty_textures & (1 << texture_index) != 0
|| slot
.sampler_index
.map_or(false, |si| dirty_samplers & (1 << si) != 0)
{
let sampler = slot
.sampler_index
.and_then(|si| self.state.samplers[si as usize]);
self.cmd_buffer
.commands
.push(C::BindSampler(texture_index as u32, sampler));
}
}
}
Expand Down Expand Up @@ -617,12 +618,6 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
unsafe fn set_render_pipeline(&mut self, pipeline: &super::RenderPipeline) {
self.state.topology = conv::map_primitive_topology(pipeline.primitive.topology);

for index in self.state.vertex_attributes.len()..pipeline.vertex_attributes.len() {
self.cmd_buffer
.commands
.push(C::UnsetVertexAttribute(index as u32));
}

if self
.private_caps
.contains(super::PrivateCapabilities::VERTEX_BUFFER_LAYOUT)
Expand All @@ -637,6 +632,13 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
});
}
} else {
for index in 0..self.state.vertex_attributes.len() {
self.cmd_buffer
.commands
.push(C::UnsetVertexAttribute(index as u32));
}
self.state.vertex_attributes.clear();

self.state.dirty_vbuf_mask = 0;
// copy vertex attributes
for vat in pipeline.vertex_attributes.iter() {
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/gles/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl super::AdapterShared {
Tf::Rg32Float => (glow::RG32F, glow::RG, glow::FLOAT),
Tf::Rgba16Uint => (glow::RGBA16UI, glow::RGBA_INTEGER, glow::UNSIGNED_SHORT),
Tf::Rgba16Sint => (glow::RGBA16I, glow::RGBA_INTEGER, glow::SHORT),
Tf::Rgba16Float => (glow::RGBA16F, glow::RG, glow::HALF_FLOAT),
Tf::Rgba16Float => (glow::RGBA16F, glow::RGBA, glow::HALF_FLOAT),
Tf::Rgba32Uint => (glow::RGBA32UI, glow::RGBA_INTEGER, glow::UNSIGNED_INT),
Tf::Rgba32Sint => (glow::RGBA32I, glow::RGBA_INTEGER, glow::INT),
Tf::Rgba32Float => (glow::RGBA32F, glow::RGBA, glow::FLOAT),
Expand Down
Loading