eliemichel / LearnWebGPU-Code

The accompanying code of the Learn WebGPU C++ programming guide
https://eliemichel.github.io/LearnWebGPU
MIT License
114 stars 30 forks source link

step090 compilation error #16

Closed xumo closed 1 year ago

xumo commented 1 year ago

The compilation of step090 gives the following error:

/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/Application.cpp:261:32: error: cannot take the address of an rvalue of type 'WGPUBindGroupLayout' (aka 'WGPUBindGroupLayoutImpl *')
        layoutDesc.bindGroupLayouts = &(WGPUBindGroupLayout)bindGroupLayout;
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/Application.cpp:357:18: error: use of overloaded operator '=' is ambiguous (with operand types 'wgpu::SwapChainDescriptor' and 'void')
        m_swapChainDesc = {};
        ~~~~~~~~~~~~~~~ ^ ~~
/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/webgpu/webgpu.hpp:815:12: note: candidate function (the implicit move assignment operator)
DESCRIPTOR(SwapChainDescriptor)
           ^
/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/webgpu/webgpu.hpp:815:12: note: candidate function (the implicit copy assignment operator)
/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/webgpu/webgpu.hpp:815:1: note: candidate function
DESCRIPTOR(SwapChainDescriptor)
^
/Users/rodrigotorres/rodrigo/procastination/wgpu-cpp/LearnWebGPU-Code/webgpu/webgpu.hpp:76:8: note: expanded from macro 'DESCRIPTOR'
        Type& operator=(const DefaultFlag &) { setDefault(); return *this; } \
              ^
2 errors generated.
make[2]: *** [CMakeFiles/App.dir/Application.cpp.o] Error 1
make[1]: *** [CMakeFiles/App.dir/all] Error 2
make: *** [all] Error 2

This was tested with mac and linux: macOs 13.3.1 (intel)

-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- The C compiler identification is AppleClang 14.0.3.14030022

Ubuntu 20.04

-- The CXX compiler identification is Clang 12.0.0
-- The C compiler identification is GNU 13.1.0 
prashant-saxena commented 1 year ago

Well I am not sure about your error but mine which was also related to shader compilation is gone by using the latest version (0, 16, 2, 1). The standard is not yet fixed and under rapid development and things are broken. The previous version I was using was not even returning it's version info when using wgpuGetVersion() call.

eliemichel commented 1 year ago

I just updated step090, as I am (once again) doing a full step by step update ;)