mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 20:45:59 +01:00
Fix occasional crash when flywheel objects are loaded in
This commit is contained in:
parent
a4d3f17fb3
commit
f7b8aedb95
@ -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 New Issue
Block a user