Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ By @cwfitzgerald in [#8609](https://github.com/gfx-rs/wgpu/pull/8609).

- Fix race when downloading texture from compute shader pass. By @SpeedCrash100 in [#8527](https://github.com/gfx-rs/wgpu/pull/8527)
- Fix double window class registration when dynamic libraries are used. By @Azorlogh in [#8548](https://github.com/gfx-rs/wgpu/pull/8548)
- Fix context loss on device initialization on GL3.3-4.1 contexts. By @cwfitzgerald in [#8674](https://github.com/gfx-rs/wgpu/pull/8674).

#### hal

Expand Down
12 changes: 10 additions & 2 deletions tests/tests/wgpu-gpu/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,19 @@ static MULTIPLE_DEVICES: GpuTestConfiguration = GpuTestConfiguration::new()
.run_sync(|ctx| {
use pollster::FutureExt as _;
ctx.adapter
.request_device(&wgpu::DeviceDescriptor::default())
.request_device(&wgpu::DeviceDescriptor {
required_features: wgpu::Features::empty(),
required_limits: wgpu::Limits::downlevel_webgl2_defaults(),
..Default::default()
})
.block_on()
.expect("failed to create device");
ctx.adapter
.request_device(&wgpu::DeviceDescriptor::default())
.request_device(&wgpu::DeviceDescriptor {
required_features: wgpu::Features::empty(),
required_limits: wgpu::Limits::downlevel_webgl2_defaults(),
..Default::default()
})
.block_on()
.expect("failed to create device");
});
Expand Down
9 changes: 6 additions & 3 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,17 @@ impl Device {
}
.map_err(DeviceError::from_hal)?;

// Cloned as we need them below anyway.
let alignments = adapter.raw.capabilities.alignments.clone();
let downlevel = adapter.raw.capabilities.downlevel.clone();
let limits = &adapter.raw.capabilities.limits;

let enable_indirect_validation = instance_flags
.contains(wgt::InstanceFlags::VALIDATION_INDIRECT_CALL)
&& downlevel
.flags
.contains(wgt::DownlevelFlags::INDIRECT_EXECUTION);
&& downlevel.flags.contains(
wgt::DownlevelFlags::INDIRECT_EXECUTION | wgt::DownlevelFlags::COMPUTE_SHADERS,
)
&& limits.max_storage_buffers_per_shader_stage >= 2;

let indirect_validation = if enable_indirect_validation {
Some(crate::indirect_validation::IndirectValidation::new(
Expand Down
9 changes: 5 additions & 4 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,11 @@ impl super::Adapter {
es_supported || full_supported
};

let supports_storage =
supported((3, 1), (4, 3)) || extensions.contains("GL_ARB_shader_storage_buffer_object");
let supports_compute =
supported((3, 1), (4, 3)) || extensions.contains("GL_ARB_compute_shader");
// Naga won't let you emit storage buffers at versions below this, so
// we currently can't support GL_ARB_shader_storage_buffer_object.
let supports_storage = supported((3, 1), (4, 3));
// Same with compute shaders and GL_ARB_compute_shader
let supports_compute = supported((3, 1), (4, 3));
let supports_work_group_params = supports_compute;

// ANGLE provides renderer strings like: "ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)"
Expand Down