mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
Fix occasional crash when flywheel objects are loaded in
This commit is contained in:
parent
c07c6363f9
commit
20a75321e2
2 changed files with 2 additions and 4 deletions
|
@ -44,7 +44,7 @@ public class InstancedMaterialGroup<P extends WorldProgram> implements MaterialG
|
||||||
.onAMDWindows()) {
|
.onAMDWindows()) {
|
||||||
this.allocator = FallbackAllocator.INSTANCE;
|
this.allocator = FallbackAllocator.INSTANCE;
|
||||||
} else {
|
} else {
|
||||||
this.allocator = new ModelPool(Formats.POS_TEX_NORMAL, 2048);
|
this.allocator = new ModelPool(Formats.POS_TEX_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,16 +35,14 @@ public class ModelPool implements ModelAllocator {
|
||||||
* Create a new model pool.
|
* Create a new model pool.
|
||||||
*
|
*
|
||||||
* @param vertexType The vertex type of the models that will be stored in the pool.
|
* @param vertexType The vertex type of the models that will be stored in the pool.
|
||||||
* @param initialSize The initial size of the pool, in vertices.
|
|
||||||
*/
|
*/
|
||||||
public ModelPool(VertexType vertexType, int initialSize) {
|
public ModelPool(VertexType vertexType) {
|
||||||
this.vertexType = vertexType;
|
this.vertexType = vertexType;
|
||||||
int stride = vertexType.getStride();
|
int stride = vertexType.getStride();
|
||||||
|
|
||||||
vbo = new MappedGlBuffer(GlBufferType.ARRAY_BUFFER);
|
vbo = new MappedGlBuffer(GlBufferType.ARRAY_BUFFER);
|
||||||
|
|
||||||
vbo.bind();
|
vbo.bind();
|
||||||
vbo.ensureCapacity((long) stride * initialSize);
|
|
||||||
vbo.setGrowthMargin(stride * 64);
|
vbo.setGrowthMargin(stride * 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue