-
Notifications
You must be signed in to change notification settings - Fork 328
Browser fixes #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser fixes #479
Changes from 1 commit
beee719
5339bf4
291fab9
fc8c624
d8b91f5
0b87f34
9a7d9e5
0703765
16b7628
34d4b04
50afc01
462f27c
be3326d
d18b56a
1487bd6
127e0a0
85bef7d
23ba463
b6f8d25
9938a8e
54db288
202e395
c6abb2e
0aa1b01
d369dbf
ac33e4f
449b5b5
1da66e1
fc418cc
0a82ba4
6afda7c
ad1c6ac
1a33343
3199462
617ff84
87e2ebf
b458147
8addf24
7745514
0b31a64
71bba6c
67d4cdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,12 +365,6 @@ module.exports = function createTextureSet ( | |
| 'rgb565': GL_UNSIGNED_SHORT_5_6_5, | ||
| 'rgb5 a1': GL_UNSIGNED_SHORT_5_5_5_1 | ||
| } | ||
| var textureDtypes = { | ||
| 'uint8': Uint8Array, | ||
| 'rgba4': Uint16Array, | ||
| 'rgb565': Uint16Array, | ||
| 'rgb5 a1': Uint16Array | ||
| } | ||
|
|
||
| var textureFormats = { | ||
| 'alpha': GL_ALPHA, | ||
|
|
@@ -392,12 +386,10 @@ module.exports = function createTextureSet ( | |
|
|
||
| if (extensions.oes_texture_float) { | ||
| textureTypes.float32 = textureTypes.float = GL_FLOAT | ||
| textureDtypes.float32 = Float32Array | ||
| } | ||
|
|
||
| if (extensions.oes_texture_half_float) { | ||
| textureTypes['float16'] = textureTypes['half float'] = GL_HALF_FLOAT_OES | ||
| textureDtypes.float16 = Uint16Array | ||
| } | ||
|
|
||
| if (extensions.webgl_depth_texture) { | ||
|
|
@@ -411,11 +403,6 @@ module.exports = function createTextureSet ( | |
| 'uint32': GL_UNSIGNED_INT, | ||
| 'depth stencil': GL_UNSIGNED_INT_24_8_WEBGL | ||
| }) | ||
|
|
||
| extend(textureDtypes, { | ||
| 'uint16': Uint16Array, | ||
| 'uint32': Uint32Array | ||
| }) | ||
| } | ||
|
|
||
| if (extensions.webgl_compressed_texture_s3tc) { | ||
|
|
@@ -854,10 +841,7 @@ module.exports = function createTextureSet ( | |
| target, miplevel, format, info.xOffset, info.yOffset, width, height, 0) | ||
| } else { | ||
| if (!data) { | ||
| var Dtype = textureDtypes[textureTypesInvert[type]] | ||
| if (Dtype) { | ||
| data = new Dtype(width * height * channels) | ||
| } | ||
| data = pool.allocType(type, width * height * channels) | ||
|
||
| } | ||
| gl.texImage2D( | ||
| target, miplevel, format, width, height, 0, format, type, data) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,7 +162,8 @@ tape('texture 2d', function (t) { | |
|
|
||
| var actual = regl.read() | ||
| for (i = 0; i < expected.length; ++i) { | ||
| if (!(Math.abs(actual[i] - expected[i]) <= tolerance)) { | ||
| // ignore null pixels as insignificant | ||
| if (expected[i] !== null && !(Math.abs(actual[i] - expected[i]) <= tolerance)) { | ||
| t.fail(name + ' @ index ' + i + ' ' + expected[i] + ' - ' + actual[i]) | ||
| return | ||
| } | ||
|
|
@@ -974,16 +975,17 @@ tape('texture 2d', function (t) { | |
| width: 5, | ||
| height: 5, | ||
| pixels: [ | ||
| 255, 0, 0, 255, 255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, | ||
| 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, | ||
| 0, 0, 0, 255, 0, 0, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 0, 0, 0, | ||
| 0, 0, 0, 255, 0, 0, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 0, 0, 0, | ||
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
| 255, 0, 0, 255, 255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, null, null, null, null, | ||
|
||
| 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, null, null, null, null, | ||
| 0, 0, 0, 255, 0, 0, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, null, null, null, null, | ||
| 0, 0, 0, 255, 0, 0, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, null, null, null, null, | ||
| null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null | ||
| ], | ||
| format: 'rgba', | ||
| type: 'uint8' | ||
| }, 'DOM image element - subimage') | ||
|
|
||
|
|
||
| endTest() | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firefox requires texture to be init with data before
subimagecall, otherwise gives warning.