diff --git a/src/texture-utils.js b/src/texture-utils.js index 9a6691a..c1276d6 100644 --- a/src/texture-utils.js +++ b/src/texture-utils.js @@ -63,6 +63,7 @@ const DEPTH_COMPONENT24 = 0x81A6; const DEPTH_COMPONENT32F = 0x8CAC; const DEPTH32F_STENCIL8 = 0x8CAD; const DEPTH24_STENCIL8 = 0x88F0; +const STENCIL_INDEX8 = 0x8d48; /* DataType */ // const BYTE = 0x1400; @@ -196,6 +197,7 @@ function getTextureInternalFormatInfo(internalFormat) { t[DEPTH_COMPONENT32F] = { bytesPerElement: [4], }; t[DEPTH24_STENCIL8] = { bytesPerElement: [4], }; t[DEPTH32F_STENCIL8] = { bytesPerElement: [4], }; + t[STENCIL_INDEX8] = { bytesPerElement: [1], }; s_textureInternalFormatInfo = t; } diff --git a/test/tests/renderbuffer-tests.js b/test/tests/renderbuffer-tests.js index f2417ae..ef2b31f 100644 --- a/test/tests/renderbuffer-tests.js +++ b/test/tests/renderbuffer-tests.js @@ -49,6 +49,28 @@ describe('renderbuffer tests', () => { tracker.deleteObjectAndMemory(size2); }); + it('test renderbufferStorage STENCIL_INDEX8', () => { + const {gl} = createContext(); + const tracker = new MemInfoTracker(gl, 'renderbuffer'); + + const rb1 = gl.createRenderbuffer(); + tracker.addObjects(1); + + gl.bindRenderbuffer(gl.RENDERBUFFER, rb1); + let size1a; + { + const width = 17; + const height = 49; + gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height); + size1a = width * height; + tracker.addMemory(size1a); + } + + gl.deleteRenderbuffer(rb1); + tracker.deleteObjectAndMemory(size1a); + }); + + it('test renderbufferStorageMultisample', () => { const {gl} = createContext2(); if (!gl) {