Skip to content

Commit

Permalink
Don't call glBufferSubData(GL_ARRAY_BUFFER, *, 0, *), which crashes s…
Browse files Browse the repository at this point in the history
…ome drivers.

Probably shouldn't have crashed... Fixes ticket:2293.

Changelog: Work around crash in some graphics drivers on some maps.
  • Loading branch information
Cyp committed Nov 7, 2010
1 parent eb32cd8 commit dbd2ecd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/terrain.c
Expand Up @@ -623,7 +623,13 @@ static void updateSectorGeometry(int x, int y)

free(geometry);
free(water);


if (sectors[x*ySectors + y].decalSize <= 0)
{
// Nothing to do here, and glBufferSubData(GL_ARRAY_BUFFER, 0, 0, *) crashes in my graphics driver. Probably shouldn't crash...
return;
}

decaldata = malloc(sizeof(DecalVertex)*sectors[x*ySectors + y].decalSize);
setSectorDecals(x, y, decaldata, &decalSize);
ASSERT(decalSize == sectors[x*ySectors + y].decalSize , "the amount of decals has changed");
Expand Down

0 comments on commit dbd2ecd

Please sign in to comment.