Browse Source

wrap gl_VertexID in int()

-fix GPU surfaces rendering in Safari with WebGL2
Alexander Rose 2 years ago
parent
commit
7885fb7b4f
3 changed files with 4 additions and 6 deletions
  1. 1 1
      CHANGELOG.md
  2. 3 1
      src/mol-gl/shader/chunks/common-vert-params.glsl.ts
  3. 0 4
      src/mol-plugin/features.ts

+ 1 - 1
CHANGELOG.md

@@ -14,7 +14,7 @@ Note that since we don't clearly distinguish between a public and private interf
     - Change the lookup logic of NtC steps from residues
 - Add support for download of gzipped files
 - Fix Glycam Saccharide Names used by default
-- Prefer WebGL1 for more Safari versions to avoid broken GPU surfaces rendering
+- Fix GPU surfaces rendering in Safari with WebGL2
 
 ## [v3.13.0] - 2022-07-24
 

+ 3 - 1
src/mol-gl/shader/chunks/common-vert-params.glsl.ts

@@ -44,7 +44,9 @@ varying vec3 vModelPosition;
 varying vec3 vViewPosition;
 
 #if defined(noNonInstancedActiveAttribs)
-    #define VertexID gl_VertexID
+    // int() is needed for some Safari versions
+    // see https://bugs.webkit.org/show_bug.cgi?id=244152
+    #define VertexID int(gl_VertexID)
 #else
     attribute float aVertex;
     #define VertexID int(aVertex)

+ 0 - 4
src/mol-plugin/features.ts

@@ -15,10 +15,6 @@ export const PluginFeatureDetection = {
             'Version/15.1 Safari',
             'Version/15.2 Safari',
             'Version/15.3 Safari',
-            // the following 'only' break GPU surfaces
-            'Version/15.4 Safari',
-            'Version/15.5 Safari',
-            'Version/16.0 Safari',
         ];
         if (unpportedSafariVersions.some(v => navigator.userAgent.indexOf(v) > 0)) {
             return true;