-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track object creation (and texture update) stack trace and expose tra…
…cked textures in the extension info call.
- Loading branch information
1 parent
a4e0db7
commit c769105
Showing
5 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {describe, it} from '../mocha-support.js'; | ||
import {assertEqual, assertTruthy} from '../assert.js'; | ||
import {createContext} from '../webgl.js'; | ||
|
||
describe('stack tests', () => { | ||
|
||
it('test stack capture', () => { | ||
const {gl, ext} = createContext(); | ||
|
||
const tex1 = gl.createTexture(); | ||
|
||
gl.bindTexture(gl.TEXTURE_2D, tex1); | ||
gl.texImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 16, 8, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); | ||
|
||
const info = ext.getMemoryInfo(); | ||
const {textures} = info; | ||
|
||
assertEqual(textures.length, 1); | ||
assertTruthy(textures[0].stackCreated); | ||
assertTruthy(textures[0].stackUpdated); | ||
|
||
gl.deleteTexture(tex1); | ||
}); | ||
}); |