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

Do a downlevel check for anisotrophy and enable it in the webgl backend #2616

Merged
merged 3 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ impl super::Adapter {
&& (vertex_shader_storage_blocks != 0 || vertex_ssbo_false_zero),
);
downlevel_flags.set(wgt::DownlevelFlags::FRAGMENT_STORAGE, supports_storage);
downlevel_flags.set(
wgt::DownlevelFlags::ANISOTROPIC_FILTERING,
extensions.contains("EXT_texture_filter_anisotropic"),
);

let mut features = wgt::Features::empty()
| wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
Expand Down
5 changes: 3 additions & 2 deletions wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,9 @@ impl crate::Device<super::Api> for super::Device {
gl.sampler_parameter_f32(raw, glow::TEXTURE_MAX_LOD, range.end);
}

//TODO: `desc.anisotropy_clamp` depends on the downlevel flag
// gl.sampler_parameter_f32(rawow::TEXTURE_MAX_ANISOTROPY, aniso as f32);
if let Some(anisotropy) = desc.anisotropy_clamp {
gl.sampler_parameter_f32(raw, glow::TEXTURE_MAX_ANISOTROPY, anisotropy.get() as f32);
expenses marked this conversation as resolved.
Show resolved Hide resolved
}

//set_param_float(glow::TEXTURE_LOD_BIAS, info.lod_bias.0);

Expand Down