MCPcopy Create free account
hub / github.com/tensorflow/tfjs / validateTextureSize

Function validateTextureSize

tfjs-backend-webgl/src/webgl_util.ts:206–219  ·  view source on GitHub ↗
(width: number, height: number)

Source from the content-addressed store, hash-verified

204}
205
206export function validateTextureSize(width: number, height: number) {
207 const maxTextureSize = env().getNumber('WEBGL_MAX_TEXTURE_SIZE');
208 if ((width <= 0) || (height <= 0)) {
209 const requested = `[${width}x${height}]`;
210 throw new Error('Requested texture size ' + requested + ' is invalid.');
211 }
212 if ((width > maxTextureSize) || (height > maxTextureSize)) {
213 const requested = `[${width}x${height}]`;
214 const max = `[${maxTextureSize}x${maxTextureSize}]`;
215 throw new Error(
216 'Requested texture size ' + requested +
217 ' greater than WebGL maximum on this browser / GPU ' + max + '.');
218 }
219}
220
221export function createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer {
222 return throwIfNull<WebGLFramebuffer>(

Callers

nothing calls this directly

Calls 2

envFunction · 0.90
getNumberMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…