mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Use const*const* to annotate a sequence of descriptors
BUG=dawn:77 Change-Id: I2a523e54a06173c157730e043c25e9629887fd1f Reviewed-on: https://dawn-review.googlesource.com/c/3820 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
850c0d9aec
commit
c0f31e73e4
@@ -115,8 +115,7 @@ void init() {
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ void init() {
|
||||
attachmentsState.nextInChain = nullptr;
|
||||
attachmentsState.numColorAttachments = 1;
|
||||
dawnAttachmentDescriptor colorAttachment = {nullptr, swapChainFormat};
|
||||
attachmentsState.colorAttachments = &colorAttachment;
|
||||
dawnAttachmentDescriptor* colorAttachmentPtr[] = {&colorAttachment};
|
||||
attachmentsState.colorAttachments = colorAttachmentPtr;
|
||||
attachmentsState.hasDepthStencilAttachment = false;
|
||||
// Even with hasDepthStencilAttachment = false, depthStencilAttachment must point to valid
|
||||
// data because we don't have optional substructures yet.
|
||||
|
||||
@@ -130,8 +130,7 @@ void initRender() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
renderPipeline = device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
||||
@@ -133,8 +133,7 @@ void init() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
||||
@@ -200,8 +200,7 @@ void init() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cDepthStencilState.depthWriteEnabled = true;
|
||||
descriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
|
||||
@@ -214,8 +213,7 @@ void init() {
|
||||
pDescriptor.inputState = inputState;
|
||||
pDescriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
pDescriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
pDescriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
pDescriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
pDescriptor.cDepthStencilState.front.passOp = dawn::StencilOperation::Replace;
|
||||
pDescriptor.cDepthStencilState.back.passOp = dawn::StencilOperation::Replace;
|
||||
pDescriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
@@ -229,8 +227,7 @@ void init() {
|
||||
rfDescriptor.inputState = inputState;
|
||||
rfDescriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
rfDescriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
rfDescriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
rfDescriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
pDescriptor.cDepthStencilState.front.compare = dawn::CompareFunction::Equal;
|
||||
pDescriptor.cDepthStencilState.back.compare = dawn::CompareFunction::Equal;
|
||||
pDescriptor.cDepthStencilState.front.passOp = dawn::StencilOperation::Replace;
|
||||
|
||||
@@ -292,8 +292,7 @@ namespace {
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint16;
|
||||
descriptor.cAttachmentsState.hasDepthStencilAttachment = true;
|
||||
descriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorAttachments[0].format =
|
||||
GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cDepthStencilState.depthWriteEnabled = true;
|
||||
descriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user