Bug 219739 - REGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary video driver
Summary: REGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Miguel Gomez
Depends on:
Reported: 2020-12-10 05:46 PST by Miguel Gomez
Modified: 2020-12-11 04:46 PST (History)
6 users (show)

See Also:

Patch (3.95 KB, patch)
2020-12-11 02:38 PST, Miguel Gomez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Gomez 2020-12-10 05:46:50 PST
Some of the modifications added to the fragment shader (in order to implement rounded rectangle clipping) broke the rendering on the rpi3 when using the proprietary driver. While these changes work on mesa based drivers, it seems that the proprietary driver has some limitations:

* the right operand of the condition of a for loop must be a constant, which causes the line

for (int rectIndex = 0; rectIndex < nRects; rectIndex++)

not to work because nRects is not a constant.

* can't index arrays with non constant variables, which causes things like

vec4 bounds = vec4(u_roundedRect[index].xy, u_roundedRect[index].xy + u_roundedRect[index].zw);

not to work unless index is a constant (which is not).

So we need to rewrite the code in way that allows us to overcome those limitations. The first one is easy, as we need to replace the former loop with something like this:

for (int rectIndex = 0; rectIndex < ROUNDED_RECT_MAX_RECTS; rectIndex++) {
    if (rectIndex >= u_roundedRectNumber)


This is required for the driver to be able to unwind the for loop. And this gives a way to fix the second issue: when unwinding the loop, the rectIndex var will be a constant in each of the loop steps, which allows us to use it to index the array. We need to perform all the accesses to the array with that variable though, so we can't do it inside any function.

I'll send a patch with the changes.
Comment 1 Miguel Gomez 2020-12-11 02:38:43 PST
Created attachment 415982 [details]
Comment 2 EWS 2020-12-11 04:46:51 PST
Committed r270675: <https://trac.webkit.org/changeset/270675>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415982 [details].