-
Notifications
You must be signed in to change notification settings - Fork 546
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
[RFC] Warden test framework #1589
Conversation
This is awesome! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 😍
download_type: hal::MemoryType, | ||
} | ||
|
||
fn align(x: usize, y: usize) -> usize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function doing?
edit: rather, how does this work?
let copy_submit = { | ||
let mut cmd_buffer = command_pool.acquire_command_buffer(); | ||
let image_barrier = hal::memory::Barrier::Image { | ||
states: image.stable_state .. (i::TRANSFER_READ, i::ImageLayout::TransferSrcOptimal), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image needs to be created with TRANSFER_SRC
usage.
fn align(x: usize, y: usize) -> usize {
if x > 0 && y > 0 {
((x - 1) | (y - 1)) + 1
} else {
x
}
} It aligns address It may be sub-optimal, or obscure, but it doesn't matter here as long as it's correct. Patches welcome ;)
We currently use the exact flags provided by the user. We should probably either add that usage if we know it's needed, or at least check for its presense, as a follow-up. Also, since there seem to be an agreement over the fact that we need this (:tada:), I'm releasing bors :shipit: |
Hmm, bors didn't get the hint. Let me try again. bors r=msiglreith |
Merge conflict |
Rebased now bors r=msiglreith |
1589: [RFC] Warden test framework r=msiglreith a=kvark This is a pre-alpha of the new test infrastructure. It's based on [RON](https://github.com/ron-rs/ron)-defined tests that are de-serialized and executed on each available native backend. See [readme](https://github.com/kvark/gfx/tree/warden/src/warden) for ~~devil in the~~ details. For Unix machines, all you need is `make reftests`. For Windows (without WSL): `(cd src/warden && cargo run --features vulkan,dx12,logger)` Output: ``` Warding Vulkan: AdapterInfo { name: "Radeon(TM) RX 460 Graphics ", vendor: 4098, device: 26607, software_rendering: false } Loading scene 'basic': Test 'render-pass-clear' ... ran: PASS Warding DX12: AdapterInfo { name: "Radeon(TM) RX 460 Graphics", vendor: 4098, device: 26607, software_rendering: false } Loading scene 'basic': Test 'render-pass-clear' ... ran: PASS ``` Fixes #1410 Note: it will really shine when: 1. we get GL support - #1539 2. hook Warden up with headless glutin context - #1410 3. run on Travis CI HAL changes: - `Instance` specifies `Backend` as an associated type - `create_renderpass` -> `create_render_pass` for naming consistency The PR has a lot of unfinished bits (e.g. PSO creation) but it's functional and technically ready for merging. I'm not 100% confident that being data-driven is a good thing here, hence `RFC` in the subject: - (+) RON is more expressive (maps, enum values, etc) - (+) somewhat consistent with [Wrench](https://github.com/servo/webrender/tree/master/wrench/reftests) - (-) RON is another format/language (note: can do any `serde`-supported format, really) - (~) run-time checked instead of compile-time. This is not really a great point since we are supposed to run those tests everywhere all the time, so we shouldn't end up in a situation where someone built them but didn't run.
This is a pre-alpha of the new test infrastructure. It's based on RON-defined tests that are de-serialized and executed on each available native backend. See readme for
devil in thedetails.For Unix machines, all you need is
make reftests
.For Windows (without WSL):
(cd src/warden && cargo run --features vulkan,dx12,logger)
Output:
Fixes #1410
Note: it will really shine when:
HAL changes:
Instance
specifiesBackend
as an associated typecreate_renderpass
->create_render_pass
for naming consistencyThe PR has a lot of unfinished bits (e.g. PSO creation) but it's functional and technically ready for merging. I'm not 100% confident that being data-driven is a good thing here, hence
RFC
in the subject:serde
-supported format, really)