mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
remove webgl-debug (#4083)
This commit is contained in:
committed by
Weiliang Wang
parent
e5e53071c3
commit
d7aaaa7397
Vendored
-14
@@ -57,20 +57,6 @@ declare interface IWritableArrayLike<T> {
|
||||
[index: number]: T;
|
||||
}
|
||||
|
||||
declare module "webgl-debug" {
|
||||
export function makeDebugContext(
|
||||
webGLRenderingContext: WebGLRenderingContext,
|
||||
throwOnGLError: (err: GLenum, funcName: string, ...args: any[]) => void
|
||||
): WebGLRenderingContext;
|
||||
|
||||
export function makeDebugContext(
|
||||
webGL2RenderingContext: WebGL2RenderingContext,
|
||||
throwOnGLError: (err: GLenum, funcName: string, ...args: any[]) => void
|
||||
): WebGL2RenderingContext;
|
||||
|
||||
export function glEnumToString(glEnum: GLenum): string;
|
||||
}
|
||||
|
||||
declare namespace Editor {
|
||||
function log (message?: any, ...optionalParams: any[]): void;
|
||||
function error (message?: any, ...optionalParams: any[]): void;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as WebGLDeveloperTools from 'webgl-debug';
|
||||
import { GFXBindingLayout, IGFXBindingLayoutInfo } from '../binding-layout';
|
||||
import { GFXBuffer, IGFXBufferInfo } from '../buffer';
|
||||
import { GFXCommandAllocator, IGFXCommandAllocatorInfo } from '../command-allocator';
|
||||
@@ -193,11 +192,6 @@ export class WebGLGFXDevice extends GFXDevice {
|
||||
};
|
||||
|
||||
this._webGLRC = this._canvas.getContext('webgl', webGLCtxAttribs);
|
||||
/*
|
||||
if (this._webGLRC && info.debug) {
|
||||
this._webGLRC = WebGLDeveloperTools.makeDebugContext(this._webGLRC, this._onWebGLError.bind(this));
|
||||
}
|
||||
*/
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return false;
|
||||
@@ -558,8 +552,4 @@ export class WebGLGFXDevice extends GFXDevice {
|
||||
gl.colorMask(true, true, true, true);
|
||||
gl.blendColor(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
private _onWebGLError (error: GLenum, functionName: string, ...args: any[]) {
|
||||
throw new Error(`${WebGLDeveloperTools.glEnumToString(error)} was caused by call to ${functionName}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as WebGLDeveloperTools from 'webgl-debug';
|
||||
import { GFXBindingLayout, IGFXBindingLayoutInfo } from '../binding-layout';
|
||||
import { GFXBuffer, IGFXBufferInfo } from '../buffer';
|
||||
import { GFXCommandAllocator, IGFXCommandAllocatorInfo } from '../command-allocator';
|
||||
@@ -119,11 +118,6 @@ export class WebGL2GFXDevice extends GFXDevice {
|
||||
};
|
||||
|
||||
this._webGL2RC = this._canvas.getContext('webgl2', webGLCtxAttribs);
|
||||
/*
|
||||
if (this._webGL2RC && info.debug) {
|
||||
this._webGL2RC = WebGLDeveloperTools.makeDebugContext(this._webGL2RC, this._onWebGLError.bind(this));
|
||||
}
|
||||
*/
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return false;
|
||||
@@ -479,8 +473,4 @@ export class WebGL2GFXDevice extends GFXDevice {
|
||||
gl.colorMask(true, true, true, true);
|
||||
gl.blendColor(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
private _onWebGLError (error: GLenum, functionName: string, ...args: any[]) {
|
||||
throw new Error(`${WebGLDeveloperTools.glEnumToString(error)} was caused by call to ${functionName}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
"vinyl-buffer": "1.0.0",
|
||||
"vinyl-source-stream": "1.0.0",
|
||||
"watchify": "^3.7.0",
|
||||
"webgl-debug": "github:cocos-creator/webgl-debug#f7f7f90",
|
||||
"yargs": "^12.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ async function _doBundle (options: IBuildOptions) {
|
||||
commonjs({
|
||||
namedExports: {
|
||||
cannon: ['CANNON', 'Shape'],
|
||||
'webgl-debug': ['makeDebugContext', 'glEnumToString'],
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -63,7 +63,6 @@ export default {
|
||||
commonjs({
|
||||
namedExports: {
|
||||
'cannon': ['CANNON'],
|
||||
'webgl-debug': ['makeDebugContext', 'glEnumToString']
|
||||
}
|
||||
}),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user