/*
** Copyright (c) 2012 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
// Various functions for helping debug WebGL apps.
WebGLDebugUtils = function() {
/**
* Wrapped logging function.
* @param {string} msg Message to log.
*/
var log = function(msg) {
if (window.console && window.console.log) {
window.console.log(msg);
}
};
/**
* Wrapped error logging function.
* @param {string} msg Message to log.
*/
var error = function(msg) {
if (window.console && window.console.error) {
window.console.error(msg);
} else {
log(msg);
}
};
/**
* Which arguments are enums based on the number of arguments to the function.
* So
* 'texImage2D': {
* 9: { 0:true, 2:true, 6:true, 7:true },
* 6: { 0:true, 2:true, 3:true, 4:true },
* },
*
* means if there are 9 arguments then 6 and 7 are enums, if there are 6
* arguments 3 and 4 are enums
*
* @type {!Object.<number, !Object.<number, string>}
*/
var glValidEnumContexts = {
// Generic setters and getters
'enable': {1: { 0:true }},
'disable': {1: { 0:true }},
'getParameter': {1: { 0:true }},
// Rendering
'drawArrays': {3:{ 0:true }},
'drawElements': {4:{ 0:true, 2:true }},
// Shaders
'createShader': {1: { 0:true }},
'getShaderParameter': {2: { 1:true }},
'getProgramParameter': {2: { 1:true }},
'getShaderPrecisionFormat': {2: { 0: true, 1:true }},
// Vertex attributes
'getVertexAttrib': {2: { 1:true }},
'vertexAttribPointer': {6: { 2:true }},
// Textures
'bindTexture': {2: { 0:true }},
'activeTexture': {1: { 0:true }},
'getTexParameter': {2: { 0:true, 1:true }},
'texParameterf': {3: { 0:true, 1:true }},
'texParameteri': {3: { 0:true, 1:true, 2:true }},
// texImage2D and texSubImage2D are defined below with WebGL 2 entrypoints
'copyTexImage2D': {8: { 0:true, 2:true }},
'copyTexSubImage2D': {8: { 0:true }},
'generateMipmap': {1: { 0:true }},
// compressedTexImage2D and compressedTexSubImage2D are defined below with WebGL 2 entrypoints
// Buffer objects
'bindBuffer': {2: { 0:true }},
// bufferData and bufferSubData are defined below with WebGL 2 entrypoints
'getBufferParameter': {2: { 0:true, 1:true }},
// Renderbuffers and framebuffers
'pixelStorei': {2: { 0:true, 1:true }},
// readPixels is defined below with WebGL 2 entrypoints
'bindRenderbuffer': {2: { 0:true }},
'bindFramebuffer': {2: { 0:true }},
'checkFramebufferStatus': {1: { 0:true }},
'framebufferRenderbuffer': {4: { 0:true, 1:true, 2:true }},
'framebufferTexture2D': {5: { 0:true, 1:true, 2:true }},
'getFramebufferAttachmentParameter': {3: { 0:true, 1:true, 2:true }},
'getRenderbufferParameter': {2: { 0:true, 1:true }},
'renderbufferStorage': {4: { 0:true, 1:true }},
// Frame buffer operations (clear, blend, depth test, stencil)
'clear': {1: { 0: { 'enumBitwiseOr': ['COLOR_BUFFER_BIT', 'DEPTH_BUFFER_BIT', 'STENCIL_BUFFER_BIT'] }}},
'depthFunc': {1: { 0:true }},
'blendFunc': {2: { 0:true, 1:true }},
'blendFuncSeparate': {4: { 0:true, 1:true, 2:true, 3:true }},
'blendEquation': {1: { 0:true }},
'blendEquationSeparate': {2: { 0:true, 1:true }},
'stencilFunc': {3: { 0:true }},
'stencilFuncSeparate': {4: { 0:true, 1:true }},
'stencilMaskSeparate': {2: { 0:true }},
'stencilOp': {3: { 0:true, 1:true, 2:true }},
'stencilOpSeparate': {4: { 0:true, 1:true, 2:true, 3:true }},
// Culling
'cullFace': {1: { 0:true }},
'frontFace': {1: { 0:true }},
// ANGLE_instanced_arrays extension
'drawArraysInstancedANGLE': {4: { 0:true }},
'drawElementsInstancedANGLE': {5: { 0:true, 2:true }},
// EXT_blend_minmax extension
'blendEquationEXT': {1: { 0:true }},
// WebGL 2 Buffer objects
'bufferData': {
3: { 0:true, 2:true }, // WebGL 1
4: { 0:true, 2:true }, // WebGL 2
5: { 0:true, 2:true } // WebGL 2
},
'bufferSubData': {
3: { 0:true }, // WebGL 1
4: { 0:true }, // WebGL 2
5: { 0:true } // WebGL 2
},
'copyBufferSubData': {5: { 0:true, 1:true }},
'getBufferSubData': {3: { 0:true }, 4: { 0:true }, 5: { 0:true }},
// WebGL 2 Framebuffer objects
'blitFramebuffer': {10: { 8: { 'enumBitwiseOr': ['COLOR_BUFFER_BIT', 'DEPTH_BUFFER_BIT', 'STENCIL_BUFFER_BIT'] }, 9:true }},
'framebufferTextureLayer': {5: { 0:true, 1:true }},
'invalidateFramebuffer': {2: { 0:true }},
'invalidateSubFramebuffer': {6: { 0:true }},
'readBuffer': {1: { 0:true }},
// WebGL 2 Renderbuffer objects
'getInternalformatParameter': {3: { 0:true, 1:true, 2:true }},
'renderbufferStorageMultisample': {5: { 0:true, 2:true }},
// WebGL 2 Texture objects
'texStorage2D': {5: { 0:true, 2:true }},
'texStorage3D': {6: { 0:true, 2:true }},
'texImage2D': {
9: { 0:true, 2:true, 6:true, 7:true }, // WebGL 1 & 2
6: { 0:true, 2:true, 3:true, 4:true }, // WebGL 1
10: { 0:true, 2:true, 6:true, 7:true } // WebGL 2
},
'texImage3D': {
10: { 0:true, 2:true, 7:true, 8:true },
11: { 0:true, 2:true, 7:true, 8:true }
},
'texSubImage2D': {
9: { 0:true, 6:true, 7:true }, // WebGL 1 & 2
7: { 0:true, 4:true, 5:true }, // WebGL 1
10: { 0:true, 6:true, 7:true } // WebGL 2
},
'texSubImage3D': {
11: { 0:true, 8:true, 9:true },
12: { 0:true, 8:true, 9:true }
},
'copyTexSubImage3D': {9: { 0:true }},
'compressedTexImage2D': {
7: { 0: true, 2:true }, // WebGL 1 & 2
8: { 0: true, 2:true }, // WebGL 2
9: { 0: true, 2:true } // WebGL 2
},
'compressedTexImage3D': {
8: { 0: true, 2:true },
9: { 0: true, 2:true },
10: { 0: true, 2:true }
},
'compressedTexSubImage2D': {
8: { 0: true, 6:true }, // WebGL 1 & 2
9: { 0: true, 6:true }, // WebGL 2
10: { 0: true, 6:true } // WebGL 2
},
'compressedTexSubImage3D': {
10: { 0: true, 8:true },
11: { 0: true, 8:true },
12: { 0: true, 8:true }
},
// WebGL 2 Vertex attribs
'vertexAttribIPointer': {5: { 2:true }},
// WebGL 2 Writing to the drawing buffer
'drawArraysInstanced': {4: { 0:true }},
'drawElementsInstanced': {5: { 0:true, 2:true }},
'drawRangeElements': {6: { 0:true, 4:true }},

数字地球工作室
- 粉丝: 2
最新资源
- 预应力高强混凝土管桩施工技术.doc
- 基于大数据的农膜品牌营销分析-洞察阐释.pptx
- 基于PLC的XA卧式铣床电气控制系统设计.doc
- 浙江中小企业发展电子商务的现状及对策分析.doc
- 最完整竣工结算资料.docx
- 北京小区地板采暖施工组织设计.doc
- 福建省西北某村人饮工程可行性研究报告p.doc
- 电压-电流法测定电线电缆绝缘电阻的不确定度评定.doc
- 给排水工程量计算规则.doc
- 探讨企业项目管理的薪酬激励问题.docx
- 试析视觉表现的网络广告设计.docx
- 第八章矢量算法与场论初步张量算法与黎曼几何初步SECTION2.doc
- 年度晋级考核制度.doc
- PLC变频恒压供水控制系统设计方案.doc
- 180°翻转机主动减速电机选型.doc
- 著名综合大楼给排水施工方案(创鲁班奖).doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


