-
Notifications
You must be signed in to change notification settings - Fork 335
Implement WebGPUTextureViewDescriptor #90
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
Conversation
f64c3f7
to
201b323
Compare
"3d" | ||
}; | ||
|
||
dictionary WebGPUTextureViewDescriptor { |
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.
we'll need aspects from #89 here so probably makes sense to wait for it first
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.
It sounds like we might want to use a special format for this as mentioned in #79 ?
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 another choice is to add a flag to specify which part (color, depth or stencil) is covered in the texture view (like the aspectMask in VkImageSubresourceRange).
}; | ||
|
||
interface WebGPUTexture { | ||
WebGPUTextureView createTextureView(WebGPUTextureViewDescriptor desc); |
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.
Maybe we want to have createTextureView
be on the device so that WebGPUTexture
is a opaque handle and that's it. WDYT?
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 was considering that as well when reviewing. And my initial reaction was: it's fine:
- Vulkan and D3D12 devices are internally synchronized, so the
WebGPUTexture
implementation can just carry a pointer to one. No performance overhead from this. - Metal already has the view creation on
MTLTexture
itself. - Slightly cleaner (and more user friendly) API
WebGPUTexture
is an interface anyway. Is there a benefit from it being empty, e.g. for WASM host bindings proposal?
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 have moved createTextureView to WebGPUDevice. PTAL, thanks!
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.
@kvark agreed that it doesn't make a big difference and there's no special benefits to WebGPUTexture
being an empty interface. I don't really mind either way so maybe we can keep it in texture and bikeshed later?
@Jiawei-Shao sorry for the churn on this and https://dawn-review.googlesource.com/c/dawn/+/1580 can you rollback the changes?
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.
Done
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.
requesting #89 to go first, and some discussion on interface WebGPUTexture
to happen
d5aab70
to
00e3457
Compare
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.
Thank you for addressing the concerns! Please squash the commits (since the 2nd one got reverted anyway) before we proceed.
00e3457
to
d3b8aee
Compare
This patch adds the definition of WebGPUTextureViewDimension and the required members in WebGPUTextureViewDescriptor according to the proposal gpuweb#79.
d3b8aee
to
d3d7d23
Compare
Done |
I think there's been enough time for anyone to look at the code, and there isn't much of it anyway. Merging |
This patch adds the definition of WebGPUTextureViewDimension and
the required members in WebGPUTextureViewDescriptor according to
the proposal #79.