Skip to content

Commit 3e29548

Browse files
committed
add STENCIL_INDEX8
1 parent b699345 commit 3e29548

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/texture-utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const DEPTH_COMPONENT24 = 0x81A6;
6363
const DEPTH_COMPONENT32F = 0x8CAC;
6464
const DEPTH32F_STENCIL8 = 0x8CAD;
6565
const DEPTH24_STENCIL8 = 0x88F0;
66+
const STENCIL_INDEX8 = 0x8d48;
6667

6768
/* DataType */
6869
// const BYTE = 0x1400;
@@ -196,6 +197,7 @@ function getTextureInternalFormatInfo(internalFormat) {
196197
t[DEPTH_COMPONENT32F] = { bytesPerElement: [4], };
197198
t[DEPTH24_STENCIL8] = { bytesPerElement: [4], };
198199
t[DEPTH32F_STENCIL8] = { bytesPerElement: [4], };
200+
t[STENCIL_INDEX8] = { bytesPerElement: [1], };
199201

200202
s_textureInternalFormatInfo = t;
201203
}

test/tests/renderbuffer-tests.js

+22
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@ describe('renderbuffer tests', () => {
4949
tracker.deleteObjectAndMemory(size2);
5050
});
5151

52+
it('test renderbufferStorage STENCIL_INDEX8', () => {
53+
const {gl} = createContext();
54+
const tracker = new MemInfoTracker(gl, 'renderbuffer');
55+
56+
const rb1 = gl.createRenderbuffer();
57+
tracker.addObjects(1);
58+
59+
gl.bindRenderbuffer(gl.RENDERBUFFER, rb1);
60+
let size1a;
61+
{
62+
const width = 17;
63+
const height = 49;
64+
gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
65+
size1a = width * height;
66+
tracker.addMemory(size1a);
67+
}
68+
69+
gl.deleteRenderbuffer(rb1);
70+
tracker.deleteObjectAndMemory(size1a);
71+
});
72+
73+
5274
it('test renderbufferStorageMultisample', () => {
5375
const {gl} = createContext2();
5476
if (!gl) {

0 commit comments

Comments
 (0)