wined3d: Merge two if conditions in buffer.c.

This commit is contained in:
Stefan Dösinger 2010-03-11 15:21:40 +01:00 committed by Alexandre Julliard
parent 2ca477c831
commit b621fac215
1 changed files with 13 additions and 16 deletions

View File

@ -900,6 +900,19 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
goto end;
}
buffer_check_buffer_object_size(This);
/* The declaration changed, reload the whole buffer */
WARN("Reloading buffer because of decl change\n");
buffer_clear_dirty_areas(This);
if(!buffer_add_dirty_area(This, 0, 0))
{
ERR("buffer_add_dirty_area failed, this is not expected\n");
return;
}
/* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
* cleared for unsynchronized updates
*/
flags = 0;
}
else
{
@ -927,22 +940,6 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
}
}
if (decl_changed)
{
/* The declaration changed, reload the whole buffer */
WARN("Reloading buffer because of decl change\n");
buffer_clear_dirty_areas(This);
if(!buffer_add_dirty_area(This, 0, 0))
{
ERR("buffer_add_dirty_area failed, this is not expected\n");
return;
}
/* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
* cleared for unsynchronized updates
*/
flags = 0;
}
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{
IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);