Skip to content

Commit

Permalink
Merge #1732
Browse files Browse the repository at this point in the history
1732: Fix Tests on DX12/GL r=kvark a=cwfitzgerald

**Connections**

Marks #1730 as known failure

Closes #1695

**Description**

This fixes up tests on both DX12 and GL

**Testing**

Tests


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
  • Loading branch information
bors[bot] and cwfitzgerald authored Jul 27, 2021
2 parents 2940347 + d6a8ab7 commit 9ce884c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ impl super::Adapter {
vertex_shader_storage_blocks.min(fragment_shader_storage_blocks)
};

let max_storage_textures_per_shader_stage = if vertex_shader_storage_textures == 0 {
fragment_shader_storage_textures
} else {
vertex_shader_storage_textures.min(fragment_shader_storage_textures)
};

let mut features = wgt::Features::empty()
| wgt::Features::TEXTURE_COMPRESSION_ETC2
| wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES;
Expand All @@ -228,7 +234,9 @@ impl super::Adapter {
);
features.set(
wgt::Features::VERTEX_WRITABLE_STORAGE,
ver >= (3, 1) && !vertex_ssbo_false_zero,
ver >= (3, 1)
&& (vertex_shader_storage_blocks != 0 || vertex_ssbo_false_zero)
&& vertex_shader_storage_textures != 0,
);

let mut downlevel_flags = wgt::DownlevelFlags::empty()
Expand Down Expand Up @@ -275,8 +283,7 @@ impl super::Adapter {
max_sampled_textures_per_shader_stage: super::MAX_TEXTURE_SLOTS as u32,
max_samplers_per_shader_stage: super::MAX_SAMPLERS as u32,
max_storage_buffers_per_shader_stage,
max_storage_textures_per_shader_stage: vertex_shader_storage_textures
.min(fragment_shader_storage_textures),
max_storage_textures_per_shader_stage,
max_uniform_buffers_per_shader_stage,
max_uniform_buffer_binding_size: gl.get_parameter_i32(glow::MAX_UNIFORM_BLOCK_SIZE)
as u32,
Expand Down
3 changes: 2 additions & 1 deletion wgpu/examples/water/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ fn water() {
height: 768,
optional_features: wgpu::Features::default(),
base_test_parameters: framework::test_common::TestParameters::default()
.downlevel_flags(wgpu::DownlevelFlags::READ_ONLY_DEPTH_STENCIL),
.downlevel_flags(wgpu::DownlevelFlags::READ_ONLY_DEPTH_STENCIL)
.specific_failure(Some(wgpu::Backends::DX12), None, Some("Basic"), false), // WARP has a bug https://github.com/gfx-rs/wgpu/issues/1730
tolerance: 5,
max_outliers: 460, // bounded by DX12, then rpi4 on vk
});
Expand Down

0 comments on commit 9ce884c

Please sign in to comment.