File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -77,25 +77,29 @@ class FIFOBufferAllocator extends Allocator {
7777 public var maxMemSize : Int = 512 * 1024 * 1024 ;
7878
7979 override function allocBuffer (vertices : Int , format : hxd. BufferFormat , flags : BufferFlags = Dynamic ): h3d. Buffer {
80- if ( vertices >= 65536 ) {
81- switch ( flags ) {
82- case UniformReadWrite :
83- default : throw " assert" ;
84- }
85- }
80+ if ( vertices >= 65536 )
81+ return super .allocBuffer (vertices , format , flags );
8682 checkFrame ();
8783 var id = flags .toInt () | (format .uid << 3 ) | (vertices << 16 );
8884 var c = buffers .get (id );
8985 if ( c != null ) {
9086 var b = c .get ();
91- if ( b != null ) return b ;
87+ if ( b != null ) {
88+ if ( b .vertices != vertices )
89+ throw " Buffer signature mismatch" ;
90+ return b ;
91+ }
9292 }
9393 checkGC ();
9494 return super .allocBuffer (vertices ,format ,flags );
9595 }
9696
9797 override function disposeBuffer (b : h3d. Buffer ) {
9898 if ( b .isDisposed () ) return ;
99+ if ( b .vertices >= 65536 ) {
100+ b .dispose ();
101+ return ;
102+ }
99103 var id = fromBufferFlags (b .flags ).toInt () | (b .format .uid << 3 ) | (b .vertices << 16 );
100104 var c = buffers .get (id );
101105 if ( c == null ) {
You can’t perform that action at this time.
0 commit comments