mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Render Pipeline Descriptorization -- Part I
This patch remove render pipeline builder and use descriptor to create render pipeline. Sub-objects in descriptor will be removed in future. Bug: dawn:4 Change-Id: I58dd569c7be42c2648311847b939c681189c2854 Reviewed-on: https://dawn-review.googlesource.com/c/2180 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
07df605a2b
commit
a49242766a
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "SampleUtils.h"
|
||||
|
||||
#include "utils/ComboRenderPipelineDescriptor.h"
|
||||
#include "utils/DawnHelpers.h"
|
||||
#include "utils/SystemUtils.h"
|
||||
|
||||
@@ -123,13 +124,16 @@ void initRender() {
|
||||
|
||||
depthStencilView = CreateDefaultDepthStencilView(device);
|
||||
|
||||
renderPipeline = device.CreateRenderPipelineBuilder()
|
||||
.SetColorAttachmentFormat(0, GetPreferredSwapChainTextureFormat())
|
||||
.SetDepthStencilAttachmentFormat(dawn::TextureFormat::D32FloatS8Uint)
|
||||
.SetStage(dawn::ShaderStage::Vertex, vsModule, "main")
|
||||
.SetStage(dawn::ShaderStage::Fragment, fsModule, "main")
|
||||
.SetInputState(inputState)
|
||||
.GetResult();
|
||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||
descriptor.cVertexStage.module = vsModule;
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
|
||||
renderPipeline = device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
||||
void initSim() {
|
||||
|
||||
Reference in New Issue
Block a user