Package com.mojang.blaze3d.opengl
Class GlDevice
java.lang.Object
com.mojang.blaze3d.opengl.GlDevice
- All Implemented Interfaces:
GpuDevice
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GlDebugLabel
private final GlDebug
private final BiFunction
<ResourceLocation, ShaderType, String> private final DirectStateAccess
private final CommandEncoder
private static final org.slf4j.Logger
private final int
private final Map
<RenderPipeline, GlRenderPipeline> private final Map
<GlDevice.ShaderCompilationKey, GlShaderModule> protected static boolean
protected static boolean
protected static boolean
protected static boolean
protected static boolean
private final VertexArrayCache
-
Constructor Summary
ConstructorsConstructorDescriptionGlDevice
(long p_410629_, int p_410525_, boolean p_409747_, BiFunction<ResourceLocation, ShaderType, String> p_410292_, boolean p_410647_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
private GlRenderPipeline
compilePipeline
(RenderPipeline p_409588_, BiFunction<ResourceLocation, ShaderType, String> p_410709_) private GlShaderModule
compileShader
(GlDevice.ShaderCompilationKey p_410649_, BiFunction<ResourceLocation, ShaderType, String> p_409708_) createBuffer
(Supplier<String> p_409705_, BufferType p_409714_, BufferUsage p_409894_, int p_410348_) createBuffer
(Supplier<String> p_410492_, BufferType p_410400_, BufferUsage p_409641_, ByteBuffer p_410794_) createExternalTexture
(String label, int nativeId) Adopt an external OpenGL texture into a GpuTexture.createExternalTexture
(String label, TextureFormat format, int width, int height, int mipLevels, int nativeId) Create a new GPU texture from an existing texture whose lifecycle is externally managed.createTexture
(String p_409908_, TextureFormat p_410264_, int p_410354_, int p_410141_, int p_410230_) createTexture
(Supplier<String> p_410823_, TextureFormat p_409632_, int p_410064_, int p_410837_, int p_410395_) private static int
int
protected GlRenderPipeline
getOrCompilePipeline
(RenderPipeline p_410397_) protected GlShaderModule
getOrCompileShader
(ResourceLocation p_410881_, ShaderType p_409876_, ShaderDefines p_410398_, BiFunction<ResourceLocation, ShaderType, String> p_410158_) boolean
precompilePipeline
(RenderPipeline p_410489_, BiFunction<ResourceLocation, ShaderType, String> p_410134_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.mojang.blaze3d.systems.GpuDevice
precompilePipeline
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
USE_GL_ARB_vertex_attrib_binding
protected static boolean USE_GL_ARB_vertex_attrib_binding -
USE_GL_KHR_debug
protected static boolean USE_GL_KHR_debug -
USE_GL_EXT_debug_label
protected static boolean USE_GL_EXT_debug_label -
USE_GL_ARB_debug_output
protected static boolean USE_GL_ARB_debug_output -
USE_GL_ARB_direct_state_access
protected static boolean USE_GL_ARB_direct_state_access -
encoder
-
debugLog
-
debugLabels
-
maxSupportedTextureSize
private final int maxSupportedTextureSize -
directStateAccess
-
defaultShaderSource
-
pipelineCache
-
shaderCache
-
vertexArrayCache
-
enabledExtensions
-
-
Constructor Details
-
GlDevice
public GlDevice(long p_410629_, int p_410525_, boolean p_409747_, BiFunction<ResourceLocation, ShaderType, String> p_410292_, boolean p_410647_)
-
-
Method Details
-
debugLabels
-
createCommandEncoder
- Specified by:
createCommandEncoder
in interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable Supplier<String> p_410823_, TextureFormat p_409632_, int p_410064_, int p_410837_, int p_410395_) - Specified by:
createTexture
in interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable String p_409908_, TextureFormat p_410264_, int p_410354_, int p_410141_, int p_410230_) - Specified by:
createTexture
in interfaceGpuDevice
-
createExternalTexture
Adopt an external OpenGL texture into a GpuTexture. The lifecycle of the OpenGL texture will not be tied to this GpuTexture and the external system is responsible for cleaning up the OpenGL texture. Calling this is a relatively expensive operation since we introspect the texture using OpenGL getters. -
createExternalTexture
public GpuTexture createExternalTexture(@Nullable String label, TextureFormat format, int width, int height, int mipLevels, int nativeId) Create a new GPU texture from an existing texture whose lifecycle is externally managed. -
createBuffer
public GpuBuffer createBuffer(@Nullable Supplier<String> p_409705_, BufferType p_409714_, BufferUsage p_409894_, int p_410348_) - Specified by:
createBuffer
in interfaceGpuDevice
-
createBuffer
public GpuBuffer createBuffer(@Nullable Supplier<String> p_410492_, BufferType p_410400_, BufferUsage p_409641_, ByteBuffer p_410794_) - Specified by:
createBuffer
in interfaceGpuDevice
-
getImplementationInformation
- Specified by:
getImplementationInformation
in interfaceGpuDevice
-
getLastDebugMessages
- Specified by:
getLastDebugMessages
in interfaceGpuDevice
-
isDebuggingEnabled
public boolean isDebuggingEnabled()- Specified by:
isDebuggingEnabled
in interfaceGpuDevice
-
getRenderer
- Specified by:
getRenderer
in interfaceGpuDevice
-
getVendor
-
getBackendName
- Specified by:
getBackendName
in interfaceGpuDevice
-
getVersion
- Specified by:
getVersion
in interfaceGpuDevice
-
getMaxSupportedTextureSize
private static int getMaxSupportedTextureSize() -
getMaxTextureSize
public int getMaxTextureSize()- Specified by:
getMaxTextureSize
in interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCache
in interfaceGpuDevice
-
getEnabledExtensions
- Specified by:
getEnabledExtensions
in interfaceGpuDevice
-
close
public void close() -
directStateAccess
-
getOrCompilePipeline
-
getOrCompileShader
protected GlShaderModule getOrCompileShader(ResourceLocation p_410881_, ShaderType p_409876_, ShaderDefines p_410398_, BiFunction<ResourceLocation, ShaderType, String> p_410158_) -
precompilePipeline
public GlRenderPipeline precompilePipeline(RenderPipeline p_410489_, @Nullable BiFunction<ResourceLocation, ShaderType, String> p_410134_) - Specified by:
precompilePipeline
in interfaceGpuDevice
-
compileShader
private GlShaderModule compileShader(GlDevice.ShaderCompilationKey p_410649_, BiFunction<ResourceLocation, ShaderType, String> p_409708_) -
compilePipeline
private GlRenderPipeline compilePipeline(RenderPipeline p_409588_, BiFunction<ResourceLocation, ShaderType, String> p_410709_) -
vertexArrayCache
-