MCPcopy
hub / github.com/processing/p5.js / ensureCompiledOnContext

Method ensureCompiledOnContext

src/webgl/p5.Shader.js:737–746  ·  view source on GitHub ↗

* @private

(context)

Source from the content-addressed store, hash-verified

735 * @private
736 */
737 ensureCompiledOnContext(context) {
738 if (this._compiled && this._renderer !== context) {
739 throw new Error(
740 'The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?'
741 );
742 } else if (!this._compiled) {
743 this._renderer = context?._renderer?.filterRenderer?._renderer || context;
744 this.init();
745 }
746 }
747
748 /**
749 * Queries the active attributes for this shader and loads

Callers 2

materialFunction · 0.95
copyToContextMethod · 0.95

Calls 1

initMethod · 0.95

Tested by

no test coverage detected