mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +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
@@ -23,6 +23,7 @@
|
||||
#include "common/Assert.h"
|
||||
#include "common/Math.h"
|
||||
#include "common/Constants.h"
|
||||
#include "utils/ComboRenderPipelineDescriptor.h"
|
||||
#include "utils/DawnHelpers.h"
|
||||
#include "utils/SystemUtils.h"
|
||||
|
||||
@@ -287,16 +288,20 @@ namespace {
|
||||
.GetResult();
|
||||
|
||||
auto pipelineLayout = utils::MakeBasicPipelineLayout(device, &bindGroupLayout);
|
||||
auto pipeline = device.CreateRenderPipelineBuilder()
|
||||
.SetColorAttachmentFormat(0, GetPreferredSwapChainTextureFormat())
|
||||
.SetDepthStencilAttachmentFormat(dawn::TextureFormat::D32FloatS8Uint)
|
||||
.SetLayout(pipelineLayout)
|
||||
.SetStage(dawn::ShaderStage::Vertex, oVSModule, "main")
|
||||
.SetStage(dawn::ShaderStage::Fragment, oFSModule, "main")
|
||||
.SetIndexFormat(dawn::IndexFormat::Uint16)
|
||||
.SetInputState(inputState)
|
||||
.SetDepthStencilState(depthStencilState)
|
||||
.GetResult();
|
||||
|
||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||
descriptor.layout = pipelineLayout;
|
||||
descriptor.cVertexStage.module = oVSModule;
|
||||
descriptor.cFragmentStage.module = oFSModule;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint16;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.depthStencilState = depthStencilState;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
dawn::BindGroup bindGroup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user