Package icyllis.arc3d.opengl
Class GLCaps
java.lang.Object
icyllis.arc3d.engine.Caps
icyllis.arc3d.opengl.GLCaps
- Direct Known Subclasses:
GLCaps_GL,GLCaps_GLES
Stores some capabilities of an OpenGL device.
OpenGL 3.3 or OpenGL ES 3.0 is the minimum requirement.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.engine.Caps
Caps.BlendEquationSupport -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intContains missing extensions on the last creation of GPU.Fields inherited from class icyllis.arc3d.engine.Caps
mAnisotropySupport, MAX_COLOR_TARGETS, MAX_VERTEX_ATTRIBUTES, MAX_VERTEX_BINDINGS, mBlendEquationSupport, mClampToBorderSupport, mConservativeRasterSupport, mDepthClipNegativeOneToOne, mDriverBugWorkarounds, mDynamicStateArrayGeometryProcessorTextureSupport, mGpuTracingSupport, mInternalMultisampleCount, mMapBufferFlags, mMaxColorAttachments, mMaxPreferredRenderTargetSize, mMaxPushConstantsSize, mMaxRenderTargetSize, mMaxTextureSize, mMaxVertexAttributes, mMaxVertexBindings, mMinStorageBufferOffsetAlignment, mMinUniformBufferOffsetAlignment, mMustSyncGpuDuringDiscard, mShaderCaps, mTextureBarrierSupport, mTransferPixelsToRowBytesSupport -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCopyImage(int srcFormat, int srcSampleCount, int dstFormat, int dstSampleCount) booleancanCopyTexSubImage(int srcFormat, int dstFormat) computeImageKey(ImageDesc desc, IResourceKey recycle) voiddump(StringBuilder out, boolean includeFormatTable) @Nullable BackendFormatgetCompressedBackendFormat(int compressionType) @Nullable ImageDescgetDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int mipLevelCount, int sampleCount, int imageFlags) @Nullable ImageDescgetDefaultDepthStencilImageDesc(int depthBits, int stencilBits, int width, int height, int sampleCount, int imageFlags) static intgetExternalTypeAlignment(int type) intgetFormatDefaultExternalFormat(int format) Gets the default external format to use with glTex[Sub]Image...intgetFormatDefaultExternalType(int format) Gets the default external type to use with glTex[Sub]Image...intReturns the minimum GLSL version that supported by the OpenGL device, this is based on OpenGL version.@Nullable ImageDescgetImageDescForSampledCopy(ImageDesc src, int width, int height, int depthOrArraySize, int imageFlags) intintgetMaxRenderTargetSampleCount(int format) intReturns the maximum supported sample count for a format.intgetPixelsExternalFormat(int format, int dstColorType, int srcColorType, boolean write) intgetPixelsExternalType(int format, int dstColorType, int srcColorType) int @Nullable []intgetRenderbufferInternalFormat(int format) Gets the internal format to use with glRenderbufferStorageMultisample...().intgetRenderTargetSampleCount(int sampleCount, int format) intgetRenderTargetSampleCount(int sampleCount, BackendFormat format) Find a sample count greater than or equal to the requested count which is supported for a render target of the given format or 0 if no such sample count is supported.longgetSupportedWriteColorType(int dstColorType, ImageDesc dstDesc, int srcColorType) Given a dst pixel config and a src color type what color type must the caller coax the data into in order to use writePixels().intgetTextureInternalFormat(int format) Gets the internal format to use with glTexImage...() and glTexStorage...().shortgetWriteSwizzle(ImageDesc desc, int colorType) booleanbooleanbooleanbooleanbooleanbooleanModern OpenGL means OpenGL 4.5 is supported, so all of the following are supported: ARB_ES2_compatibility ARB_get_program_binary ARB_base_instance ARB_texture_storage ARB_internalformat_query ARB_shading_language_420pack ARB_invalidate_subdata ARB_explicit_uniform_location ARB_vertex_attrib_binding ARB_ES3_compatibility ARB_clear_texture ARB_buffer_storage ARB_enhanced_layouts ARB_texture_barrier ARB_direct_state_access Arc3D requires OpenGL 3.3 at least.booleanbooleanbooleanbooleanbooleanbooleanisFormatRenderable(int format, int sampleCount) booleanisFormatRenderable(int colorType, BackendFormat format, int sampleCount) booleanisFormatRenderable(BackendFormat format, int sampleCount) booleanisFormatTexturable(int format) booleanisFormatTexturable(BackendFormat format) Can a texture be made with the BackendFormat, and then be bound and sampled in a shader.abstract booleanisGLES()Returns true if OpenGL ES (embedded system), returns false if OpenGL (desktop, core profile).booleanisTextureStorageCompatible(int format) @NonNull PipelineKeymakeGraphicsPipelineKey(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) intfloatprotected voidonApplyOptionsOverrides(ContextOptions options) booleanonFormatCompatible(int colorType, BackendFormat format) protected @Nullable BackendFormatonGetDefaultBackendFormat(int colorType) protected shortonGetReadSwizzle(ImageDesc desc, int colorType) protected longonSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) booleanSkip checks for GL errors, shader compilation success, program link success.toString()booleanMethods inherited from class icyllis.arc3d.engine.Caps
advancedBlendEquationSupport, advancedCoherentBlendEquationSupport, avoidLargeIndexBufferDraws, avoidStencilBuffers, avoidWritePixelsFastPath, blendEquationSupport, clampToBorderSupport, conservativeRasterSupport, crossContextTextureSupport, depthClipNegativeOneToOne, discardStencilValuesAfterRenderPass, drawInstancedSupport, dynamicStateArrayGeometryProcessorTextureSupport, fenceSyncSupport, finishInitialization, getDefaultBackendFormat, getDefaultColorImageDesc, getInternalMultisampleCount, getReadSwizzle, getSupportedReadColorType, gpuTracingSupport, halfFloatVertexAttributeSupport, hasAnisotropySupport, isFormatCompatible, maxColorAttachments, maxPreferredRenderTargetSize, maxPushConstantsSize, maxRenderTargetSize, maxTextureSize, maxVertexAttributes, maxVertexBindings, minStorageBufferOffsetAlignment, minUniformBufferOffsetAlignment, mipmapSupport, msaaResolvesAutomatically, mustClearUploadedBufferData, mustSyncGpuDuringDiscard, nativeDrawIndexedIndirectIsBroken, npotTextureTileSupport, oversizedStencilSupport, performColorClearsAsDraws, performPartialClearsAsDraws, performStencilClearsAsDraws, preferClientSideDynamicBuffers, preferDiscardableMSAAAttachment, preferFullscreenClears, preferVRAMUseOverFlushes, readPixelsRowBytesSupport, reducedShaderMode, requiresManualFBBarrierAfterTessellatedStencilDraw, reuseScratchBuffers, reuseScratchTextures, sampleLocationsSupport, semaphoreSupport, shaderCaps, shouldCollapseSrcOverToSrcWhenAble, shouldInitializeTextures, supportsTextureBarrier, textureBarrierSupport, transferBufferAlignment, transferFromBufferToTextureSupport, transferFromSurfaceToBufferSupport, transferPixelsToRowBytesSupport, twoSidedStencilRefsAndMasksMustMatch, usePrimitiveRestart, validateAttachmentParams, validateSurfaceParams, wireframeSupport, workarounds, writePixelsRowBytesSupport
-
Field Details
-
MISSING_EXTENSIONS
Contains missing extensions on the last creation of GPU. No synchronization. -
INVALIDATE_BUFFER_TYPE_NULL_DATA
public static final int INVALIDATE_BUFFER_TYPE_NULL_DATA- See Also:
-
INVALIDATE_BUFFER_TYPE_INVALIDATE
public static final int INVALIDATE_BUFFER_TYPE_INVALIDATE- See Also:
-
-
Method Details
-
getVendor
-
getDriver
-
isGLES
public abstract boolean isGLES()Returns true if OpenGL ES (embedded system), returns false if OpenGL (desktop, core profile). -
hasDSASupport
public boolean hasDSASupport()Modern OpenGL means OpenGL 4.5 is supported, so all of the following are supported:- ARB_ES2_compatibility
- ARB_get_program_binary
- ARB_base_instance
- ARB_texture_storage
- ARB_internalformat_query
- ARB_shading_language_420pack
- ARB_invalidate_subdata
- ARB_explicit_uniform_location
- ARB_vertex_attrib_binding
- ARB_ES3_compatibility
- ARB_clear_texture
- ARB_buffer_storage
- ARB_enhanced_layouts
- ARB_texture_barrier
- ARB_direct_state_access
-
getInvalidateBufferType
public int getInvalidateBufferType() -
hasDebugSupport
public boolean hasDebugSupport() -
hasDrawElementsBaseVertexSupport
public boolean hasDrawElementsBaseVertexSupport() -
hasBaseInstanceSupport
public boolean hasBaseInstanceSupport() -
hasVertexAttribBindingSupport
public boolean hasVertexAttribBindingSupport() -
hasCopyImageSupport
public boolean hasCopyImageSupport() -
hasBufferStorageSupport
public boolean hasBufferStorageSupport() -
hasSPIRVSupport
public boolean hasSPIRVSupport() -
hasProgramBinarySupport
public boolean hasProgramBinarySupport() -
useStagingBuffers
public boolean useStagingBuffers() -
hasVolatileContext
public boolean hasVolatileContext() -
hasInvalidateFramebufferSupport
public boolean hasInvalidateFramebufferSupport() -
getProgramBinaryFormats
public int @Nullable [] getProgramBinaryFormats() -
getGLSLVersion
public int getGLSLVersion()Returns the minimum GLSL version that supported by the OpenGL device, this is based on OpenGL version. May return 300, 310, 320 for es profile, 330 or above for core profile.The effective GLSL version that used by our pipeline and shader builder is
ShaderCaps.mGLSLVersion. -
isFormatTexturable
Description copied from class:CapsCan a texture be made with the BackendFormat, and then be bound and sampled in a shader. It must be a color format, you cannot pass a stencil format here.For OpenGL: Formats that deprecated in core profile are not supported; Compressed formats from extensions are uncertain; Others are always supported.
- Specified by:
isFormatTexturablein classCaps
-
isFormatTexturable
public boolean isFormatTexturable(int format) -
isTextureStorageCompatible
public boolean isTextureStorageCompatible(int format) -
getMaxRenderTargetSampleCount
Description copied from class:CapsReturns the maximum supported sample count for a format. 0 means the format is not renderable 1 means the format is renderable but doesn't support MSAA.- Specified by:
getMaxRenderTargetSampleCountin classCaps
-
getMaxRenderTargetSampleCount
public int getMaxRenderTargetSampleCount(int format) -
isFormatRenderable
- Specified by:
isFormatRenderablein classCaps
-
isFormatRenderable
- Specified by:
isFormatRenderablein classCaps
-
isFormatRenderable
public boolean isFormatRenderable(int format, int sampleCount) -
getRenderTargetSampleCount
Description copied from class:CapsFind a sample count greater than or equal to the requested count which is supported for a render target of the given format or 0 if no such sample count is supported. If the requested sample count is 1 then 1 will be returned if non-MSAA rendering is supported, otherwise 0.- Specified by:
getRenderTargetSampleCountin classCaps- Parameters:
sampleCount- requested samples
-
getRenderTargetSampleCount
public int getRenderTargetSampleCount(int sampleCount, int format) -
getDefaultColorImageDesc
public @Nullable ImageDesc getDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int mipLevelCount, int sampleCount, int imageFlags) - Overrides:
getDefaultColorImageDescin classCaps- Parameters:
imageType-colorType-width-height-depthOrArraySize-mipLevelCount-sampleCount-imageFlags-- Returns:
- See Also:
-
getDefaultDepthStencilImageDesc
public @Nullable ImageDesc getDefaultDepthStencilImageDesc(int depthBits, int stencilBits, int width, int height, int sampleCount, int imageFlags) - Overrides:
getDefaultDepthStencilImageDescin classCaps
-
getImageDescForSampledCopy
public @Nullable ImageDesc getImageDescForSampledCopy(ImageDesc src, int width, int height, int depthOrArraySize, int imageFlags) - Overrides:
getImageDescForSampledCopyin classCaps
-
onFormatCompatible
- Specified by:
onFormatCompatiblein classCaps
-
onGetDefaultBackendFormat
- Specified by:
onGetDefaultBackendFormatin classCaps
-
getCompressedBackendFormat
- Specified by:
getCompressedBackendFormatin classCaps
-
makeGraphicsPipelineKey
public @NonNull PipelineKey makeGraphicsPipelineKey(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) - Specified by:
makeGraphicsPipelineKeyin classCaps
-
onGetReadSwizzle
- Specified by:
onGetReadSwizzlein classCaps
-
getWriteSwizzle
- Specified by:
getWriteSwizzlein classCaps
-
computeImageKey
- Specified by:
computeImageKeyin classCaps
-
getSupportedWriteColorType
Description copied from class:CapsGiven a dst pixel config and a src color type what color type must the caller coax the data into in order to use writePixels().Low 32bits - colorType ((int) value). High 32bits - transferOffsetAlignment (value >>> 32). If the
writeis occurring using transferPixelsTo() then this provides the minimum alignment of the offset into the transfer buffer.- Specified by:
getSupportedWriteColorTypein classCaps
-
getExternalTypeAlignment
public static int getExternalTypeAlignment(int type) -
onSupportedReadColorType
protected long onSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) - Specified by:
onSupportedReadColorTypein classCaps
-
onApplyOptionsOverrides
- Overrides:
onApplyOptionsOverridesin classCaps
-
getTextureInternalFormat
public int getTextureInternalFormat(int format) Gets the internal format to use with glTexImage...() and glTexStorage...(). May be sized or base depending upon the GL. Not applicable to compressed textures. -
getRenderbufferInternalFormat
public int getRenderbufferInternalFormat(int format) Gets the internal format to use with glRenderbufferStorageMultisample...(). May be sized or base depending upon the GL. Not applicable to compressed textures. -
getFormatDefaultExternalFormat
public int getFormatDefaultExternalFormat(int format) Gets the default external format to use with glTex[Sub]Image... when the data pointer is null. -
getFormatDefaultExternalType
public int getFormatDefaultExternalType(int format) Gets the default external type to use with glTex[Sub]Image... when the data pointer is null. -
getPixelsExternalFormat
public int getPixelsExternalFormat(int format, int dstColorType, int srcColorType, boolean write) -
getPixelsExternalType
public int getPixelsExternalType(int format, int dstColorType, int srcColorType) -
canCopyImage
public boolean canCopyImage(int srcFormat, int srcSampleCount, int dstFormat, int dstSampleCount) -
canCopyTexSubImage
public boolean canCopyTexSubImage(int srcFormat, int dstFormat) -
skipErrorChecks
public boolean skipErrorChecks()Skip checks for GL errors, shader compilation success, program link success. -
maxLabelLength
public int maxLabelLength() -
maxTextureMaxAnisotropy
public float maxTextureMaxAnisotropy() -
toString
-
dump
-