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
Modifier and TypeFieldDescriptionstatic final int
static final int
Contains 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, mUseCpuStagingBuffers
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canCopyImage
(int srcFormat, int srcSampleCount, int dstFormat, int dstSampleCount) boolean
canCopyTexSubImage
(int srcFormat, int dstFormat) computeImageKey
(ImageDesc desc, IResourceKey recycle) void
dump
(StringBuilder out, boolean includeFormatTable) getCompressedBackendFormat
(int compressionType) getDefaultColorImageDesc
(int imageType, int colorType, int width, int height, int depthOrArraySize, int mipLevelCount, int sampleCount, int imageFlags) getDefaultDepthStencilImageDesc
(int depthBits, int stencilBits, int width, int height, int sampleCount, int imageFlags) static int
getExternalTypeAlignment
(int type) int
getFormatDefaultExternalFormat
(int format) Gets the default external format to use with glTex[Sub]Image...int
getFormatDefaultExternalType
(int format) Gets the default external type to use with glTex[Sub]Image...int
Returns the minimum GLSL version that supported by the OpenGL device, this is based on OpenGL version.getImageDescForSampledCopy
(ImageDesc src, int width, int height, int depthOrArraySize, int imageFlags) int
int
getMaxRenderTargetSampleCount
(int format) int
Returns the maximum supported sample count for a format.int
getPixelsExternalFormat
(int format, int dstColorType, int srcColorType, boolean write) int
getPixelsExternalType
(int format, int dstColorType, int srcColorType) int[]
int
getRenderbufferInternalFormat
(int format) Gets the internal format to use with glRenderbufferStorageMultisample...().int
getRenderTargetSampleCount
(int sampleCount, int format) int
getRenderTargetSampleCount
(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.long
getSupportedWriteColorType
(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().int
getTextureInternalFormat
(int format) Gets the internal format to use with glTexImage...() and glTexStorage...().short
getWriteSwizzle
(ImageDesc desc, int colorType) boolean
boolean
boolean
boolean
boolean
boolean
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 Arc3D requires OpenGL 3.3 at least.boolean
boolean
boolean
boolean
boolean
boolean
isFormatRenderable
(int format, int sampleCount) boolean
isFormatRenderable
(int colorType, BackendFormat format, int sampleCount) boolean
isFormatRenderable
(BackendFormat format, int sampleCount) boolean
isFormatTexturable
(int format) boolean
isFormatTexturable
(BackendFormat format) Can a texture be made with the BackendFormat, and then be bound and sampled in a shader.abstract boolean
isGLES()
Returns true if OpenGL ES (embedded system), returns false if OpenGL (desktop, core profile).boolean
isTextureStorageCompatible
(int format) makeDesc
(PipelineKey_old desc, GpuRenderTarget renderTarget, GraphicsPipelineDesc_Old graphicsPipelineDesc) makeGraphicsPipelineKey
(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) int
float
protected void
onApplyOptionsOverrides
(ContextOptions options) boolean
onFormatCompatible
(int colorType, BackendFormat format) protected BackendFormat
onGetDefaultBackendFormat
(int colorType) protected short
onGetReadSwizzle
(ImageDesc desc, int colorType) protected long
onSupportedReadColorType
(int srcColorType, BackendFormat srcFormat, int dstColorType) boolean
Skip checks for GL errors, shader compilation success, program link success.toString()
Methods 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, useCpuStagingBuffers, 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() -
hasVolatileContext
public boolean hasVolatileContext() -
hasInvalidateFramebufferSupport
public boolean hasInvalidateFramebufferSupport() -
getProgramBinaryFormats
@Nullable public int[] 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:Caps
Can 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:
isFormatTexturable
in classCaps
-
isFormatTexturable
public boolean isFormatTexturable(int format) -
isTextureStorageCompatible
public boolean isTextureStorageCompatible(int format) -
getMaxRenderTargetSampleCount
Description copied from class:Caps
Returns 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:
getMaxRenderTargetSampleCount
in classCaps
-
getMaxRenderTargetSampleCount
public int getMaxRenderTargetSampleCount(int format) -
isFormatRenderable
- Specified by:
isFormatRenderable
in classCaps
-
isFormatRenderable
- Specified by:
isFormatRenderable
in classCaps
-
isFormatRenderable
public boolean isFormatRenderable(int format, int sampleCount) -
getRenderTargetSampleCount
Description copied from class:Caps
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. If the requested sample count is 1 then 1 will be returned if non-MSAA rendering is supported, otherwise 0.- Specified by:
getRenderTargetSampleCount
in classCaps
- Parameters:
sampleCount
- requested samples
-
getRenderTargetSampleCount
public int getRenderTargetSampleCount(int sampleCount, int format) -
getDefaultColorImageDesc
@Nullable public ImageDesc getDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int mipLevelCount, int sampleCount, int imageFlags) - Overrides:
getDefaultColorImageDesc
in classCaps
- Parameters:
imageType
-colorType
-width
-height
-depthOrArraySize
-mipLevelCount
-sampleCount
-imageFlags
-- Returns:
- See Also:
-
getDefaultDepthStencilImageDesc
@Nullable public ImageDesc getDefaultDepthStencilImageDesc(int depthBits, int stencilBits, int width, int height, int sampleCount, int imageFlags) - Overrides:
getDefaultDepthStencilImageDesc
in classCaps
-
getImageDescForSampledCopy
@Nullable public ImageDesc getImageDescForSampledCopy(ImageDesc src, int width, int height, int depthOrArraySize, int imageFlags) - Overrides:
getImageDescForSampledCopy
in classCaps
-
onFormatCompatible
- Specified by:
onFormatCompatible
in classCaps
-
onGetDefaultBackendFormat
- Specified by:
onGetDefaultBackendFormat
in classCaps
-
getCompressedBackendFormat
- Specified by:
getCompressedBackendFormat
in classCaps
-
makeDesc
@Nonnull public PipelineKey_old makeDesc(PipelineKey_old desc, GpuRenderTarget renderTarget, GraphicsPipelineDesc_Old graphicsPipelineDesc) -
makeGraphicsPipelineKey
@Nonnull public PipelineKey makeGraphicsPipelineKey(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) - Specified by:
makeGraphicsPipelineKey
in classCaps
-
onGetReadSwizzle
- Specified by:
onGetReadSwizzle
in classCaps
-
getWriteSwizzle
- Specified by:
getWriteSwizzle
in classCaps
-
computeImageKey
- Specified by:
computeImageKey
in classCaps
-
getSupportedWriteColorType
Description copied from class:Caps
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().Low 32bits - colorType ((int) value). High 32bits - transferOffsetAlignment (value >>> 32). If the
write
is occurring using transferPixelsTo() then this provides the minimum alignment of the offset into the transfer buffer.- Specified by:
getSupportedWriteColorType
in classCaps
-
getExternalTypeAlignment
public static int getExternalTypeAlignment(int type) -
onSupportedReadColorType
protected long onSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) - Specified by:
onSupportedReadColorType
in classCaps
-
onApplyOptionsOverrides
- Overrides:
onApplyOptionsOverrides
in 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
-