Package icyllis.arc3d.engine

# Class ContextOptions

java.lang.Object
icyllis.arc3d.engine.BaseContextOptions
icyllis.arc3d.engine.ContextOptions

public final class ContextOptions extends BaseContextOptions
Holds the options for creating a `ImmediateContext`, all fields should remain unchanged after creating the context.

Boolean value represents a tristate:

- `Boolean.FALSE`: Forces an option to be disabled.
- `Boolean.TRUE`: Forces an option to be enabled.
- `null`: Uses default behavior, which may use runtime properties (e.g. driver version).

This class is part of public API.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Boolean`
  `mAllowMultipleGlyphCacheTextures`
  Can the glyph atlas use multiple textures.
  `DriverBugWorkarounds`
  `mDriverBugWorkarounds`
  `long`
  `mGlyphCacheTextureMaximumBytes`
  The maximum size of cache textures used for Glyph cache.
  `float`
  `mGlyphsAsPathsFontSize`
  Above this threshold size in device space glyphs are drawn as individual paths.
  `int`
  `mInternalMultisampleCount`
  Specifies the number of samples Engine should use when performing internal draws with MSAA (hardware capabilities permitting).
  `org.slf4j.Logger`
  `mLogger`
  If present, use this logger to send info/warning/error message that generated by Arc3D engine.
  `int`
  `mMaxRuntimeProgramCacheSize`
  Maximum number of GL programs or Vk pipelines to keep active in the runtime cache.
  `int`
  `mMaxTextureSizeOverride`
  Overrides: These options override feature detection using backend API queries.
  `int`
  `mMaxVkSecondaryCommandBufferCacheSize`
  In vulkan backend a single Context submit equates to the submission of a single primary command buffer to the VkQueue.
  `float`
  `mMinDistanceFieldFontSize`
  Below this threshold size in device space distance field fonts won't be used.
  `boolean`
  `mReducedShaderVariations`
  Uses a reduced variety of shaders.
  `boolean`
  `mSharpenMipmappedTextures`
  If true, texture fetches from mip-mapped textures will be biased to read larger MIP levels.
  `Boolean`
  `mSkipGLErrorChecks`
  Controls whether we check for GL errors after functions that allocate resources (e.g.
  `boolean`
  `mSupportBilerpFromGlyphAtlas`
  If true, then add 1 pixel padding to all glyph masks in the atlas to support bi-lerp rendering of all glyphs.
  `boolean`
  `mVolatileContext`
  OpenGL backend only.
  `long`
  `mVulkanVMALargeHeapBlockSize`

  ### Fields inherited from class icyllis.arc3d.engine.BaseContextOptions

  `mMaxResourceBudget`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContextOptions()`

- ## Method Summary

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mSkipGLErrorChecks

    public Boolean mSkipGLErrorChecks
    Controls whether we check for GL errors after functions that allocate resources (e.g. glTexImage2D), for shader compilation success, and program link success. Ignored on backends other than GL.

  - ### mMaxTextureSizeOverride

    public int mMaxTextureSizeOverride
    Overrides: These options override feature detection using backend API queries. These overrides can only reduce the feature set or limits, never increase them beyond the detected values.

  - ### mSharpenMipmappedTextures

    public boolean mSharpenMipmappedTextures
    If true, texture fetches from mip-mapped textures will be biased to read larger MIP levels. This has the effect of sharpening those textures, at the cost of some aliasing, and possible performance impact.

  - ### mSupportBilerpFromGlyphAtlas

    public boolean mSupportBilerpFromGlyphAtlas
    If true, then add 1 pixel padding to all glyph masks in the atlas to support bi-lerp rendering of all glyphs. This must be set to true to use Slug.

  - ### mReducedShaderVariations

    public boolean mReducedShaderVariations
    Uses a reduced variety of shaders. May perform less optimally in steady state but can reduce jank due to shader compilations.

  - ### mGlyphCacheTextureMaximumBytes

    public long mGlyphCacheTextureMaximumBytes
    The maximum size of cache textures used for Glyph cache.

  - ### mAllowMultipleGlyphCacheTextures

    public Boolean mAllowMultipleGlyphCacheTextures
    Can the glyph atlas use multiple textures. If allowed, each texture's size is bound by `mGlyphCacheTextureMaximumBytes`.

  - ### mMinDistanceFieldFontSize

    public float mMinDistanceFieldFontSize
    Below this threshold size in device space distance field fonts won't be used. Distance field fonts don't support hinting which is more important at smaller sizes.

  - ### mGlyphsAsPathsFontSize

    public float mGlyphsAsPathsFontSize
    Above this threshold size in device space glyphs are drawn as individual paths.

  - ### mLogger

    public org.slf4j.Logger mLogger
    If present, use this logger to send info/warning/error message that generated by Arc3D engine.

  - ### mInternalMultisampleCount

    public int mInternalMultisampleCount
    Specifies the number of samples Engine should use when performing internal draws with MSAA (hardware capabilities permitting).

    If 0, Engine will disable internal code paths that use multisampling.

  - ### mMaxRuntimeProgramCacheSize

    public int mMaxRuntimeProgramCacheSize
    Maximum number of GL programs or Vk pipelines to keep active in the runtime cache.

  - ### mMaxVkSecondaryCommandBufferCacheSize

    public int mMaxVkSecondaryCommandBufferCacheSize
    In vulkan backend a single Context submit equates to the submission of a single primary command buffer to the VkQueue. This value specifies how many vulkan secondary command buffers we will cache for reuse on a given primary command buffer. A single submit may use more than this many secondary command buffers, but after the primary command buffer is finished on the GPU it will only hold on to this many secondary command buffers for reuse.

    A value of -1 means we will pick a limit value internally.

  - ### mVolatileContext

    public boolean mVolatileContext
    OpenGL backend only. If context is volatile, then Arc3D is considered embedded in another program and shared with its OpenGL context. When making GL function calls that may alter the context's state (especially binding states) outside the command buffer execution, Arc3D will query the binding state and restore the state of the context after that. This is only used for non-DSA methods and may reduce performance. But this can prevent other programs from out-of-order due to assumptions about context's state, especially for mixed API usage between Arc3D and other programs.

  - ### mVulkanVMALargeHeapBlockSize

    public long mVulkanVMALargeHeapBlockSize

  - ### mDriverBugWorkarounds

    public DriverBugWorkarounds mDriverBugWorkarounds

- ## Constructor Details

  - ### ContextOptions

    public ContextOptions()