Repository: google/filament
File: filament/backend/include/backend/Platform.h (C/C++)

Code before:
         * The highest priority, intended for system-critical, real-time applications where missing
         * deadlines is unacceptable (e.g., VR/AR compositors or other system-critical tasks).
         */
        REALTIME,
    };

    /**
     * Defines how asynchronous operations are handled by the engine.
     */
    enum class AsynchronousMode : uint8_t {
        /**
         * Asynchronous operations are disabled. This is the default.
         */
        NONE,

        /**
         * Attempts to use a dedicated worker thread for asynchronous tasks. If threading is not
         * supported by the platform, it automatically falls back to using an amortization strategy.
         */
        THREAD_PREFERRED,

        /**
         * Mandates the use of a dedicated worker thread for asynchronous tasks. If the platform
         * does not support threads, engine initialization will fail.
         */
        THREAD,

        /**
         * Uses an amortization strategy, processing a small number of asynchronous tasks during
         * each engine update cycle.
         */
        AMORTIZATION,
    };

    struct DriverConfig {
        /**
         * Size of handle arena in bytes. Setting to 0 indicates default value is to be used.
         * Driver clamps to valid values.
         */
        size_t handleArenaSize = 0;

        size_t metalUploadBufferSizeBytes = 512 * 1024;

        /**
         * Set to `true` to forcibly disable parallel shader compilation in the backend.
         * Currently only honored by the GL and Metal backends.
         */
        bool disableParallelShaderCompile = false;

        /**
         * Set to `true` to forcibly disable amortized shader compilation in the backend.

Review comment (bug):
do we need this? I don't think it adds value. when a user uses THREAD the engine creation can fail, and they might not know why. I would get rid of it until someone asks for it.

Code after:
         * The highest priority, intended for system-critical, real-time applications where missing
         * deadlines is unacceptable (e.g., VR/AR compositors or other system-critical tasks).
         */
        REALTIME,
    };

    /**
     * Defines how asynchronous operations are handled by the engine.
     */
    enum class AsynchronousMode : uint8_t {
        /**
         * Asynchronous operations are disabled. This is the default.
         */
        NONE,

        /**
         * Attempts to use a dedicated worker thread for asynchronous tasks. If threading is not
         * supported by the platform, it automatically falls back to using an amortization strategy.
         */
        THREAD_PREFERRED,

        /**
         * Uses an amortization strategy, processing a small number of asynchronous tasks during
         * each engine update cycle.
         */
        AMORTIZATION,
    };

    struct DriverConfig {
        /**
         * Size of handle arena in bytes. Setting to 0 indicates default value is to be used.
         * Driver clamps to valid values.
         */
        size_t handleArenaSize = 0;

        size_t metalUploadBufferSizeBytes = 512 * 1024;

        /**
         * Set to `true` to forcibly disable parallel shader compilation in the backend.
         * Currently only honored by the GL and Metal backends.
         */
        bool disableParallelShaderCompile = false;

        /**
         * Set to `true` to forcibly disable amortized shader compilation in the backend.
         * Currently only honored by the GL backend.
         */
        bool disableAmortizedShaderCompile = true;

        /**
         * Disable backend handles use-after-free checks.