Skip to content

Commit

Permalink
address reviewer comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-its committed Nov 9, 2021
1 parent 78aa471 commit 6633302
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ impl super::Adapter {
let ver = Self::parse_version(&version).ok()?;

let supports_storage = ver >= (3, 1);
let supports_work_group_params = 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 @@ -328,7 +330,7 @@ impl super::Adapter {
gl.get_parameter_i32(glow::MAX_VERTEX_UNIFORM_BLOCKS)
.min(gl.get_parameter_i32(glow::MAX_FRAGMENT_UNIFORM_BLOCKS)) as u32;

let max_compute_workgroups_per_dimension = if cfg!(not(target_arch = "wasm32")) {
let max_compute_workgroups_per_dimension = if supports_work_group_params {
gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_COUNT, 0)
.min(gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_COUNT, 1))
.min(gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_COUNT, 2))
Expand Down Expand Up @@ -376,17 +378,17 @@ impl super::Adapter {
max_push_constant_size: 0,
min_uniform_buffer_offset_alignment,
min_storage_buffer_offset_alignment,
max_compute_workgroup_size_x: if cfg!(not(target_arch = "wasm32")) {
max_compute_workgroup_size_x: if supports_work_group_params {
gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_SIZE, 0) as u32
} else {
0
},
max_compute_workgroup_size_y: if cfg!(not(target_arch = "wasm32")) {
max_compute_workgroup_size_y: if supports_work_group_params {
gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_SIZE, 1) as u32
} else {
0
},
max_compute_workgroup_size_z: if cfg!(not(target_arch = "wasm32")) {
max_compute_workgroup_size_z: if supports_work_group_params {
gl.get_parameter_indexed_i32(glow::MAX_COMPUTE_WORK_GROUP_SIZE, 2) as u32
} else {
0
Expand Down

0 comments on commit 6633302

Please sign in to comment.