From a7139168d29e2cb112227ee6f2b5967c34eb91bd Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 19 Nov 2006 16:05:59 +0000 Subject: [PATCH] Don't bother touching lighting stuff if shaders are in use --- src/mesa/drivers/dri/nouveau/nv30_state.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c index bf3338d499b..66d94d19cdb 100644 --- a/src/mesa/drivers/dri/nouveau/nv30_state.c +++ b/src/mesa/drivers/dri/nouveau/nv30_state.c @@ -34,6 +34,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mtypes.h" #include "colormac.h" +#define NOUVEAU_CARD_USING_SHADERS (nmesa->screen->card->type >= NV_40) + static void nv30AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); @@ -229,6 +231,10 @@ static void nv30Enable(GLcontext *ctx, GLenum cap, GLboolean state) case GL_LIGHT7: { uint32_t mask=0x11<<(2*(cap-GL_LIGHT0)); + + if (NOUVEAU_CARD_USING_SHADERS) + break; + nmesa->enabled_lights=((nmesa->enabled_lights&mask)|(mask*state)); if (nmesa->lighting_enabled) { @@ -238,6 +244,9 @@ static void nv30Enable(GLcontext *ctx, GLenum cap, GLboolean state) break; } case GL_LIGHTING: + if (NOUVEAU_CARD_USING_SHADERS) + break; + nmesa->lighting_enabled=state; BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1); if (nmesa->lighting_enabled) @@ -337,6 +346,10 @@ static void nv30Hint(GLcontext *ctx, GLenum target, GLenum mode) static void nv30Lightfv(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params ) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); + + if (NOUVEAU_CARD_USING_SHADERS) + return; + /* not sure where the fourth param value goes...*/ switch(pname) { @@ -469,8 +482,9 @@ void (*ReadBuffer)( GLcontext *ctx, GLenum buffer ); void (*RenderMode)(GLcontext *ctx, GLenum mode ); /** Define the scissor box */ void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); + /** Select flat or smooth shading */ -void nv30ShadeModel(GLcontext *ctx, GLenum mode) +static void nv30ShadeModel(GLcontext *ctx, GLenum mode) { nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); -- 2.30.2