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 GlDebugLabelprivate final GlDebugprivate final BiFunction<ResourceLocation, ShaderType, String> private final DirectStateAccessprivate final CommandEncoderprivate static final org.slf4j.Loggerprivate final intprivate final Map<RenderPipeline, GlRenderPipeline> private final Map<GlDevice.ShaderCompilationKey, GlShaderModule> protected static booleanprotected static booleanprotected static booleanprotected static booleanprotected static booleanprivate final VertexArrayCache -
Constructor Summary
ConstructorsConstructorDescriptionGlDevice(long pWindow, int pDebugVerbosity, boolean pSynchronous, BiFunction<ResourceLocation, ShaderType, String> pDefaultShaderSource, boolean pRenderDebugLabels) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()private GlRenderPipelinecompilePipeline(RenderPipeline pPipeline, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) private GlShaderModulecompileShader(GlDevice.ShaderCompilationKey pKey, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) 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 intintprotected GlRenderPipelinegetOrCompilePipeline(RenderPipeline pPipeline) protected GlShaderModulegetOrCompileShader(ResourceLocation pShader, ShaderType pType, ShaderDefines pDefines, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) booleanprecompilePipeline(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, waitMethods 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 pWindow, int pDebugVerbosity, boolean pSynchronous, BiFunction<ResourceLocation, ShaderType, String> pDefaultShaderSource, boolean pRenderDebugLabels)
-
-
Method Details
-
debugLabels
-
createCommandEncoder
- Specified by:
createCommandEncoderin interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable Supplier<String> p_410823_, TextureFormat p_409632_, int p_410064_, int p_410837_, int p_410395_) - Specified by:
createTexturein interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable String p_409908_, TextureFormat p_410264_, int p_410354_, int p_410141_, int p_410230_) - Specified by:
createTexturein 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:
createBufferin interfaceGpuDevice
-
createBuffer
public GpuBuffer createBuffer(@Nullable Supplier<String> p_410492_, BufferType p_410400_, BufferUsage p_409641_, ByteBuffer p_410794_) - Specified by:
createBufferin interfaceGpuDevice
-
getImplementationInformation
- Specified by:
getImplementationInformationin interfaceGpuDevice
-
getLastDebugMessages
- Specified by:
getLastDebugMessagesin interfaceGpuDevice
-
isDebuggingEnabled
public boolean isDebuggingEnabled()- Specified by:
isDebuggingEnabledin interfaceGpuDevice
-
getRenderer
- Specified by:
getRendererin interfaceGpuDevice
-
getVendor
-
getBackendName
- Specified by:
getBackendNamein interfaceGpuDevice
-
getVersion
- Specified by:
getVersionin interfaceGpuDevice
-
getMaxSupportedTextureSize
private static int getMaxSupportedTextureSize() -
getMaxTextureSize
public int getMaxTextureSize()- Specified by:
getMaxTextureSizein interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCachein interfaceGpuDevice
-
getEnabledExtensions
- Specified by:
getEnabledExtensionsin interfaceGpuDevice
-
close
public void close() -
directStateAccess
-
getOrCompilePipeline
-
getOrCompileShader
protected GlShaderModule getOrCompileShader(ResourceLocation pShader, ShaderType pType, ShaderDefines pDefines, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) -
precompilePipeline
public GlRenderPipeline precompilePipeline(RenderPipeline p_410489_, @Nullable BiFunction<ResourceLocation, ShaderType, String> p_410134_) - Specified by:
precompilePipelinein interfaceGpuDevice
-
compileShader
private GlShaderModule compileShader(GlDevice.ShaderCompilationKey pKey, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) -
compilePipeline
private GlRenderPipeline compilePipeline(RenderPipeline pPipeline, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) -
vertexArrayCache
-