From 3e55cd0bd6a72e493cf7e77636f376be277e62ab Mon Sep 17 00:00:00 2001 From: Mateo Miccino Date: Wed, 11 Jan 2023 09:33:52 -0300 Subject: [PATCH] feat: add feature flag to enable the web gif processor instead of the unity gif processor (#812) * test: set renderer to use it git decoder * feat: add feature flag to enable the web gif processor instead of the unity gif processor --- packages/shared/meta/selectors.ts | 3 +++ packages/shared/meta/types.ts | 1 + packages/unity-interface/kernelConfigForRenderer.ts | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/shared/meta/selectors.ts b/packages/shared/meta/selectors.ts index 87ed11cc1..dfa3ee1e6 100644 --- a/packages/shared/meta/selectors.ts +++ b/packages/shared/meta/selectors.ts @@ -59,6 +59,9 @@ export const getDisabledCatalystConfig = (store: RootMetaState): string[] => { export const isLiveKitVoiceChatFeatureFlag = (store: RootMetaState): boolean => getFeatureFlagEnabled(store, 'livekit-voicechat') as boolean +// Enable the gif processor on the web instead of processing it in Unity (just for WebGL build) +export const isGifWebSupported = (store: RootMetaState): boolean => getFeatureFlagEnabled(store, 'gif-web') as boolean + export function getMaxVisiblePeers(store: RootMetaState): number { return ( QS_MAX_VISIBLE_PEERS || diff --git a/packages/shared/meta/types.ts b/packages/shared/meta/types.ts index 3cd661667..8828a1162 100644 --- a/packages/shared/meta/types.ts +++ b/packages/shared/meta/types.ts @@ -43,6 +43,7 @@ export type FeatureFlagsName = | 'web_cap_fps' // caps the web client FPS | 'disabled-catalyst' | 'livekit-voicechat' + | 'gif-web' | 'ping_enabled' | 'use-synapse-server' | 'new_tutorial' diff --git a/packages/unity-interface/kernelConfigForRenderer.ts b/packages/unity-interface/kernelConfigForRenderer.ts index 6b3bbf8e5..a3bcb43bf 100644 --- a/packages/unity-interface/kernelConfigForRenderer.ts +++ b/packages/unity-interface/kernelConfigForRenderer.ts @@ -5,6 +5,7 @@ import { getWorld } from '@dcl/schemas' import { injectVersions } from 'shared/rolloutVersions' import { store } from 'shared/store/isolatedStore' import { getSelectedNetwork } from 'shared/dao/selectors' +import { isGifWebSupported } from 'shared/meta/selectors' export function kernelConfigForRenderer(): KernelConfigForRenderer { const versions = injectVersions({}) @@ -30,7 +31,8 @@ export function kernelConfigForRenderer(): KernelConfigForRenderer { gifSupported: typeof (window as any).OffscreenCanvas !== 'undefined' && typeof (window as any).OffscreenCanvasRenderingContext2D === 'function' && - !WSS_ENABLED, + !WSS_ENABLED && + isGifWebSupported(globalState), network, validWorldRanges: getWorld().validWorldRanges, kernelVersion: versions['@dcl/kernel'] || 'unknown-kernel-version',