Add files
This commit is contained in:
commit
77bde04db3
97 changed files with 10327 additions and 0 deletions
13
src/graphics/graphics-library/compiling/check-program.ts
Normal file
13
src/graphics/graphics-library/compiling/check-program.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { checkShader } from './check-shader';
|
||||
|
||||
export const checkProgram = (gl: WebGL2RenderingContext, program: WebGLProgram) => {
|
||||
const success = gl.getProgramParameter(program, gl.LINK_STATUS);
|
||||
|
||||
if (!success) {
|
||||
gl.getAttachedShaders(program)?.forEach((s) => {
|
||||
checkShader(gl, s);
|
||||
});
|
||||
|
||||
throw new Error(gl.getProgramInfoLog(program)!);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue