mesa: Branch 'master' - 2 commits
Brian Paul
brianp at kemper.freedesktop.org
Sat Apr 28 14:51:24 UTC 2007
src/mesa/swrast/s_fragprog.c | 6 ++++--
src/mesa/swrast_setup/ss_context.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
New commits:
diff-tree af0ae93863b4c876e70efa4e7406f04a3409f135 (from bcc3baadbafc3f3deb79e3a753d9ee3867917073)
Author: Brian <brian at yutani.localnet.net>
Date: Sat Apr 28 08:51:23 2007 -0600
only load front/back face attrib if using a shader (bug 10788)
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 882fec2..0949387 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -113,8 +113,10 @@ init_machine(GLcontext *ctx, struct gl_p
/* Setup pointer to input attributes */
machine->Attribs = span->array->attribs;
- /* Store front/back facing value in register FOGC.Y */
- machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+ if (ctx->Shader.CurrentProgram) {
+ /* Store front/back facing value in register FOGC.Y */
+ machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+ }
machine->CurElement = col;
diff-tree bcc3baadbafc3f3deb79e3a753d9ee3867917073 (from 4ca7c804db63c9eeaddf1f65dc92006e2cabacec)
Author: Brian <brian at yutani.localnet.net>
Date: Sat Apr 28 08:50:07 2007 -0600
use EMIT_1F or EMIT_4F for fog depending on fragment program (bug 10788)
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index 360cc61..ccf0eb3 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -131,8 +131,10 @@ setup_vertex_format(GLcontext *ctx)
if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX ))
EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, index );
- if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG ))
- EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, attrib[FRAG_ATTRIB_FOGC]);
+ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) {
+ const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F;
+ EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]);
+ }
if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX))
{
More information about the mesa-commit
mailing list