MCPcopy Index your code
hub / github.com/gpujs/gpu.js / getInternalFormat

Method getInternalFormat

src/backend/web-gl2/kernel.js:250–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

248 }
249 }
250 getInternalFormat() {
251 const { context: gl } = this;
252
253 if (this.precision === 'single') {
254 if (this.pipeline) {
255 switch (this.returnType) {
256 case 'Number':
257 case 'Float':
258 case 'Integer':
259 if (this.optimizeFloatMemory) {
260 return gl.RGBA32F;
261 } else {
262 return gl.R32F;
263 }
264 case 'Array(2)':
265 return gl.RG32F;
266 case 'Array(3)': // there is _no_ 3 channel format which is guaranteed to be color-renderable
267 case 'Array(4)':
268 return gl.RGBA32F;
269 default:
270 throw new Error('Unhandled return type');
271 }
272 }
273 return gl.RGBA32F;
274 }
275 return gl.RGBA;
276 }
277
278 _setupOutputTexture() {
279 const gl = this.context;

Callers 3

getTextureFormatMethod · 0.95
_setupOutputTextureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected