greggman / webgl-memory Goto Github PK
View Code? Open in Web Editor NEWA library to track webgl-memory
Home Page: https://greggman.github.io/webgl-memory/
License: MIT License
A library to track webgl-memory
Home Page: https://greggman.github.io/webgl-memory/
License: MIT License
Line 113 in 743348d
I'm using the framework vite
for the first time in the version 2.7.2
and am trying to use [email protected]
in my project.
Line 6 in 7edb852
This does not work properly on my vite setup.
The package served from npm does not contain /src/webgl-memory.js
, it's just /webgl-memory.js
.
Here's the error: [vite:resolve] Failed to resolve entry for package "webgl-memory". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "webgl-memory". The package may have incorrect main/module/exports specified in its package.json.
I'm not sure what is the intention that you set here /src/webgl-memory.js
but it will work by changing here to /webgl-memory.js
by my hand.
Since it's my first time using vite, I have no idea why vite complains about it honestly, I'm sorry.
Here's how the current package look like: https://www.unpkg.com/browse/[email protected]/
This package really saved my life so far.
Garbage collector cannot delete textures from gpu memory when using this extension!
Is this a bug or is it normal?
If this is normal, can't the problem be fixed using WeakRef?
Error message:
An error occurred while rendering. Rendering has stopped.
Error: unsupported bufferData src type [object ArrayBuffer]
Error: unsupported bufferData src type [object ArrayBuffer]
it seems that the bufferData
method should accept data of type ArrayBuffer
, syntax copy from https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData:
// WebGL1:
void gl.bufferData(target, size, usage);
void gl.bufferData(target, ArrayBuffer? srcData, usage);
void gl.bufferData(target, ArrayBufferView srcData, usage);
// WebGL2:
void gl.bufferData(target, ArrayBufferView srcData, usage, srcOffset, length);
With minor modifications, it works fine:
// WebGL1
// void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
// void bufferData(GLenum target, [AllowShared] BufferSource? srcData, GLenum usage);
// WebGL2:
// void bufferData(GLenum target, [AllowShared] ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
// optional GLuint length = 0);
bufferData(gl, funcName, args) {
const [target, src, /* usage */, srcOffset = 0, length = undefined] = args;
const obj = bindings.get(target);
if (!obj) {
throw new Error(`no buffer bound to ${target}`);
}
let newSize = 0;
if (length !== undefined) {
newSize = length;
} else if (isTypedArray(src)) {
newSize = src.byteLength;
} else if (isNumber(src)) {
newSize = src;
+ } else if (src instanceof ArrayBuffer) {
+ newSize = src.byteLength;
} else {
throw new Error(`unsupported bufferData src type ${src}`);
}
I use ThreeJS and TensorFlowJS.
https://github.com/tensorflow/tfjs-models/tree/master/pose-detection
After initalizing Posnet webgl-memory crashes
webgl-memory.js:772 Uncaught (in promise) ReferenceError: obj is not defined
at webgl-memory.js:772
at WebGL2RenderingContext.ctx. [as fenceSync] (webgl-memory.js:921)
at t.e.createFence (tfjs.js:17)
at t.e.createAndWaitForFence (tfjs.js:17)
at e. (tfjs.js:17)
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:293)
at Generator.next (runtime.js:118)
at Wm (tfjs.js:17)
at o (tfjs.js:17)
at tfjs.js:17
at new Promise ()
at e. (tfjs.js:17)
at e.read (tfjs.js:17)
at t.e.read (tfjs.js:17)
at t. (tfjs.js:17)
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:293)
at Generator.next (runtime.js:118)
at Wm (tfjs.js:17)
at o (tfjs.js:17)
at tfjs.js:17
at new Promise ()
at t. (tfjs.js:17)
at t.data (tfjs.js:17)
at t. (tfjs.js:17)
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:293)
at Generator.next (runtime.js:118)
at Wm (tfjs.js:17)
at o (tfjs.js:17)
at tfjs.js:17
at new Promise ()
at t. (tfjs.js:17)
at t.buffer (tfjs.js:17)
at posenet.js:17
at Array.map ()
at posenet.js:17
at posenet.js:17
at Object.next (posenet.js:17)
at posenet.js:17
at new Promise ()
at u (posenet.js:17)
at posenet.js:17
at t. (posenet.js:17)
at posenet.js:17
at Object.next (posenet.js:17)
at posenet.js:17
at new Promise ()
at u (posenet.js:17)
Have you any hint for me. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.