Skip to content

Slightly rewrite the convolve method#1612

Merged
LaurenzV merged 1 commit intomainfrom
laurenz/fix
Apr 30, 2026
Merged

Slightly rewrite the convolve method#1612
LaurenzV merged 1 commit intomainfrom
laurenz/fix

Conversation

@LaurenzV
Copy link
Copy Markdown
Collaborator

This is a follow-up to #1601.

As was mentioned there, we seemingly cannot use indices to index the vector, otherwise it fails on Windows. Therefore, we changed it so the vector is first converted into an array. However, this now leads to issues on certain Mali GPUs (in this case tested on a Realme 8, but I saw other phones affected by this as well). A shader as the following:

#version 300 es
precision highp float;
precision highp int;

out vec4 outColor;

void main() {
  float weight = 0.25;
  float weights_arr[1] = float[1](weight);
  outColor = vec4(weights_arr[0], 0.0, 0.0, 1.0);
}

unfortunately fails to compile for many phones:
image

First zero-initializing and then assigning each field seems to work fine:

float weights_arr[1] = float[1](0.0);
weights_arr[0] = weight;

Therefore, we need to use this approach as well to make it work on those phones.

@LaurenzV LaurenzV requested a review from taj-p April 30, 2026 08:22
@laurenz-canva laurenz-canva deleted the laurenz/fix branch April 30, 2026 09:07
@LaurenzV LaurenzV restored the laurenz/fix branch April 30, 2026 09:14
@LaurenzV LaurenzV reopened this Apr 30, 2026
@LaurenzV LaurenzV added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 02c2501 Apr 30, 2026
34 checks passed
@LaurenzV LaurenzV deleted the laurenz/fix branch April 30, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants