-
Notifications
You must be signed in to change notification settings - Fork 386
Pass attachments state by value #102
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -402,13 +402,20 @@ dictionary WebGPUShaderModuleDescriptor { | |
| interface WebGPUShaderModule { | ||
| }; | ||
|
|
||
| // Description of the framebuffer attachments | ||
| dictionary WebGPUAttachmentsStateDescriptor { | ||
| sequence<WebGPUTextureFormatEnum> formats; | ||
| // TODO other stuff like sample count etc. | ||
| // Description of a single attachment | ||
| dictionary WebGPUAttachment { | ||
| // Attachment data format | ||
| WebGPUTextureFormatEnum format; | ||
| // Number of MSAA samples | ||
| u32 samples; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pending discussion of multisampling, but I think we also need to add "boolean isResolvedAtEndOfRenderPass" because VkRenderPass compatibility includes "VkSubpassDescription:: pResolveAttachments". I'll open an issue on Vulkan-Docs to ask if this can be relaxed for single-subpass render passes.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the point of this PR is that we can derive the need of those being resolved simply by looking at the sample counts |
||
| }; | ||
|
|
||
| interface WebGPUAttachmentsState { | ||
| // Description of the framebuffer attachments | ||
| dictionary WebGPUAttachmentsState { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why make it a dictionary?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The point of this PR is to remove the attachment state as a handle, because there is no backend-specific data to associate with it. The render pass details is derived from the actual data passed to render pipeline creation and the beginning of a render pass. |
||
| // Array of color attachments | ||
| sequence<WebGPUAttachment> colorAttachments; | ||
| // Optional depth/stencil attachment | ||
| WebGPUAttachment? depthStencilAttachment; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not important for WebGPU, but this will translate to a nullable pointer to struct in Dawn, which our remoting layer doesn't have support for atm.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How else do you express a proper |
||
| }; | ||
|
|
||
| // Common stuff for ComputePipeline and RenderPipeline | ||
|
|
@@ -431,7 +438,7 @@ dictionary WebGPUPipelineDescriptorBase { | |
| sequence<WebGPUPipelineStageDescriptor> stages; | ||
| }; | ||
|
|
||
| // ComputePipeline | ||
| // WebGPUComputePipeline | ||
| dictionary WebGPUComputePipelineDescriptor : WebGPUPipelineDescriptorBase { | ||
| }; | ||
|
|
||
|
|
@@ -642,7 +649,6 @@ interface WebGPUDevice { | |
| WebGPUDepthStencilState createDepthStencilState(WebGPUDepthStencilStateDescriptor descriptor); | ||
| WebGPUInputState createInputState(WebGPUInputStateDescriptor descriptor); | ||
| WebGPUShaderModule createShaderModule(WebGPUShaderModuleDescriptor descriptor); | ||
| WebGPUAttachmentsState createAttachmentsState(WebGPUAttachmentsStateDescriptor descriptor); | ||
| WebGPUComputePipeline createComputePipeline(WebGPUComputePipelineDescriptor descriptor); | ||
| WebGPURenderPipeline createRenderPipeline(WebGPURenderPipelineDescriptor descriptor); | ||
|
|
||
|
|
||
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 this eventually going to be the place where we add things like blending operations?
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 might want to have separate types for color attachments and depth/stencil attachments before we add blending.