* A cache of compiled shaders, keyed by shader source strings. * Compilation of long shaders can be time consuming. * By using this class, the application can ensure that each shader * is only compiled once.
()
| 30643 | * is only compiled once. |
| 30644 | */ |
| 30645 | function ShaderCache() { |
| 30646 | var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, |
| 30647 | gl = _ref.gl, |
| 30648 | _ref$_cachePrograms = _ref._cachePrograms, |
| 30649 | _cachePrograms = _ref$_cachePrograms === void 0 ? false : _ref$_cachePrograms; |
| 30650 | |
| 30651 | (0, _classCallCheck2.default)(this, ShaderCache); |
| 30652 | (0, _assert.default)(gl); |
| 30653 | this.gl = gl; |
| 30654 | this.vertexShaders = {}; |
| 30655 | this.fragmentShaders = {}; |
| 30656 | this.programs = {}; |
| 30657 | this._cachePrograms = _cachePrograms; |
| 30658 | } |
| 30659 | /** |
| 30660 | * Deletes shader references |
| 30661 | * @return {ShaderCache} - returns this for chaining |
nothing calls this directly
no outgoing calls
no test coverage detected