Package com.mojang.blaze3d.opengl
Class GlDevice
java.lang.Object
com.mojang.blaze3d.opengl.GlDevice
- All Implemented Interfaces:
GpuDevice,GpuDeviceExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BufferStorageprivate final GlDebugLabelprivate final GlDebugprivate final BiFunction<ResourceLocation, ShaderType, String> private final GpuDevicePropertiesprivate final DirectStateAccessprivate final GpuDeviceFeaturesprivate final CommandEncoderprivate static final org.slf4j.Loggerprivate final intprivate final Map<RenderPipeline, GlRenderPipeline> private final Map<GlDevice.ShaderCompilationKey, GlShaderModule> private final intprotected static booleanprotected 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 TypeMethodDescriptionprivate static voidvoidvoidclose()private GlRenderPipelinecompilePipeline(RenderPipeline pPipeline, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) private GlShaderModulecompileShader(GlDevice.ShaderCompilationKey pKey, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) createBuffer(Supplier<String> pLabel, int pUsage, int pSize) createBuffer(Supplier<String> pLabel, int pUsage, ByteBuffer pData) createExternalTexture(int usage, String label, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels, int nativeId) Create a new GPU texture from an existing texture whose lifecycle is externally managed.createExternalTexture(String label, int usage, int nativeId) Adopt an external OpenGL texture into a GpuTexture.createTexture(String pLabel, int pUsage, TextureFormat pFormat, int pWidth, int pHeight, int pDepthOrLayers, int pMipLevels) createTexture(Supplier<String> pLabel, int pUsage, TextureFormat pFormat, int pWidth, int pHeight, int pDepthOrLayers, int pMipLevels) createTextureView(GpuTexture pTexture) createTextureView(GpuTexture pTexture, int pBaseMipLevel, int pMipLevels) GpuDeviceFeatures enabled during device configuration.private static intintprotected GlRenderPipelinegetOrCompilePipeline(RenderPipeline pPipeline) protected GlShaderModulegetOrCompileShader(ResourceLocation pShader, ShaderType pType, ShaderDefines pDefines, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) intbooleanprecompilePipeline(RenderPipeline pRenderPipeline, BiFunction<ResourceLocation, ShaderType, String> pShaderSource) 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 -
USE_GL_ARB_buffer_storage
protected static boolean USE_GL_ARB_buffer_storage -
encoder
-
debugLog
-
debugLabels
-
maxSupportedTextureSize
private final int maxSupportedTextureSize -
directStateAccess
-
defaultShaderSource
-
pipelineCache
-
shaderCache
-
vertexArrayCache
-
bufferStorage
-
enabledExtensions
-
uniformOffsetAlignment
private final int uniformOffsetAlignment -
deviceProperties
-
enabledFeatures
-
-
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> pLabel, int pUsage, TextureFormat pFormat, int pWidth, int pHeight, int pDepthOrLayers, int pMipLevels) - Specified by:
createTexturein interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable String pLabel, int pUsage, TextureFormat pFormat, int pWidth, int pHeight, int pDepthOrLayers, int pMipLevels) - 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(int usage, @Nullable String label, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels, int nativeId) Create a new GPU texture from an existing texture whose lifecycle is externally managed. -
createTextureView
- Specified by:
createTextureViewin interfaceGpuDevice
-
createTextureView
- Specified by:
createTextureViewin interfaceGpuDevice
-
createBuffer
- Specified by:
createBufferin interfaceGpuDevice
-
createBuffer
- 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
-
getUniformOffsetAlignment
public int getUniformOffsetAlignment()- Specified by:
getUniformOffsetAlignmentin interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCachein interfaceGpuDevice
-
amdDummyShaderWorkaround
private static void amdDummyShaderWorkaround() -
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 pRenderPipeline, @Nullable BiFunction<ResourceLocation, ShaderType, String> pShaderSource) - 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
-
getBufferStorage
-
deviceProperties
- Specified by:
devicePropertiesin interfaceGpuDeviceExtension- See Also:
-
enabledFeatures
Description copied from interface:GpuDeviceExtensionGpuDeviceFeatures enabled during device configuration.- Specified by:
enabledFeaturesin interfaceGpuDeviceExtension- See Also:
-