From: Keith Whitwell Date: Fri, 10 Oct 2008 14:19:05 +0000 (+0100) Subject: Merge commit 'origin/gallium-0.1' into gallium-0.2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7f1cb5b5a134b63227d5746a2dd1f05597c5c2f;p=mesa.git Merge commit 'origin/gallium-0.1' into gallium-0.2 Conflicts: src/gallium/auxiliary/gallivm/instructionssoa.cpp src/gallium/auxiliary/gallivm/soabuiltins.c src/gallium/auxiliary/rtasm/rtasm_x86sse.c src/gallium/auxiliary/rtasm/rtasm_x86sse.h src/mesa/main/texenvprogram.c src/mesa/shader/arbprogparse.c src/mesa/shader/prog_statevars.c src/mesa/state_tracker/st_draw.c src/mesa/vbo/vbo_exec_draw.c --- d7f1cb5b5a134b63227d5746a2dd1f05597c5c2f diff --cc src/mesa/main/mtypes.h index 8e4f6a2e663,dff474d6d0e..8bf6858c1e3 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@@ -3049,12 -3073,11 +3050,14 @@@ struct __GLcontextRe GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ + GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */ + /** \name Derived state */ /*@{*/ - GLbitfield _TriangleCaps; /**< bitwise-or of DD_* flags */ + /** Bitwise-or of DD_* flags. Note that this bitfield may be used before + * state validation so they need to always be current. + */ + GLbitfield _TriangleCaps; GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ GLfloat _EyeZDir[3]; GLfloat _ModelViewInvScale; diff --cc src/mesa/shader/prog_statevars.c index d4e31207e84,9cc33fa2c11..34c47413506 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@@ -487,20 -494,10 +493,23 @@@ _mesa_fetch_state(GLcontext *ctx, cons case STATE_PCM_BIAS: COPY_4V(value, ctx->Pixel.PostColorMatrixBias); break; + case STATE_SHADOW_AMBIENT: + { + const int unit = (int) state[2]; + const struct gl_texture_object *texObj + = ctx->Texture.Unit[unit]._Current; + if (texObj) { + value[0] = texObj->ShadowAmbient; + value[1] = texObj->ShadowAmbient; + value[2] = texObj->ShadowAmbient; + value[3] = texObj->ShadowAmbient; + } + } + return; + /* XXX: make sure new tokens added here are also handled in the + * _mesa_program_state_flags() switch, below. + */ default: /* unknown state indexes are silently ignored * should be handled by the driver. @@@ -574,8 -571,13 +583,14 @@@ _mesa_program_state_flags(const gl_stat case STATE_INTERNAL: switch (state[1]) { + case STATE_CURRENT_ATTRIB: + return _NEW_CURRENT_ATTRIB; + + case STATE_NORMAL_SCALE: + return _NEW_MODELVIEW; + case STATE_TEXRECT_SCALE: + case STATE_SHADOW_AMBIENT: return _NEW_TEXTURE; case STATE_FOG_PARAMS_OPTIMIZED: return _NEW_FOG; diff --cc src/mesa/vbo/vbo_exec_draw.c index 92356ba9773,ae43857c8ae..5bf3d836db5 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@@ -242,11 -246,12 +246,14 @@@ void vbo_exec_vtx_flush( struct vbo_exe */ vbo_exec_bind_arrays( ctx ); + if (ctx->NewState) + _mesa_update_state( ctx ); + - - ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); - exec->vtx.buffer_map = NULL; + /* if using a real VBO, unmap it before drawing */ + if (exec->vtx.bufferobj->Name) { + ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); + exec->vtx.buffer_map = NULL; + } vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs,