Bug 199197 - [WHLSL] Issues with nested arrays
Summary: [WHLSL] Issues with nested arrays
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on: 198414
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-25 11:34 PDT by Saam Barati
Modified: 2019-07-01 12:30 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-06-25 11:34:42 PDT
This only works if I change memsetZero to be "value = { 0 };":
```
bool test1(device int[] buffer) {
    thread int*[30] ptrs;
    if (ptrs.length != 30)
        return false;

    for (uint i = 0; i < ptrs.length; ++i) {
        thread int* ptr = ptrs[i];
        if (ptr != null) {
            buffer[0] = 4242;
            return false;
        }
    }

    int x = 42;
    //ptrs[28] = &x;

    return true;
}
```


However, this always fails, even with above change. And it fails in the loop, even though the store is below the loop. Weird.
```
bool test1(device int[] buffer) {
    thread int*[30] ptrs;
    if (ptrs.length != 30)
        return false;

    for (uint i = 0; i < ptrs.length; ++i) {
        thread int* ptr = ptrs[i];
        if (ptr != null) {
            buffer[0] = 4242;
            return false;
        }
    }

    int x = 42;
    ptrs[28] = &x;

    return true;
}
```