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 window, int debugVerbosity, boolean synchronous, BiFunction<ResourceLocation, ShaderType, String> defaultShaderSource, boolean renderDebugLabels) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()private GlRenderPipelinecompilePipeline(RenderPipeline pipeline, BiFunction<ResourceLocation, ShaderType, String> shaderSource) private GlShaderModulecompileShader(GlDevice.ShaderCompilationKey key, BiFunction<ResourceLocation, ShaderType, String> shaderSource) createBuffer(Supplier<String> p_409705_, int p_410348_, int p_418515_) createBuffer(Supplier<String> p_410492_, int p_418387_, ByteBuffer p_410794_) 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 p_419622_, int p_410064_, TextureFormat p_409632_, int p_410837_, int p_410395_, int p_419883_, int p_423630_) createTexture(Supplier<String> p_419620_, int p_410354_, TextureFormat p_410264_, int p_410141_, int p_410230_, int p_419503_, int p_423479_) createTextureView(GpuTexture p_423640_) createTextureView(GpuTexture p_423535_, int p_423686_, int p_423461_) GpuDeviceFeatures enabled during device configuration.private static intintprotected GlRenderPipelinegetOrCompilePipeline(RenderPipeline pipeline) protected GlShaderModulegetOrCompileShader(ResourceLocation shader, ShaderType type, ShaderDefines defines, BiFunction<ResourceLocation, ShaderType, String> shaderSource) intbooleanprecompilePipeline(RenderPipeline p_410489_, BiFunction<ResourceLocation, ShaderType, String> p_410134_) private static voidMethods 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 window, int debugVerbosity, boolean synchronous, BiFunction<ResourceLocation, ShaderType, String> defaultShaderSource, boolean renderDebugLabels)
-
-
Method Details
-
debugLabels
-
createCommandEncoder
- Specified by:
createCommandEncoderin interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable Supplier<String> p_419620_, int p_410354_, TextureFormat p_410264_, int p_410141_, int p_410230_, int p_419503_, int p_423479_) - Specified by:
createTexturein interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable String p_419622_, int p_410064_, TextureFormat p_409632_, int p_410837_, int p_410395_, int p_419883_, int p_423630_) - 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
public GpuBuffer createBuffer(@Nullable Supplier<String> p_410492_, int p_418387_, 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
-
getUniformOffsetAlignment
public int getUniformOffsetAlignment()- Specified by:
getUniformOffsetAlignmentin interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCachein interfaceGpuDevice
-
sacrificeShaderToOpenGlAndAmd
private static void sacrificeShaderToOpenGlAndAmd() -
getEnabledExtensions
- Specified by:
getEnabledExtensionsin interfaceGpuDevice
-
close
public void close() -
directStateAccess
-
getOrCompilePipeline
-
getOrCompileShader
protected GlShaderModule getOrCompileShader(ResourceLocation shader, ShaderType type, ShaderDefines defines, BiFunction<ResourceLocation, ShaderType, String> shaderSource) -
precompilePipeline
public GlRenderPipeline precompilePipeline(RenderPipeline p_410489_, @Nullable BiFunction<ResourceLocation, ShaderType, String> p_410134_) - Specified by:
precompilePipelinein interfaceGpuDevice
-
compileShader
private GlShaderModule compileShader(GlDevice.ShaderCompilationKey key, BiFunction<ResourceLocation, ShaderType, String> shaderSource) -
compilePipeline
private GlRenderPipeline compilePipeline(RenderPipeline pipeline, BiFunction<ResourceLocation, ShaderType, String> shaderSource) -
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:
-