Metal ANGLE cannot draw a single vertex/instance if attribute size is not aligned to 4 bytes
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxpe])
Attachments
(2 files)
We run into this issue when attempting to run webrender on Metal ANGLE (bug 2052515).
Metal does not support binding vertex attributes where the offset + stride > buffer_len. To work around this, ANGLE will in such cases set the stride to the size of the single attribute. However, Metal also requires that the strides are aligned to 4 bytes.
When we have instance attributes that are not 4-byte aligned, and attempt to draw a single instance, we therefore hit this assertion.
Specifically, this happens when drawing a single instance with cs_svg_filter_node, which has 2x u16 attributes.
If we pack these into a u16x2 we can avoid the crash.
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
|
||
Metal requires that vertex attributes' offsets + strides do not extend
beyond the end of their buffer. When drawing a single vertex or
instance, ANGLE therefore clamps the stride to the size of the single
attribute. Unfortunately, however, Metal also requires that vertex
attribute strides are aligned to 4 bytes.
This makes it impossible to use non-4-byte-aligned instance attributes
on Metal ANGLE, as attempting to draw a single instance will fail due
to invalid alignment.
To avoid this, we ensure instance attributes are always aligned to 4
bytes. Specifically, this means packing cs_svg_filter_node's filter
kind and input count attributes into a u16x2 vector, rather than as
2 separate u16 scalars.
Comment 4•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b487125e2ffa
https://hg.mozilla.org/mozilla-central/rev/2cf4824879e0
Updated•1 month ago
|
Description
•