Class Caps
- Direct Known Subclasses:
GLCaps,VulkanCaps
Capabilities are used to test if something is capable or not. In other words, these are optional and there are alternatives, required features are not listed here. For historical reasons, there are still some capability methods, but only return constants (become required).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndicates the capabilities of the fixed function blend unit. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intMost implementations support 4 or 8 simultaneous color targets.static final intMax allowed number of vertex attribute locations.static final intprotected Caps.BlendEquationSupportprotected booleanprotected booleanprotected booleanprotected final DriverBugWorkaroundsprotected booleanprotected booleanprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected booleanprotected final ShaderCapsprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleanfinal booleanfinal booleanfinal booleanfinal booleanThe CLAMP_TO_BORDER wrap mode for texture coordinates was added to desktop GL in 1.3, and GLES 3.2, but is also available in extensions.abstract IResourceKeycomputeImageKey(ImageDesc desc, IResourceKey recycle) final booleanfinal booleanfinal booleanWhether clip space's depth is ranged from negative one to one (true) or zero to one (false).final booleanShould we discard stencil values after a render pass? (Tilers get better performance if we always load stencil buffers with a "clear" op, and then discard the content when finished.)final booleanfinal booleanfinal booleanSupports using Fence.protected final voidfinishInitialization(ContextOptions options) abstract @Nullable BackendFormatgetCompressedBackendFormat(int compressionType) final @Nullable BackendFormatgetDefaultBackendFormat(int colorType, boolean renderable) These are used when creating a new texture internally.@Nullable ImageDescgetDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int imageFlags) @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) @Nullable ImageDescgetImageDescForSampledCopy(ImageDesc src, int width, int height, int depthOrArraySize, int imageFlags) final intReturns the number of samples to use when performing draws to the given config with internal MSAA.abstract intReturns the maximum supported sample count for a format.final shortgetReadSwizzle(ImageDesc desc, int colorType) abstract 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.final longgetSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) Given a src surface's color type and its backend format as well as a color type the caller would like read into, this provides a legal color type that the caller may pass to readPixels().abstract 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().abstract shortgetWriteSwizzle(ImageDesc desc, int colorType) final booleanfinal booleanfinal booleanAnisotropic filtering (AF).final booleanisFormatCompatible(int colorType, BackendFormat format) abstract booleanisFormatRenderable(int colorType, BackendFormat format, int sampleCount) abstract booleanisFormatRenderable(BackendFormat format, int sampleCount) abstract booleanisFormatTexturable(BackendFormat format) Can a texture be made with the BackendFormat, and then be bound and sampled in a shader.abstract @NonNull PipelineKeymakeGraphicsPipelineKey(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) final intMax number of color attachments in a render pass.final intThis is the largest render target size that can be used without incurring extra performance cost.final intfinal intfinal intMaximum 2D/1D texture image dimension.final intMaximum number of attribute values (i.e.final intMaximum number of vertex binding points (i.e.final intfinal intfinal booleanTo avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g.final booleanThis flag indicates that we never have to resolve MSAA.final booleanTrue in environments that will issue errors if memory uploaded to buffers is not initialized (even if not read by draw calls).final booleanWhen discarding the DirectContext do we need to sync the GPU before we start discarding resources.final booleanfinal booleanNon-power-of-two texture tile.protected voidonApplyOptionsOverrides(ContextOptions options) protected abstract booleanonFormatCompatible(int colorType, BackendFormat format) protected abstract @Nullable BackendFormatonGetDefaultBackendFormat(int colorType) protected abstract shortonGetReadSwizzle(ImageDesc desc, int colorType) protected abstract longonSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) final booleanAllows mixed size FBO attachments.final booleanfinal booleanfinal booleanfinal booleanfinal booleanIf true then when doing MSAA draws, we will prefer to discard the msaa attachment on load and stores.final booleanOn tilers, an initial fullscreen clear is an OPTIMIZATION.final booleanfinal booleanDoes readPixels() support a dst buffer where the row bytes is not equal to bpp * w?final booleanfinal booleanfinal booleanfinal booleanScratch textures not being reused means that those scratch textures that we upload to (i.e., don't have a render target) will not be recycled in the texture cache.final booleanfinal booleanSupports using Semaphore.final ShaderCapsfinal booleanOn some GPUs it is a performance win to disable blending instead of doing src-over with a src alpha equal to 1.final booleanFor some environments, there is a performance or safety concern to not initializing textures.final booleanfinal booleanfinal intfinal booleanfinal booleanfinal booleanDoes transferPixelsTo() support a src buffer where the row bytes is not equal to bpp * w?final booleanD3D does not allow the refs or masks to differ on a two-sided stencil draw.final booleanPrimitive restart functionality is core in ES 3.0, but using it will cause slowdowns on some systems.final booleanvalidateAttachmentParams(int width, int height, BackendFormat format, int sampleCount) If an attachment can be created with these params.final booleanvalidateSurfaceParams(int width, int height, BackendFormat format, int sampleCount, int surfaceFlags) If a texture or render target can be created with these params.final booleanfinal DriverBugWorkaroundsfinal booleanDoes writePixels() support a src buffer where the row bytes is not equal to bpp * w?
-
Field Details
-
MAX_COLOR_TARGETS
public static final int MAX_COLOR_TARGETSMost implementations support 4 or 8 simultaneous color targets.- See Also:
-
MAX_VERTEX_ATTRIBUTES
public static final int MAX_VERTEX_ATTRIBUTESMax allowed number of vertex attribute locations. Most implementations support 16 or 32 attributes, and our engine uses 'int' as enable mask type, then this is 32, seeVertexInputLayout.- See Also:
-
MAX_VERTEX_BINDINGS
public static final int MAX_VERTEX_BINDINGS- See Also:
-
mShaderCaps
-
mAnisotropySupport
protected boolean mAnisotropySupport -
mGpuTracingSupport
protected boolean mGpuTracingSupport -
mConservativeRasterSupport
protected boolean mConservativeRasterSupport -
mTransferPixelsToRowBytesSupport
protected boolean mTransferPixelsToRowBytesSupport -
mMustSyncGpuDuringDiscard
protected boolean mMustSyncGpuDuringDiscard -
mTextureBarrierSupport
protected boolean mTextureBarrierSupport -
mDepthClipNegativeOneToOne
protected boolean mDepthClipNegativeOneToOne -
mClampToBorderSupport
protected boolean mClampToBorderSupport -
mDynamicStateArrayGeometryProcessorTextureSupport
protected boolean mDynamicStateArrayGeometryProcessorTextureSupport -
mBlendEquationSupport
-
mMapBufferFlags
protected int mMapBufferFlags -
mMaxRenderTargetSize
protected int mMaxRenderTargetSize -
mMaxPreferredRenderTargetSize
protected int mMaxPreferredRenderTargetSize -
mMaxVertexAttributes
protected int mMaxVertexAttributes -
mMaxVertexBindings
protected int mMaxVertexBindings -
mMaxTextureSize
protected int mMaxTextureSize -
mInternalMultisampleCount
protected int mInternalMultisampleCount -
mMaxPushConstantsSize
protected int mMaxPushConstantsSize -
mMaxColorAttachments
protected int mMaxColorAttachments -
mMinUniformBufferOffsetAlignment
protected int mMinUniformBufferOffsetAlignment -
mMinStorageBufferOffsetAlignment
protected int mMinStorageBufferOffsetAlignment -
mDriverBugWorkarounds
-
-
Constructor Details
-
Caps
-
-
Method Details
-
shaderCaps
- Returns:
- the set of capabilities for shaders
-
npotTextureTileSupport
public final boolean npotTextureTileSupport()Non-power-of-two texture tile. -
mipmapSupport
public final boolean mipmapSupport()To avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g. only for POT textures) -
hasAnisotropySupport
public final boolean hasAnisotropySupport()Anisotropic filtering (AF). -
gpuTracingSupport
public final boolean gpuTracingSupport() -
oversizedStencilSupport
public final boolean oversizedStencilSupport()Allows mixed size FBO attachments. -
textureBarrierSupport
public final boolean textureBarrierSupport() -
sampleLocationsSupport
public final boolean sampleLocationsSupport() -
drawInstancedSupport
public final boolean drawInstancedSupport() -
conservativeRasterSupport
public final boolean conservativeRasterSupport() -
wireframeSupport
public final boolean wireframeSupport() -
msaaResolvesAutomatically
public final boolean msaaResolvesAutomatically()This flag indicates that we never have to resolve MSAA. In practice, it means that we have an MSAA-render-to-texture extension: Any render target we create internally will use the extension, and any wrapped render target is the client's responsibility. -
preferDiscardableMSAAAttachment
public final boolean preferDiscardableMSAAAttachment()If true then when doing MSAA draws, we will prefer to discard the msaa attachment on load and stores. The use of this feature for specific draws depends on the render target having a resolve attachment, and if we need to load previous data the resolve attachment must be usable as an input attachment/texture. Otherwise, we will just write out and store the msaa attachment like normal.This flag is similar to enabling gl render to texture for msaa rendering.
-
halfFloatVertexAttributeSupport
public final boolean halfFloatVertexAttributeSupport() -
usePrimitiveRestart
public final boolean usePrimitiveRestart()Primitive restart functionality is core in ES 3.0, but using it will cause slowdowns on some systems. This cap is only set if primitive restart will improve performance. -
preferClientSideDynamicBuffers
public final boolean preferClientSideDynamicBuffers() -
preferFullscreenClears
public final boolean preferFullscreenClears()On tilers, an initial fullscreen clear is an OPTIMIZATION. It allows the hardware to initialize each tile with a constant value rather than loading each pixel from memory. -
discardStencilValuesAfterRenderPass
public final boolean discardStencilValuesAfterRenderPass()Should we discard stencil values after a render pass? (Tilers get better performance if we always load stencil buffers with a "clear" op, and then discard the content when finished.) -
twoSidedStencilRefsAndMasksMustMatch
public final boolean twoSidedStencilRefsAndMasksMustMatch()D3D does not allow the refs or masks to differ on a two-sided stencil draw. -
preferVRAMUseOverFlushes
public final boolean preferVRAMUseOverFlushes() -
avoidStencilBuffers
public final boolean avoidStencilBuffers() -
avoidWritePixelsFastPath
public final boolean avoidWritePixelsFastPath() -
requiresManualFBBarrierAfterTessellatedStencilDraw
public final boolean requiresManualFBBarrierAfterTessellatedStencilDraw() -
nativeDrawIndexedIndirectIsBroken
public final boolean nativeDrawIndexedIndirectIsBroken() -
blendEquationSupport
-
advancedBlendEquationSupport
public final boolean advancedBlendEquationSupport() -
advancedCoherentBlendEquationSupport
public final boolean advancedCoherentBlendEquationSupport() -
shouldCollapseSrcOverToSrcWhenAble
public final boolean shouldCollapseSrcOverToSrcWhenAble()On some GPUs it is a performance win to disable blending instead of doing src-over with a src alpha equal to 1. To disable blending we collapse src-over to src and the backends will handle the disabling of blending. -
mustSyncGpuDuringDiscard
public final boolean mustSyncGpuDuringDiscard()When discarding the DirectContext do we need to sync the GPU before we start discarding resources. -
supportsTextureBarrier
public final boolean supportsTextureBarrier() -
reducedShaderMode
public final boolean reducedShaderMode() -
reuseScratchTextures
public final boolean reuseScratchTextures()Scratch textures not being reused means that those scratch textures that we upload to (i.e., don't have a render target) will not be recycled in the texture cache. This is to prevent ghosting by drivers (in particular for deferred architectures). -
reuseScratchBuffers
public final boolean reuseScratchBuffers() -
minUniformBufferOffsetAlignment
public final int minUniformBufferOffsetAlignment()- Returns:
- minimum required alignment, in bytes, for the offset
member of the
BufferViewInfostructure for uniform buffers
-
minStorageBufferOffsetAlignment
public final int minStorageBufferOffsetAlignment()- Returns:
- minimum required alignment, in bytes, for the offset
member of the
BufferViewInfostructure for shader storage buffers
-
maxVertexAttributes
public final int maxVertexAttributes()Maximum number of attribute values (i.e. locations) per vertex input. Matrix types and double types can take up multiple consecutive locations. -
maxVertexBindings
public final int maxVertexBindings()Maximum number of vertex binding points (i.e. vertex buffers) per vertex input. The binding passed tobindVertexBuffermust be in[0,maxVertexBindings). -
maxRenderTargetSize
public final int maxRenderTargetSize() -
maxPreferredRenderTargetSize
public final int maxPreferredRenderTargetSize()This is the largest render target size that can be used without incurring extra performance cost. It is usually the max RT size, unless larger render targets are known to be slower. -
maxTextureSize
public final int maxTextureSize()Maximum 2D/1D texture image dimension. -
maxPushConstantsSize
public final int maxPushConstantsSize() -
maxColorAttachments
public final int maxColorAttachments()Max number of color attachments in a render pass. This is ranged from 4 (typically on mobile) to 8 (typically on desktop). -
transferBufferAlignment
public final int transferBufferAlignment() -
isFormatTexturable
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.
-
getMaxRenderTargetSampleCount
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. -
getInternalMultisampleCount
Returns the number of samples to use when performing draws to the given config with internal MSAA. If 0, we should not attempt to use internal multisampling. -
isFormatRenderable
-
isFormatRenderable
-
getRenderTargetSampleCount
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.- Parameters:
sampleCount- requested samples
-
getSupportedWriteColorType
public abstract 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().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. -
getSupportedReadColorType
public final long getSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) Given a src surface's color type and its backend format as well as a color type the caller would like read into, this provides a legal color type that the caller may pass to readPixels(). The returned color type may differ from the passed dstColorType, in which case the caller must convert the read pixel data (see ConvertPixels). When converting to dstColorType the swizzle in the returned struct should be applied. The caller must check the returned color type for UNKNOWN.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. -
onSupportedReadColorType
protected abstract long onSupportedReadColorType(int srcColorType, BackendFormat srcFormat, int dstColorType) -
writePixelsRowBytesSupport
public final boolean writePixelsRowBytesSupport()Does writePixels() support a src buffer where the row bytes is not equal to bpp * w? -
transferPixelsToRowBytesSupport
public final boolean transferPixelsToRowBytesSupport()Does transferPixelsTo() support a src buffer where the row bytes is not equal to bpp * w? -
readPixelsRowBytesSupport
public final boolean readPixelsRowBytesSupport()Does readPixels() support a dst buffer where the row bytes is not equal to bpp * w? -
transferFromSurfaceToBufferSupport
public final boolean transferFromSurfaceToBufferSupport() -
transferFromBufferToTextureSupport
public final boolean transferFromBufferToTextureSupport() -
mustClearUploadedBufferData
public final boolean mustClearUploadedBufferData()True in environments that will issue errors if memory uploaded to buffers is not initialized (even if not read by draw calls). -
shouldInitializeTextures
public final boolean shouldInitializeTextures()For some environments, there is a performance or safety concern to not initializing textures. For example, with WebGL and Firefox, there is a large performance hit to not doing it. -
fenceSyncSupport
public final boolean fenceSyncSupport()Supports using Fence. -
semaphoreSupport
public final boolean semaphoreSupport()Supports using Semaphore. -
crossContextTextureSupport
public final boolean crossContextTextureSupport() -
dynamicStateArrayGeometryProcessorTextureSupport
public final boolean dynamicStateArrayGeometryProcessorTextureSupport() -
performPartialClearsAsDraws
public final boolean performPartialClearsAsDraws() -
performColorClearsAsDraws
public final boolean performColorClearsAsDraws() -
avoidLargeIndexBufferDraws
public final boolean avoidLargeIndexBufferDraws() -
performStencilClearsAsDraws
public final boolean performStencilClearsAsDraws() -
clampToBorderSupport
public final boolean clampToBorderSupport()The CLAMP_TO_BORDER wrap mode for texture coordinates was added to desktop GL in 1.3, and GLES 3.2, but is also available in extensions. Vulkan and Metal always have support. -
depthClipNegativeOneToOne
public final boolean depthClipNegativeOneToOne()Whether clip space's depth is ranged from negative one to one (true) or zero to one (false). -
validateSurfaceParams
public final boolean validateSurfaceParams(int width, int height, BackendFormat format, int sampleCount, int surfaceFlags) If a texture or render target can be created with these params. -
validateAttachmentParams
public final boolean validateAttachmentParams(int width, int height, BackendFormat format, int sampleCount) If an attachment can be created with these params. -
isFormatCompatible
-
onFormatCompatible
-
getDefaultColorImageDesc
public @Nullable ImageDesc getDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int imageFlags) - Parameters:
imageType-colorType-width-height-depthOrArraySize-imageFlags-- Returns:
- See Also:
-
getDefaultColorImageDesc
public @Nullable ImageDesc getDefaultColorImageDesc(int imageType, int colorType, int width, int height, int depthOrArraySize, int mipLevelCount, int sampleCount, int imageFlags) - 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) -
getImageDescForSampledCopy
-
getDefaultBackendFormat
These are used when creating a new texture internally. -
onGetDefaultBackendFormat
-
getCompressedBackendFormat
-
makeGraphicsPipelineKey
public abstract @NonNull PipelineKey makeGraphicsPipelineKey(PipelineKey old, PipelineDesc pipelineDesc, RenderPassDesc renderPassDesc) -
getReadSwizzle
-
onGetReadSwizzle
-
getWriteSwizzle
-
computeImageKey
-
workarounds
-
finishInitialization
-
onApplyOptionsOverrides
-