Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Jiawei-Shao
Copy link
Contributor

This patch adds the definition of WebGPUTextureViewDimension and
the required members in WebGPUTextureViewDescriptor according to
the proposal #79.

"3d"
};

dictionary WebGPUTextureViewDescriptor {
Copy link
Contributor

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

Copy link

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 ?

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor

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:

  1. Vulkan and D3D12 devices are internally synchronized, so the WebGPUTexture implementation can just carry a pointer to one. No performance overhead from this.
  2. Metal already has the view creation on MTLTexture itself.
  3. Slightly cleaner (and more user friendly) API
  4. WebGPUTexture is an interface anyway. Is there a benefit from it being empty, e.g. for WASM host bindings proposal?

Copy link
Contributor Author

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!

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@kvark kvark left a 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

Copy link
Contributor

@kvark kvark left a 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.

This patch adds the definition of WebGPUTextureViewDimension and
the required members in WebGPUTextureViewDescriptor according to
the proposal gpuweb#79.
@Jiawei-Shao
Copy link
Contributor Author

Done

@kvark
Copy link
Contributor

kvark commented Sep 25, 2018

I think there's been enough time for anyone to look at the code, and there isn't much of it anyway. Merging

@kvark kvark merged commit d041ff0 into gpuweb:master Sep 25, 2018
@Jiawei-Shao Jiawei-Shao deleted the add-textureview branch May 19, 2020 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants