GraphicsResourceAllocator .java

com.mojang.blaze3d.resource.GraphicsResourceAllocator (interface, 26 lines): members: UNPOOLED, acquire, release. imports: EnvType.

com.mojang.blaze3d.resourceinterface26 linesclient684 B

API Surface (2)

<T> T acquire(final ResourceDescriptor<T> descriptor)
<T> void release(final ResourceDescriptor<T> descriptor, final T resource)

Fields & Constants (1)

UNPOOLED

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

GraphicsResourceAllocator.java26 lines · Minecraft 26.3 · verbatim
1
package com.mojang.blaze3d.resource;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
6
@Environment(EnvType.CLIENT)
7
public interface GraphicsResourceAllocator {
8
	GraphicsResourceAllocator UNPOOLED = new GraphicsResourceAllocator() {
9
		@Override
10
		public <T> T acquire(final ResourceDescriptor<T> descriptor) {
11
			T resource = descriptor.allocate();
12
			descriptor.prepare(resource);
13
			return resource;
14
		}
15
16
		@Override
17
		public <T> void release(final ResourceDescriptor<T> descriptor, final T resource) {
18
			descriptor.free(resource);
19
		}
20
	};
21
22
	<T> T acquire(ResourceDescriptor<T> descriptor);
23
24
	<T> void release(ResourceDescriptor<T> descriptor, T resource);
25
}
26

Decompiled Minecraft 26.3 source of GraphicsResourceAllocator (com/mojang/blaze3d/resource/GraphicsResourceAllocator.java) with Mojang official mappings, stored verbatim on the site.