(gl, internalFormat, format, type)
| 168 | } |
| 169 | |
| 170 | function 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 | |
| 191 | function supportRenderTextureFormat (gl, internalFormat, format, type) { |
| 192 | let texture = gl.createTexture(); |
no test coverage detected