Mesa (master): dri/nv04: Enable eng3dm for A8/L8 textures.
Francisco Jerez
currojerez at kemper.freedesktop.org
Thu Sep 16 17:48:10 UTC 2010
Module: Mesa
Branch: master
Commit: c344f27539a93e885ddcb8ceb066d481a6cd60cf
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c344f27539a93e885ddcb8ceb066d481a6cd60cf
Author: Andrew Randrianasulu <randrianasulu at gmail.com>
Date: Tue Sep 14 04:29:52 2010 +0200
dri/nv04: Enable eng3dm for A8/L8 textures.
Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
src/mesa/drivers/dri/nouveau/nv04_context.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c
index 1d34c86..9c32b48 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_context.c
@@ -31,6 +31,20 @@
#include "nouveau_class.h"
#include "nv04_driver.h"
+static GLboolean
+texunit_needs_combiners(struct gl_texture_unit *u)
+{
+ struct gl_texture_object *t = u->_Current;
+ struct gl_texture_image *ti = t->Image[0][t->BaseLevel];
+
+ return ti->TexFormat == MESA_FORMAT_A8 ||
+ ti->TexFormat == MESA_FORMAT_L8 ||
+ u->EnvMode == GL_COMBINE ||
+ u->EnvMode == GL_COMBINE4_NV ||
+ u->EnvMode == GL_BLEND ||
+ u->EnvMode == GL_ADD;
+}
+
struct nouveau_grobj *
nv04_context_engine(GLcontext *ctx)
{
@@ -38,10 +52,8 @@ nv04_context_engine(GLcontext *ctx)
struct nouveau_hw_state *hw = &to_nouveau_context(ctx)->hw;
struct nouveau_grobj *fahrenheit;
- if (ctx->Texture.Unit[0].EnvMode == GL_COMBINE ||
- ctx->Texture.Unit[0].EnvMode == GL_COMBINE4_NV ||
- ctx->Texture.Unit[0].EnvMode == GL_BLEND ||
- ctx->Texture.Unit[0].EnvMode == GL_ADD ||
+ if ((ctx->Texture.Unit[0]._ReallyEnabled &&
+ texunit_needs_combiners(&ctx->Texture.Unit[0])) ||
ctx->Texture.Unit[1]._ReallyEnabled ||
ctx->Stencil.Enabled)
fahrenheit = hw->eng3dm;
More information about the mesa-commit
mailing list