All files / core/src/RenderingEngine/vtkClasses canUseFloatOpacityTexture.js

100% Statements 3/3
75% Branches 3/4
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                    184x   184x       184x    
/**
 * Returns whether the current WebGL context can linearly sample a float
 * opacity texture.
 *
 * WebGL2 includes float textures, but linear filtering of those textures is
 * still gated by OES_texture_float_linear. In WebGL1, both extensions are
 * required.
 */
export default function canUseFloatOpacityTexture(openGLRenderWindow, context) {
  const supportsFloatTextures =
    openGLRenderWindow.getWebgl2() ||
    Boolean(context.getExtension('OES_texture_float'));
  const supportsFloatLinearFiltering = Boolean(
    context.getExtension('OES_texture_float_linear')
  );
 
  return supportsFloatTextures && supportsFloatLinearFiltering;
}