glsl-to-cxx doesn't properly convert non-bool types to bools and vice-versa
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: lsalzman, Assigned: lsalzman)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Clang's OpenCL vectors (and also GCC) represent boolean true as an all-1 pattern, which when converted to int or float becomes -1. Likewise, converting an int or float to our "Bool" type gets converted to the value 1, since the type is functionally equivalent to I32...
To fix this, we need to convert to bool via a !=0 comparison, and when converting from bool to something else, we need to mask it with &1 to get the expected value GLSL would produce...
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
How did you find this problem? Is there a test failure that corresponds?
Assignee | ||
Comment 3•5 years ago
|
||
The text/subpixel- wrench reftests fail because they use a "mask *= float(all(...))" statement that is casting a bool to a float for clipping purposes. It was converting the bool to a -1 value, causing all sorts of havoc, but mainly the text showing up as invalid colored junk. The patch should fix it all nicely now.
Comment 6•5 years ago
|
||
bugherder |
Description
•