Although floating point textures are supported through the "OES_texture_float" extension, reading back the pixels with gl.readPixels(x, y, width, height, gl.RGBA, gl.FLOAT, pixels); throws an error: "WebGL: INVALID_ENUM: readPixels: invalid type" A running example: https://cindyjs.org/examples/cindygl/34_cpuimagergba.html (It works with recent versions of Chromium and Firefox)
<rdar://problem/31905150>
One of the three.js example demonstrates the bug, too. It is broken since a while now. A fix for this issue would be great. https://threejs.org/examples/webgl_read_float_buffer.html
Created attachment 366336 [details] Patch
Attachment 366336 [details] did not pass style-queue: ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3545: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3547: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3563: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3564: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3565: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3566: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3567: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3569: Extra space before ) [whitespace/parens] [2] Total errors found: 8 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 366336 [details] Patch Attachment 366336 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/11709880 New failing tests: fast/canvas/webgl/readPixels-float.html
Created attachment 366357 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 366365 [details] Patch
Attachment 366365 [details] did not pass style-queue: ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3545: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3547: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3563: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3564: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3565: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3566: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3567: Extra space before ) [whitespace/parens] [2] ERROR: Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3569: Extra space before ) [whitespace/parens] [2] Total errors found: 8 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 366365 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366365&action=review > Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3547 > + } Style checker isn’t happy here, with reason!
Comment on attachment 366365 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366365&action=review >> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:3547 >> + } > > Style checker isn’t happy here, with reason! Nope, that's a style checker issue. This single line is a macro that's expanded to multiple statements.
Committed r243681: <https://trac.webkit.org/changeset/243681>