Commit 9be8f36c authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Correct an off-by-one error in constant dirtification.

Constant numbers start at 0, and the loading loop has a for(i; i < dirtyconsts; i++). This means that the highest dirty constant isn't loaded correctly. Rather than replacing the < with <=, which would make it impossible to have no dirty constant, add 1 to the dirty constant counter.
parent 5bd57c59
......@@ -134,7 +134,7 @@ static unsigned int shader_arb_load_constantsF(IWineD3DBaseShaderImpl* This, Win
ret = 0;
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF, local_constant, entry) {
dirty_consts[lconst->idx] = 1; /* Dirtify so the non-immediate constant overwrites it next time */
ret = max(ret, lconst->idx);
ret = max(ret, lconst->idx + 1);
GL_EXTCALL(glProgramEnvParameter4fvARB(target_type, lconst->idx, (GLfloat*)lconst->value));
}
checkGLcall("glProgramEnvParameter4fvARB()");
......
......@@ -3602,7 +3602,7 @@ UINT count) {
*/
memset(This->activeContext->vshader_const_dirty + start, 1,
sizeof(*This->activeContext->vshader_const_dirty) * count);
This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start+count);
This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start+count+1);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT);
......@@ -4030,7 +4030,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF_DirtyConst(
*/
memset(This->activeContext->pshader_const_dirty + start, 1,
sizeof(*This->activeContext->pshader_const_dirty) * count);
This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start+count);
This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start+count+1);
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment