New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gl-wiretap

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-wiretap

listen and replay gl WebGL gpu commands

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
increased by12.43%
Maintainers
1
Weekly downloads
 
Created
Source

gl-wiretap

listen and replay gl (WebGL, WebGL2, and HeadlessGL) gpu commands

Example

const { glWiretap } = require('gl-wiretap');
const realGL = canvas.getContext('webgl');
const gl = glWiretap(realGL);

// do a bunch of webgl commands..

// then later, see all commands ran
const commands = gl.toString();

// possibly write commands to file, for unit testing or reproducing bug
require('fs').writeFileSync('./file.js',
    "const canvas = document.createElement('canvas');"
    + "const gl = canvas.getContext('webgl');"
    + commands
);

API

const gl = glWiretap(realGL, options);

// do a bunch of webgl commands..

// then later, see all commands ran
const commands = gl.toString();

glWiretap.toString()

This is where the gl context outputs all values. The value for context here is gl, for simplicity. Any variables created here (example: gl.createProgram(), or gl.createShader(gl.VERTEX_SHADER)) are simply constants that increment on an index to prevent collision.

glWiretap options

  • readPixelsFile: String - Writes a file by this name when on node HeadlessGL using readPixels
  • throwGetError: Boolean - Causes gl.getError() to throw if there is an error
  • throwGetShaderParameter: Boolean - Causes gl.getShaderParameter() to throw if there is an error
  • throwGetProgramParameter: Boolean - Causes gl.getProgramParameter() to throw if there is an error

Keywords

FAQs

Package last updated on 05 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc