@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
2 lines (1 loc) • 821 B
JavaScript
import{BINDGROUP_VIEW as t}from"./constants.js";class r{constructor(r,e,s){this.uniformFormats=[],this.bindGroupFormats=[],this.vertexFormat=void 0,this.uniformFormats[t]=r,this.bindGroupFormats[t]=e,this.vertexFormat=s}hasUniform(t){for(let r=0;r<this.uniformFormats.length;r++){const e=this.uniformFormats[r];if(null!=e&&e.get(t))return!0}return!1}hasTexture(t){for(let r=0;r<this.bindGroupFormats.length;r++){const e=this.bindGroupFormats[r];if(null!=e&&e.getTexture(t))return!0}return!1}getVertexElement(t){var r;return null==(r=this.vertexFormat)?void 0:r.elements.find((r=>r.name===t))}generateKey(t){let r=JSON.stringify(this.uniformFormats)+JSON.stringify(this.bindGroupFormats);var e;t.isWebGPU&&(r+=null==(e=this.vertexFormat)?void 0:e.shaderProcessingHashString);return r}}export{r as ShaderProcessorOptions};