-
Notifications
You must be signed in to change notification settings - Fork 916
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
[0.2] First bits of draw call validation, better submission tracking #114
Conversation
Interestingly, eager binding of descriptor sets is more complicated than I'd hope. We can't bind set N+1 if the currently bound set N is incompatible (in gfx-rs or Vulkan). At the same time WebGPU allows doing so. Therefore, the implementation needs to remember the descriptor sets that are waiting to be bound when the previous ones become compatible (not doing that yet in the PR). |
The triangle example no longer works for me on this PR.
|
@rukai thanks for testing! This was an issue with triangle example code, not wgpu itself. See the last commit for the fix. |
@rukai if you want to help reviewing the change, that would be good too ;) |
Just tried the new commit.
Trying to run it again in debug I can no longer get the triangle to render, it doesnt render anything for a while then panics.
Panic:
Compiling in release I get the same issue as the second time running in debug. |
wgpu-native/src/command/bind.rs
Outdated
@@ -38,21 +45,28 @@ impl BindGroupEntry { | |||
pub fn expect_layout( | |||
&mut self, | |||
bind_group_layout_id: BindGroupLayoutId, | |||
) -> Option<BindGroupId> { | |||
) -> Expectation { |
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.
The semantics of Expectation
as the return type seem a bit backwards – I'd expect to give an Expectation
to expect_layout
. The return value here seems more like some kind of expectation result.
wgpu-native/src/command/bind.rs
Outdated
} | ||
} | ||
|
||
pub(crate) fn provide_entry( | ||
&mut self, | ||
/// Attemt to set the value of the specified bind group index. |
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.
Attempt
} else { | ||
index + 1 | ||
}; | ||
(pipeline_layout_id, TakeSome { |
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.
Why is the iterator wrapper necessary here?
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.
I wish I could get that without my own iterator! Open to ideas :)
Basically, we want to go from Iterator<Option<Something>>
to Iterator<Something>
, stopping at the first None
.
wgpu-native/src/command/bind.rs
Outdated
pub fn ensure_length(&mut self, length: usize) { | ||
while self.entries.len() < length { | ||
self.entries.push(BindGroupEntry::default()); | ||
pub(crate) fn cut_expectations(&mut self, length: 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.
Is it just reset_expectations
?
wgpu-native/src/command/compute.rs
Outdated
@@ -109,8 +111,7 @@ pub extern "C" fn wgpu_compute_pass_set_pipeline( | |||
let bing_group_guard = HUB.bind_groups.read(); |
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.
bind_group_guard
use std::collections::HashMap; | ||
use std::sync::atomic::Ordering; | ||
use std::thread; | ||
|
||
|
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.
I think rustfmt will keep resetting these double lines so it's probably best not to fight it :)
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.
ah, I want to configure that!
@rukai do the gfx-examples work for you?
… On Mar 31, 2019, at 09:08, Josh Groves ***@***.***> wrote:
@grovesNL commented on this pull request.
In wgpu-native/src/command/render.rs:
> pub struct RenderPass<B: hal::Backend> {
raw: B::CommandBuffer,
cmb_id: Stored<CommandBufferId>,
context: RenderPassContext,
binder: Binder,
trackers: TrackerSet,
+ blend_color_set: i8,
Never mind :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for the review! Hopefully, everything is addressed now. @rukai I double checked and the |
Build succeeded |
114: skybox: log::debug and make rotation slower r=kvark a=m4b Co-authored-by: m4b <m4b.github.io@gmail.com>
114: skybox: log::debug and make rotation slower r=kvark a=m4b Co-authored-by: m4b <m4b.github.io@gmail.com>
* [glsl-new] handle gl_Position builtin - Also fix width of vec4 type * [glsl-new] add shader stage as arg to program ctor
Fixes #113