Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade wgpu to 0.20.0 #25

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Upgrade wgpu to 0.20.0 #25

merged 2 commits into from
Jul 4, 2024

Conversation

orderrrr
Copy link

@orderrrr orderrrr commented Jul 3, 2024

Currently running wgpu-compute-toy on macOS fails to compile shaders.

For instance the buddhabrot example fails with the following:

[2024-07-03T17:19:59Z ERROR wgpu::backend::wgpu_core] Shader translation error for stage ShaderStages(COMPUTE): Metal: program_source:81:5: error: too many arguments provided to function-like macro invocation
        bool success,
        ^
    /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.194/include/metal/metal_assert:19:9: note: macro 'assert' defined here
    #define assert(condition) ((void) 0)
            ^
    program_source:79:6: error: program scope variable must reside in constant address space
    void assert(
         ^
    program_source:85:5: error: expected expression
        if (!(success)) {
        ^
    program_source:91:2: error: expected ';' after top level declarator
    }
     ^
     ;
    program_source:245:29: warning: unused variable '_e205' [-Wunused-variable]
                            int _e205 = uint(_e202) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e202], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
    program_source:247:29: warning: unused variable '_e213' [-Wunused-variable]
                            int _e213 = uint(_e210) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e210], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
    program_source:252:33: warning: unused variable '_e224' [-Wunused-variable]
                                int _e224 = uint(_e221) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e221], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^
    program_source:254:33: warning: unused variable '_e232' [-Wunused-variable]
                                int _e232 = uint(_e229) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e229], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^
    program_source:259:37: warning: unused variable '_e243' [-Wunused-variable]
                                    int _e243 = uint(_e240) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e240], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                        ^
    program_source:261:37: warning: unused variable '_e251' [-Wunused-variable]
                                    int _e251 = uint(_e248) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e248], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                        ^
                                                                                                                                            
[2024-07-03T17:19:59Z ERROR wgpu::backend::wgpu_core] Please report it to https://github.com/gfx-rs/wgpu
[2024-07-03T17:19:59Z ERROR wgputoy] Validation Error
                                                                                                                                            
    Caused by:
        In Device::create_compute_pipeline
        Internal error: Metal: program_source:81:5: error: too many arguments provided to function-like macro invocation
        bool success,
        ^
    /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.194/include/metal/metal_assert:19:9: note: macro 'assert' defined here
    #define assert(condition) ((void) 0)
            ^
    program_source:79:6: error: program scope variable must reside in constant address space
    void assert(
         ^
    program_source:85:5: error: expected expression
        if (!(success)) {
        ^
    program_source:91:2: error: expected ';' after top level declarator
    }
     ^
     ;
    program_source:245:29: warning: unused variable '_e205' [-Wunused-variable]
                            int _e205 = uint(_e202) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e202], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
    program_source:247:29: warning: unused variable '_e213' [-Wunused-variable]
                            int _e213 = uint(_e210) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e210], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
    program_source:252:33: warning: unused variable '_e224' [-Wunused-variable]
                                int _e224 = uint(_e221) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e221], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^
    program_source:254:33: warning: unused variable '_e232' [-Wunused-variable]
                                int _e232 = uint(_e229) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e229], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^
    program_source:259:37: warning: unused variable '_e243' [-Wunused-variable]
                                    int _e243 = uint(_e240) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e240], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                        ^
    program_source:261:37: warning: unused variable '_e251' [-Wunused-variable]
                                    int _e251 = uint(_e248) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e248], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                        ^
                                                                                                                                            
                                                                                                                                            
thread 'main' panicked at src/pp.rs:29:9:
0:0: Validation Error
                                                                                                                                            
Caused by:
    In Device::create_compute_pipeline
    Internal error: Metal: program_source:81:5: error: too many arguments provided to function-like macro invocation
    bool success,
    ^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.194/include/metal/metal_assert:19:9: note: macro 'assert' defined here
#define assert(condition) ((void) 0)
        ^
program_source:79:6: error: program scope variable must reside in constant address space
void assert(
     ^
program_source:85:5: error: expected expression
    if (!(success)) {
    ^
program_source:91:2: error: expected ';' after top level declarator
}
 ^
 ;
program_source:245:29: warning: unused variable '_e205' [-Wunused-variable]
                        int _e205 = uint(_e202) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e202], 1, metal::memory_order_relaxed) : DefaultConstructible();
                            ^
program_source:247:29: warning: unused variable '_e213' [-Wunused-variable]
                        int _e213 = uint(_e210) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e210], 1, metal::memory_order_relaxed) : DefaultConstructible();
                            ^
program_source:252:33: warning: unused variable '_e224' [-Wunused-variable]
                            int _e224 = uint(_e221) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e221], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
program_source:254:33: warning: unused variable '_e232' [-Wunused-variable]
                            int _e232 = uint(_e229) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e229], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                ^
program_source:259:37: warning: unused variable '_e243' [-Wunused-variable]
                                int _e243 = uint(_e240) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e240], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^
program_source:261:37: warning: unused variable '_e251' [-Wunused-variable]
                                int _e251 = uint(_e248) < 1 + (_buffer_sizes.size18 - 0 - 4) / 4 ? metal::atomic_fetch_add_explicit(&atomic_storage[_e248], 1, metal::memory_order_relaxed) : DefaultConstructible();
                                    ^


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Upgrading wgpu to 0.20.0 correctly compiles and runs:
image

NOTE - 0.20.1 also works but I assume it would not be a good idea to upgrade to that as it's not completely finished.

@davidar
Copy link
Contributor

davidar commented Jul 4, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants