Enum Class GpuTimerPolicy

java.lang.Object
java.lang.Enum<GpuTimerPolicy>
com.victorvalentim.zividomelive.performance.GpuTimerPolicy
All Implemented Interfaces:
Serializable, Comparable<GpuTimerPolicy>, Constable

public enum GpuTimerPolicy extends Enum<GpuTimerPolicy>
Policy controlling experimental OpenGL GPU measurement backend selection.

API stability: Experimental.

Since:
2.0.0
  • Enum Constant Details

    • SAFE

      public static final GpuTimerPolicy SAFE
      Uses timestamp pairs only, avoiding ownership of the global elapsed-query target.
    • ARCHITECTURE_AWARE

      public static final GpuTimerPolicy ARCHITECTURE_AWARE
      Enables the complete capability-driven fallback chain for controlled benchmarks.

      Selection is capability-driven: timestamp pairs are preferred, elapsed queries are the timer fallback, and the runtime measurement layer may use fence completion when both timer paths are unavailable or fail qualification. GpuTimerArchitecture remains metadata and is not treated as proof that a backend is reliable.

    • TIME_ELAPSED_EXCLUSIVE

      public static final GpuTimerPolicy TIME_ELAPSED_EXCLUSIVE
      Explicitly requests the exclusive elapsed-query backend for controlled diagnostics.
  • Method Details

    • values

      public static GpuTimerPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GpuTimerPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • selectBackend

      public GpuTimerBackend selectBackend(GpuTimerArchitecture architecture, int timestampCounterBits, int elapsedCounterBits)
      Selects the first timer-query candidate from runtime counter capabilities.

      This method selects a candidate only. Runtime qualification is responsible for deciding whether the candidate is trustworthy on the active driver/context.

      Parameters:
      architecture - normalized host architecture recorded as benchmark metadata
      timestampCounterBits - counter bits reported for GL_TIMESTAMP
      elapsedCounterBits - counter bits reported for GL_TIME_ELAPSED
      Returns:
      selected timer candidate, or GpuTimerBackend.NONE
    • allowsElapsedFallback

      public boolean allowsElapsedFallback()
      Returns:
      whether a failed timestamp candidate may fall back to an elapsed query
    • allowsFenceFallback

      public boolean allowsFenceFallback()
      Returns:
      whether failed/unavailable timer queries may fall back to fence completion