MCPcopy
hub / github.com/PavelDoGreat/WebGL-Fluid-Simulation / getSupportedFormat

Function getSupportedFormat

script.js:170–189  ·  view source on GitHub ↗
(gl, internalFormat, format, type)

Source from the content-addressed store, hash-verified

168}
169
170function getSupportedFormat (gl, internalFormat, format, type)
171{
172 if (!supportRenderTextureFormat(gl, internalFormat, format, type))
173 {
174 switch (internalFormat)
175 {
176 case gl.R16F:
177 return getSupportedFormat(gl, gl.RG16F, gl.RG, type);
178 case gl.RG16F:
179 return getSupportedFormat(gl, gl.RGBA16F, gl.RGBA, type);
180 default:
181 return null;
182 }
183 }
184
185 return {
186 internalFormat,
187 format
188 }
189}
190
191function supportRenderTextureFormat (gl, internalFormat, format, type) {
192 let texture = gl.createTexture();

Callers 1

getWebGLContextFunction · 0.85

Calls 1

Tested by

no test coverage detected