This patch and the next one fix some failures in Wine's D3D9
fog_with_shader_test() unit test when run with Mesa's swrast. I
suppose it could have some impact on the other drivers as well.
With the fog bugs fixed, there are two issues I run into when running
Wine's D3D unit tests with Mesa's swrast. The first issue is that by
default Mesa doesn't report any visuals / FBConfigs with an alpha
channel in the colorbuffer, unless I set MESA_GLX_FORCE_ALPHA (which
makes them all get an alpha channel). Is this intentional? I would
guess not. The other issue is that not being able to link multiple
GLSL shaders together makes Mesa's GLSL implementation pretty much
unusable for Wine. Due to the way D3D SM3 shaders work we're pretty
much forced to link a second vertex shader to the main vertex shader
that matches up the correct vertex shader output varyings with the
fragment shader input varyings for the fragment shader that's used at
the time.
Fragment programs replace fog application completely, so no vertex fog should
be calculated when a fragment program is active.
---
src/mesa/tnl/t_context.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 3b8dd18..2c09024 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -105,10 +105,10 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- if (new_state & (_NEW_HINT)) {
+ if (new_state & (_NEW_HINT) || new_state & (_NEW_PROGRAM)) {
ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog !=
GL_NICEST))
+ || !tnl->AllowPixelFog) && !fp;
}
tnl->pipeline.new_state |= new_state;
@@ -202,8 +202,8 @@ _tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->AllowVertexFog = value;
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
}
@@ -212,7 +212,7 @@ _tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->AllowPixelFog = value;
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
}
--
1.5.4.5
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev