diff --git a/src/mol-gl/compute/marching-cubes/isosurface.ts b/src/mol-gl/compute/marching-cubes/isosurface.ts index 994c55bfd04992d5627435730e98f67061f785ea..9b49abeff8f0cfa2ee80fde07052d3b91da0c300 100644 --- a/src/mol-gl/compute/marching-cubes/isosurface.ts +++ b/src/mol-gl/compute/marching-cubes/isosurface.ts @@ -195,17 +195,17 @@ export function createIsosurfaceBuffers(ctx: WebGLContext, activeVoxelsBase: Tex export function extractIsosurface(ctx: WebGLContext, volumeData: Texture, gridDim: Vec3, gridTexDim: Vec3, gridTexScale: Vec2, transform: Mat4, isoValue: number, packedGroup: boolean, vertexTexture?: Texture, groupTexture?: Texture, normalTexture?: Texture) { // console.time('calcActiveVoxels'); const activeVoxelsTex = calcActiveVoxels(ctx, volumeData, gridDim, gridTexDim, isoValue, gridTexScale); - // ctx.webgl.waitForGpuCommandsCompleteSync(); + // ctx.waitForGpuCommandsCompleteSync(); // console.timeEnd('calcActiveVoxels'); // console.time('createHistogramPyramid'); const compacted = createHistogramPyramid(ctx, activeVoxelsTex, gridTexScale, gridTexDim); - // ctx.webgl.waitForGpuCommandsCompleteSync(); + // ctx.waitForGpuCommandsCompleteSync(); // console.timeEnd('createHistogramPyramid'); // console.time('createIsosurfaceBuffers'); const gv = createIsosurfaceBuffers(ctx, activeVoxelsTex, volumeData, compacted, gridDim, gridTexDim, transform, isoValue, packedGroup, vertexTexture, groupTexture, normalTexture); - // ctx.webgl.waitForGpuCommandsCompleteSync(); + // ctx.waitForGpuCommandsCompleteSync(); // console.timeEnd('createIsosurfaceBuffers'); return gv; diff --git a/src/mol-gl/shader/chunks/common-vert-params.glsl.ts b/src/mol-gl/shader/chunks/common-vert-params.glsl.ts index 9ee8e3d95f02d19a6a9bd3a040b6a2539c031563..635fbd434d31f557b157b1376218304e7ccdb9af 100644 --- a/src/mol-gl/shader/chunks/common-vert-params.glsl.ts +++ b/src/mol-gl/shader/chunks/common-vert-params.glsl.ts @@ -41,6 +41,12 @@ varying vec3 vViewPosition; attribute float aVertex; #define VertexID int(aVertex) #else - #define VertexID gl_VertexID + // not using gl_VertexID but aVertex to ensure there is an active attribute with divisor 0 + // since FF 85 this is not needed anymore but lets keep it for backwards compatibility + // https://bugzilla.mozilla.org/show_bug.cgi?id=1679693 + // see also note in src/mol-gl/webgl/render-item.ts + attribute float aVertex; + #define VertexID int(aVertex) + // #define VertexID gl_VertexID #endif `; \ No newline at end of file diff --git a/src/mol-gl/webgl/render-item.ts b/src/mol-gl/webgl/render-item.ts index 21b04ed4ed022f371ee2c4bda9092a4f0b407ae6..96498091e2e7cfa31842872b258dd14b0d0083e2 100644 --- a/src/mol-gl/webgl/render-item.ts +++ b/src/mol-gl/webgl/render-item.ts @@ -112,7 +112,12 @@ export function createRenderItem<T extends string>(ctx: WebGLContext, drawMode: const { instancedArrays, vertexArrayObject } = ctx.extensions; // emulate gl_VertexID when needed - if (!ctx.isWebGL2 && values.uVertexCount) { + // if (!ctx.isWebGL2 && values.uVertexCount) { + // not using gl_VertexID in WebGL2 but aVertex to ensure there is an active attribute with divisor 0 + // since FF 85 this is not needed anymore but lets keep it for backwards compatibility + // https://bugzilla.mozilla.org/show_bug.cgi?id=1679693 + // see also note in src/mol-gl/shader/chunks/common-vert-params.glsl.ts + if (values.uVertexCount) { const vertexCount = values.uVertexCount.ref.value; (values as any).aVertex = ValueCell.create(fillSerial(new Float32Array(vertexCount))); (schema as any).aVertex = AttributeSpec('float32', 1, 0);