[PATCH 2/2] st/mesa: introduce flag to globally force a minimum lev=
Carl-Philip Haensch
Carl-Philip.Haensch at mailbox.tu-dresden.de
Fri May 20 07:37:07 PDT 2011
el of anisotropy
---
src/gallium/state_trackers/dri/common/dri_screen.c | 21 ++++++++++++-----=
--
src/mesa/state_tracker/st_atom_sampler.c | 5 ++-
src/mesa/state_tracker/st_context.h | 1 +
src/mesa/state_tracker/st_manager.c | 1 +
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/galliu=
m/state_trackers/dri/common/dri_screen.c
index 5931df9..baee00c 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -42,15 +42,20 @@
#include "util/u_debug.h"
=20
PUBLIC const char __driConfigOptions[] =3D
- DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
- DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY
-/* DRI_CONF_FORCE_S3TC_ENABLE(false) */
- DRI_CONF_ALLOW_LARGE_TEXTURES(1)
- DRI_CONF_SECTION_END DRI_CONF_END;
-
-static const uint __driNConfigOptions =3D 3;
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_SECTION_END
+ =20
+ DRI_CONF_SECTION_QUALITY
+ /*DRI_CONF_FORCE_S3TC_ENABLE(false)*/
+ DRI_CONF_ALLOW_LARGE_TEXTURES(1)
+ DRI_CONF_DEF_MAX_ANISOTROPY(1.0, "1.0,2.0,4.0,8.0,16.0")
+ DRI_CONF_SECTION_END
+ DRI_CONF_END;
+
+static const uint __driNConfigOptions =3D 4;
=20
static const __DRIconfig **
dri_fill_in_modes(struct dri_screen *screen,
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_track=
er/st_atom_sampler.c
index 06024ad..63c9eda 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -177,8 +177,9 @@ static void convert_sampler(struct st_context *st,
=09=09=09 sampler->border_color);
}
=20
- sampler->max_anisotropy =3D (msamp->MaxAnisotropy =3D=3D 1.0 ?
-=09=09=09 0 : (GLuint) msamp->MaxAnisotropy);
+ float max_anisotropy =3D MAX2(msamp->MaxAnisotropy, st->min_anisotropy)=
;
+ sampler->max_anisotropy =3D max_anisotropy =3D=3D 1.0 ?
+=09=09=09 0 : (GLuint) max_anisotropy;
=20
/* only care about ARB_shadow, not SGI shadow */
if (msamp->CompareMode =3D=3D GL_COMPARE_R_TO_TEXTURE) {
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st=
_context.h
index c6fc318..4d1aba6 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -187,6 +187,7 @@ struct st_context
struct cso_context *cso_context;
=20
int force_msaa;
+ float min_anisotropy;
void *winsys_drawable_handle;
=20
/* User vertex buffers. */
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st=
_manager.c
index a68544d..9fb3b74 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -694,6 +694,7 @@ st_api_create_context(struct st_api *stapi, struct st_ma=
nager *smapi,
=20
st->invalidate_on_gl_viewport =3D
smapi->get_param(smapi, ST_MANAGER_BROKEN_INVALIDATE);
+ st->min_anisotropy =3D 0; // ToDo: ask the context for the value
=20
st->iface.destroy =3D st_context_destroy;
st->iface.notify_invalid_framebuffer =3D
--=20
1.7.1
--=_12syuf7zqf1x--
More information about the mesa-dev
mailing list