Turn the anisotropic filtering setting into an enum

Since it only accepts power-of-two values, exposing it as an enum
makes more sense. This also allows for adding property hints to indicate
the performance cost of each value.

This also improves property hints for MSAA and FXAA.
This commit is contained in:
Hugo Locurcio 2020-05-08 12:03:23 +02:00
parent e45735ec4a
commit 3a11baaeac
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
4 changed files with 9 additions and 9 deletions

View file

@ -5833,14 +5833,14 @@ RasterizerStorageRD::RasterizerStorageRD() {
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.use_anisotropy = true;
sampler_state.anisotropy_max = GLOBAL_GET("rendering/quality/texture_filters/max_anisotropy");
sampler_state.anisotropy_max = 1 << int(GLOBAL_GET("rendering/quality/texture_filters/anisotropic_filtering_level"));
} break;
case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: {
sampler_state.mag_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.min_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.mip_filter = RD::SAMPLER_FILTER_LINEAR;
sampler_state.use_anisotropy = true;
sampler_state.anisotropy_max = GLOBAL_GET("rendering/quality/texture_filters/max_anisotropy");
sampler_state.anisotropy_max = 1 << int(GLOBAL_GET("rendering/quality/texture_filters/anisotropic_filtering_level"));
} break;
default: {