From 87bd6c16817938e7983d2a14d7e836dd181a2745 Mon Sep 17 00:00:00 2001 From: Rezmason Date: Sat, 1 Oct 2022 10:12:56 -0700 Subject: [PATCH] Adding a "testFix" URL variable to help test potential fixes to open bugs in production. --- js/config.js | 1 + js/regl/main.js | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/js/config.js b/js/config.js index 12096cf..9bcbff7 100644 --- a/js/config.js +++ b/js/config.js @@ -403,6 +403,7 @@ const parsePalette = (isHSL) => (s) => { }; const paramMapping = { + testFix: { key: "testFix", parser: (s) => s }, version: { key: "version", parser: (s) => s }, font: { key: "font", parser: (s) => s }, effect: { key: "effect", parser: (s) => s }, diff --git a/js/regl/main.js b/js/regl/main.js index 2802a47..40d7f9b 100644 --- a/js/regl/main.js +++ b/js/regl/main.js @@ -61,12 +61,21 @@ export default async (canvas, config) => { await setupCamera(); } - const regl = createREGL({ - canvas, - extensions: ["OES_texture_half_float", "OES_texture_half_float_linear"], - // These extensions are also needed, but Safari misreports that they are missing - optionalExtensions: ["EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "OES_standard_derivatives"], - }); + const extensions = ["OES_texture_half_float", "OES_texture_half_float_linear"]; + // These extensions are also needed, but Safari misreports that they are missing + const optionalExtensions = ["EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "OES_standard_derivatives"]; + + switch (config.testFix) { + case "fwidth_10_1_2022_A": + extensions.push("OES_standard_derivatives"); + break; + case "fwidth_10_1_2022_B": + optionalExtensions.forEach(ext => extensions.push(ext)); + extensions.length = 0; + break; + } + + const regl = createREGL({ canvas, extensions, optionalExtensions, }); const cameraTex = regl.texture(cameraCanvas); const lkg = await getLKG(config.useHoloplay, true);