MCPcopy Create free account
hub / github.com/greggman/twgl.js / testBindingNullToTexture

Function testBindingNullToTexture

test/tests/program-tests.js:1222–1244  ·  view source on GitHub ↗
(gl)

Source from the content-addressed store, hash-verified

1220 describe('setUniforms', () => {
1221
1222 function testBindingNullToTexture(gl) {
1223 const programInfo = twgl.createProgramInfo(gl, [
1224 `void main() {
1225 gl_Position = vec4(0);
1226 }
1227 `,
1228 `
1229 precision mediump float;
1230 uniform sampler2D tex;
1231 uniform sampler2D texArr[1];
1232 void main() {
1233 texArr[0];
1234 gl_FragColor = texture2D(tex, vec2(0));
1235 }
1236 `,
1237 ]);
1238 gl.useProgram(programInfo.program);
1239 twgl.setUniforms(programInfo, {
1240 tex: null,
1241 texArr: [null],
1242 });
1243 assertNoWebGLError(gl);
1244 }
1245
1246 itWebGL(`WebGL: lets you bind a null texture`, () => {
1247 const {gl} = createContext();

Callers 1

program-tests.jsFile · 0.85

Calls 1

assertNoWebGLErrorFunction · 0.90

Tested by

no test coverage detected