(type)
| 69 | } |
| 70 | |
| 71 | function zeroProgramForType(type) { |
| 72 | switch (type) { |
| 73 | case HALF_FLOAT: |
| 74 | case FLOAT: |
| 75 | return ` |
| 76 | out vec4 out_FragColor; |
| 77 | |
| 78 | void main() { |
| 79 | out_FragColor = vec4(0); |
| 80 | }`; |
| 81 | case UNSIGNED_BYTE: |
| 82 | case UNSIGNED_SHORT: |
| 83 | case UNSIGNED_INT: |
| 84 | return ` |
| 85 | out uvec4 out_FragColor; |
| 86 | |
| 87 | void main() { |
| 88 | out_FragColor = uvec4(0); |
| 89 | }`; |
| 90 | case BYTE: |
| 91 | case SHORT: |
| 92 | case INT: |
| 93 | return ` |
| 94 | out ivec4 out_FragColor; |
| 95 | |
| 96 | void main() { |
| 97 | out_FragColor = ivec4(0); |
| 98 | }`; |
| 99 | default: |
| 100 | throw new Error(`Invalid type: ${type}.`); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // General code for testing array writes. |
| 105 | function testLayerWrites(options) { |