rust-qt / ritual

Use C++ libraries from Rust
Apache License 2.0
1.22k stars 49 forks source link

Vulkan support #88

Open happydpc opened 4 years ago

happydpc commented 4 years ago

Will vulkan api be supported in the future?

Riateche commented 4 years ago

Are you referring to the Vulkan API provided by Qt? It's possible to add it. It's not included by default because #include <QtGui> doesn't include Vulkan related API (presumably because it requires that Vulkan headers are installed in the system). We can probably make it a separate crate.

Qt's Vulkan API uses subclassing a lot, and ritual doesn't support subclassing yet. So we'll need to work on that to make Vulkan API fully usable.

happydpc commented 4 years ago

Yes, I want to embed vulkan view on Qt widget. And another question is ritual on windows seems still not work, because of the -PIC.

Riateche commented 4 years ago

CI shows that ritual should work on Windows with MSVC 2017, but other compilers are untested yet. Can you describe your environment (OS version, rust toolchain, C++ compiler version, Qt version and Qt build's target compiler) where ritual doesn't work?

happydpc commented 4 years ago

Ok, I will try again. The generating process may cost too much time. And I love this project. it works very well on linux.

happydpc commented 4 years ago

CI shows that ritual should work on Windows with MSVC 2017, but other compilers are untested yet. Can you describe your environment (OS version, rust toolchain, C++ compiler version, Qt version and Qt build's target compiler) where ritual doesn't work?

I am using windows 10, rust-1.40.0-nightly. MSVC2017 , Qt 5.13.1, build for msvc 2017. I have found the problem, it's the problem of cpp_checker, at tmp\cpp_checker\tests\src\main.cpp:

#include "utils.h"

int main() {
{
}
}
}

this will triger the compile error with no return value. image

happydpc commented 4 years ago

Still the same error:

INFO [ritual::cli] Workspace: D:\projects\rusts\ritual\generated INFO [ritual::cli] Current target: x86_64-windows-windows-msvc INFO [qt_ritual::lib_configs] Preparing generator config for crate: qt_core INFO [ritual::processor] Processing crate: qt_core INFO [ritual::processor] Current C++ library version: 5.13.1 INFO [ritual::workspace] Loading database for qt_core INFO [ritual::processor] Running processing step: cpp_parser ERROR [ritual::processor] Step failed! Aborting... INFO [ritual::workspace] Saving data ERROR [ritual_common::errors] Error: ERROR [ritual_common::errors] fatal clang error: error: unsupported option '-fPIC' for target 'x86_64-pc-windows-msvc' ERROR [ritual_common::errors] stack backtrace:

happydpc commented 4 years ago

This link may help, https://github.com/google/shaderc/pull/772.

Riateche commented 4 years ago

The -fPIC related error on Windows should be fixed now.

happydpc commented 4 years ago

The -fPIC related error on Windows should be fixed now.

Thank you for all your efforts. I am going to have a try.