/** * Clean any VBO ids from the hardware, using the given utility object to do the work immediately, if given. If not, * we will delete in the next execution of the appropriate context's game task render queue. * * @param utils * the util class to use. If null, execution will not occur immediately. */ public static void cleanExpiredVBOs(final IShaderUtils utils) { // gather up expired vbos... final Multimap<RenderContextRef, Integer> idMap = gatherGCdIds(null); if (idMap != null) { // send to be deleted (perhaps on next render.) handleVBODelete(utils, idMap); } }
/** * Clean any VBO ids from the hardware, using the given Renderer object to do the work immediately, if given. If * not, we will delete in the next execution of the appropriate context's game task render queue. * * @param deleter * the Renderer to use. If null, execution will not occur immediately. */ public static void cleanExpiredVBOs(final Renderer deleter) { // gather up expired vbos... final Multimap<Object, Integer> idMap = gatherGCdIds(null); if (idMap != null) { // send to be deleted (perhaps on next render.) handleVBODelete(deleter, idMap); } }
public static void cleanAllVBOs(final Renderer deleter, final RenderContext context) { final Multimap<Object, Integer> idMap = ArrayListMultimap.create(); // gather up expired vbos... these don't exist in our cache gatherGCdIds(idMap); final Object glRep = context.getGlContextRep(); // Walk through the cached items and delete those too. for (final AbstractBufferData<?> buf : _identityCache.keySet()) { // only worry about buffers that have received ids. if (buf._vboIdCache != null) { final Integer id = buf._vboIdCache.removeValue(glRep); if (id != null && id.intValue() != 0) { idMap.put(context.getGlContextRep(), id); } } } handleVBODelete(deleter, idMap); }
public static void cleanAllBuffers(final IShaderUtils utils, final RenderContext context) { final Multimap<RenderContextRef, Integer> idMap = ArrayListMultimap.create(); // gather up expired vbos... these don't exist in our cache gatherGCdIds(idMap); final RenderContextRef glRef = context.getGlContextRef(); // Walk through the cached items and delete those too. for (final AbstractBufferData<?> buf : _identityCache.keySet()) { // only worry about buffers that have received ids. if (buf._bufferIdCache != null) { final Integer id = buf._bufferIdCache.removeValue(glRef); if (id != null && id.intValue() != 0) { idMap.put(context.getGlContextRef(), id); } } } handleVBODelete(utils, idMap); }
public static void cleanAllVBOs(final Renderer deleter) { final Multimap<Object, Integer> idMap = ArrayListMultimap.create(); // gather up expired vbos... these don't exist in our cache gatherGCdIds(idMap); // Walk through the cached items and delete those too. for (final AbstractBufferData<?> buf : _identityCache.keySet()) { if (buf._vboIdCache != null) { if (Constants.useMultipleContexts) { final Set<Object> contextObjects = buf._vboIdCache.getContextObjects(); for (final Object o : contextObjects) { // Add id to map idMap.put(o, buf.getVBOID(o)); } } else { idMap.put(ContextManager.getCurrentContext().getGlContextRep(), buf.getVBOID(null)); } buf._vboIdCache.clear(); } } handleVBODelete(deleter, idMap); }
public static void cleanAllBuffers(final IShaderUtils utils) { final Multimap<RenderContextRef, Integer> idMap = ArrayListMultimap.create(); // gather up expired vbos... these don't exist in our cache gatherGCdIds(idMap); // Walk through the cached items and delete those too. for (final AbstractBufferData<?> buf : _identityCache.keySet()) { if (buf._bufferIdCache != null) { if (Constants.useMultipleContexts) { final Set<RenderContextRef> contextObjects = buf._bufferIdCache.getContextRefs(); for (final RenderContextRef o : contextObjects) { // Add id to map idMap.put(o, buf.getBufferIdByRef(o)); } } else { idMap.put(ContextManager.getCurrentContext().getGlContextRef(), buf.getBufferIdByRef(null)); } buf._bufferIdCache.clear(); buf.markDirty(); } } handleVBODelete(utils, idMap); }