diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-05-04 11:44:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-04 11:44:24 -0700 |
| commit | ca86ce28829987fce2df4a81da976e6b18e17ad1 (patch) | |
| tree | 7c5032b8475157392aca4ff624357b3661534174 /tools | |
| parent | f4c2b0de41f703aa2000c344484e7cd37db56a32 (diff) | |
Changed all uses of attachment (in the context of render/depth stencil targets) to target (#2214)
Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gfx-unit-test/instanced-draw-tests.cpp | 14 | ||||
| -rw-r--r-- | tools/gfx-unit-test/resolve-resource-tests.cpp | 14 | ||||
| -rw-r--r-- | tools/gfx-unit-test/texture-types-tests.cpp | 14 | ||||
| -rw-r--r-- | tools/gfx/d3d11/render-d3d11.cpp | 4 | ||||
| -rw-r--r-- | tools/gfx/d3d12/render-d3d12.cpp | 6 | ||||
| -rw-r--r-- | tools/gfx/d3d12/render-d3d12.h | 4 | ||||
| -rw-r--r-- | tools/gfx/immediate-renderer-base.cpp | 6 | ||||
| -rw-r--r-- | tools/gfx/open-gl/render-gl.cpp | 4 | ||||
| -rw-r--r-- | tools/gfx/simple-render-pass-layout.h | 4 | ||||
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 82 | ||||
| -rw-r--r-- | tools/gfx/vulkan/render-vk.h | 8 | ||||
| -rw-r--r-- | tools/platform/gui.cpp | 6 | ||||
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 20 |
13 files changed, 93 insertions, 93 deletions
diff --git a/tools/gfx-unit-test/instanced-draw-tests.cpp b/tools/gfx-unit-test/instanced-draw-tests.cpp index 45ff0dd96..1e2fa1037 100644 --- a/tools/gfx-unit-test/instanced-draw-tests.cpp +++ b/tools/gfx-unit-test/instanced-draw-tests.cpp @@ -161,13 +161,13 @@ namespace gfx_test slang::ProgramLayout* slangReflection; GFX_CHECK_CALL_ABORT(loadGraphicsProgram(device, shaderProgram, "graphics-smoke", "vertexMain", "fragmentMain", slangReflection)); - IFramebufferLayout::AttachmentLayout attachmentLayout; - attachmentLayout.format = format; - attachmentLayout.sampleCount = 1; + IFramebufferLayout::TargetLayout targetLayout; + targetLayout.format = format; + targetLayout.sampleCount = 1; IFramebufferLayout::Desc framebufferLayoutDesc; framebufferLayoutDesc.renderTargetCount = 1; - framebufferLayoutDesc.renderTargets = &attachmentLayout; + framebufferLayoutDesc.renderTargets = &targetLayout; ComPtr<gfx::IFramebufferLayout> framebufferLayout = device->createFramebufferLayout(framebufferLayoutDesc); SLANG_CHECK_ABORT(framebufferLayout != nullptr); @@ -183,9 +183,9 @@ namespace gfx_test IRenderPassLayout::Desc renderPassDesc = {}; renderPassDesc.framebufferLayout = framebufferLayout; renderPassDesc.renderTargetCount = 1; - IRenderPassLayout::AttachmentAccessDesc renderTargetAccess = {}; - renderTargetAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Clear; - renderTargetAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + IRenderPassLayout::TargetAccessDesc renderTargetAccess = {}; + renderTargetAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear; + renderTargetAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; renderTargetAccess.initialState = ResourceState::RenderTarget; renderTargetAccess.finalState = ResourceState::CopySource; renderPassDesc.renderTargetAccess = &renderTargetAccess; diff --git a/tools/gfx-unit-test/resolve-resource-tests.cpp b/tools/gfx-unit-test/resolve-resource-tests.cpp index cc5dffd00..7b125a17d 100644 --- a/tools/gfx-unit-test/resolve-resource-tests.cpp +++ b/tools/gfx-unit-test/resolve-resource-tests.cpp @@ -177,13 +177,13 @@ namespace slang::ProgramLayout* slangReflection; GFX_CHECK_CALL_ABORT(loadGraphicsProgram(device, shaderProgram, "resolve-resource-shader", "vertexMain", "fragmentMain", slangReflection)); - IFramebufferLayout::AttachmentLayout attachmentLayout; - attachmentLayout.format = format; - attachmentLayout.sampleCount = 4; + IFramebufferLayout::TargetLayout targetLayout; + targetLayout.format = format; + targetLayout.sampleCount = 4; IFramebufferLayout::Desc framebufferLayoutDesc; framebufferLayoutDesc.renderTargetCount = 1; - framebufferLayoutDesc.renderTargets = &attachmentLayout; + framebufferLayoutDesc.renderTargets = &targetLayout; ComPtr<gfx::IFramebufferLayout> framebufferLayout = device->createFramebufferLayout(framebufferLayoutDesc); SLANG_CHECK_ABORT(framebufferLayout != nullptr); @@ -199,9 +199,9 @@ namespace IRenderPassLayout::Desc renderPassDesc = {}; renderPassDesc.framebufferLayout = framebufferLayout; renderPassDesc.renderTargetCount = 1; - IRenderPassLayout::AttachmentAccessDesc renderTargetAccess = {}; - renderTargetAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Clear; - renderTargetAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + IRenderPassLayout::TargetAccessDesc renderTargetAccess = {}; + renderTargetAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear; + renderTargetAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; renderTargetAccess.initialState = ResourceState::RenderTarget; renderTargetAccess.finalState = ResourceState::ResolveSource; renderPassDesc.renderTargetAccess = &renderTargetAccess; diff --git a/tools/gfx-unit-test/texture-types-tests.cpp b/tools/gfx-unit-test/texture-types-tests.cpp index 4d8037ce8..7f010e6fd 100644 --- a/tools/gfx-unit-test/texture-types-tests.cpp +++ b/tools/gfx-unit-test/texture-types-tests.cpp @@ -431,13 +431,13 @@ namespace gfx_test slang::ProgramLayout* slangReflection; GFX_CHECK_CALL_ABORT(loadGraphicsProgram(device, shaderProgram, "trivial-copy-textures", "vertexMain", "fragmentMain", slangReflection)); - IFramebufferLayout::AttachmentLayout attachmentLayout; - attachmentLayout.format = textureInfo->format; - attachmentLayout.sampleCount = sampleCount; + IFramebufferLayout::TargetLayout targetLayout; + targetLayout.format = textureInfo->format; + targetLayout.sampleCount = sampleCount; IFramebufferLayout::Desc framebufferLayoutDesc; framebufferLayoutDesc.renderTargetCount = 1; - framebufferLayoutDesc.renderTargets = &attachmentLayout; + framebufferLayoutDesc.renderTargets = &targetLayout; ComPtr<gfx::IFramebufferLayout> framebufferLayout = device->createFramebufferLayout(framebufferLayoutDesc); SLANG_CHECK_ABORT(framebufferLayout != nullptr); @@ -453,9 +453,9 @@ namespace gfx_test IRenderPassLayout::Desc renderPassDesc = {}; renderPassDesc.framebufferLayout = framebufferLayout; renderPassDesc.renderTargetCount = 1; - IRenderPassLayout::AttachmentAccessDesc renderTargetAccess = {}; - renderTargetAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Clear; - renderTargetAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + IRenderPassLayout::TargetAccessDesc renderTargetAccess = {}; + renderTargetAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear; + renderTargetAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; renderTargetAccess.initialState = getDefaultResourceStateForViewType(viewType); renderTargetAccess.finalState = ResourceState::ResolveSource; renderPassDesc.renderTargetAccess = &renderTargetAccess; diff --git a/tools/gfx/d3d11/render-d3d11.cpp b/tools/gfx/d3d11/render-d3d11.cpp index 2aae21a6d..ee95d269f 100644 --- a/tools/gfx/d3d11/render-d3d11.cpp +++ b/tools/gfx/d3d11/render-d3d11.cpp @@ -308,9 +308,9 @@ protected: class FramebufferLayoutImpl : public FramebufferLayoutBase { public: - ShortList<IFramebufferLayout::AttachmentLayout> m_renderTargets; + ShortList<IFramebufferLayout::TargetLayout> m_renderTargets; bool m_hasDepthStencil = false; - IFramebufferLayout::AttachmentLayout m_depthStencil; + IFramebufferLayout::TargetLayout m_depthStencil; }; class FramebufferImpl : public FramebufferBase diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp index e6168f17c..2506c3b63 100644 --- a/tools/gfx/d3d12/render-d3d12.cpp +++ b/tools/gfx/d3d12/render-d3d12.cpp @@ -7194,7 +7194,7 @@ void RenderCommandEncoderImpl::init( } } // Clear. - if (access.loadOp == IRenderPassLayout::AttachmentLoadOp::Clear) + if (access.loadOp == IRenderPassLayout::TargetLoadOp::Clear) { m_d3dCmdList->ClearRenderTargetView( framebuffer->renderTargetDescriptors[i], @@ -7227,12 +7227,12 @@ void RenderCommandEncoderImpl::init( } // Clear. uint32_t clearFlags = 0; - if (renderPass->m_depthStencilAccess.loadOp == IRenderPassLayout::AttachmentLoadOp::Clear) + if (renderPass->m_depthStencilAccess.loadOp == IRenderPassLayout::TargetLoadOp::Clear) { clearFlags |= D3D12_CLEAR_FLAG_DEPTH; } if (renderPass->m_depthStencilAccess.stencilLoadOp == - IRenderPassLayout::AttachmentLoadOp::Clear) + IRenderPassLayout::TargetLoadOp::Clear) { clearFlags |= D3D12_CLEAR_FLAG_STENCIL; } diff --git a/tools/gfx/d3d12/render-d3d12.h b/tools/gfx/d3d12/render-d3d12.h index c8def3217..95a982104 100644 --- a/tools/gfx/d3d12/render-d3d12.h +++ b/tools/gfx/d3d12/render-d3d12.h @@ -357,9 +357,9 @@ public: class FramebufferLayoutImpl : public FramebufferLayoutBase { public: - ShortList<IFramebufferLayout::AttachmentLayout> m_renderTargets; + ShortList<IFramebufferLayout::TargetLayout> m_renderTargets; bool m_hasDepthStencil = false; - IFramebufferLayout::AttachmentLayout m_depthStencil; + IFramebufferLayout::TargetLayout m_depthStencil; }; class FramebufferImpl : public FramebufferBase diff --git a/tools/gfx/immediate-renderer-base.cpp b/tools/gfx/immediate-renderer-base.cpp index 11b09db29..c598a3a67 100644 --- a/tools/gfx/immediate-renderer-base.cpp +++ b/tools/gfx/immediate-renderer-base.cpp @@ -256,7 +256,7 @@ public: { auto& access = renderPass->m_renderTargetAccesses[i]; // Clear. - if (access.loadOp == IRenderPassLayout::AttachmentLoadOp::Clear) + if (access.loadOp == IRenderPassLayout::TargetLoadOp::Clear) { clearMask |= (1 << (uint32_t)i); } @@ -267,12 +267,12 @@ public: { // Clear. if (renderPass->m_depthStencilAccess.loadOp == - IRenderPassLayout::AttachmentLoadOp::Clear) + IRenderPassLayout::TargetLoadOp::Clear) { clearDepth = true; } if (renderPass->m_depthStencilAccess.stencilLoadOp == - IRenderPassLayout::AttachmentLoadOp::Clear) + IRenderPassLayout::TargetLoadOp::Clear) { clearStencil = true; } diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp index 8c596cebb..0cf05e665 100644 --- a/tools/gfx/open-gl/render-gl.cpp +++ b/tools/gfx/open-gl/render-gl.cpp @@ -362,9 +362,9 @@ public: class FramebufferLayoutImpl : public FramebufferLayoutBase { public: - ShortList<IFramebufferLayout::AttachmentLayout> m_renderTargets; + ShortList<IFramebufferLayout::TargetLayout> m_renderTargets; bool m_hasDepthStencil = false; - IFramebufferLayout::AttachmentLayout m_depthStencil; + IFramebufferLayout::TargetLayout m_depthStencil; }; class FramebufferImpl : public FramebufferBase diff --git a/tools/gfx/simple-render-pass-layout.h b/tools/gfx/simple-render-pass-layout.h index 14fffe37f..ae3ef1166 100644 --- a/tools/gfx/simple-render-pass-layout.h +++ b/tools/gfx/simple-render-pass-layout.h @@ -21,8 +21,8 @@ public: IRenderPassLayout* getInterface(const Slang::Guid& guid); public: - Slang::ShortList<AttachmentAccessDesc> m_renderTargetAccesses; - AttachmentAccessDesc m_depthStencilAccess; + Slang::ShortList<TargetAccessDesc> m_renderTargetAccesses; + TargetAccessDesc m_depthStencilAccess; bool m_hasDepthStencil; void init(const IRenderPassLayout::Desc& desc); }; diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index ccf76dd88..acc22af02 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -48,24 +48,24 @@ size_t calcNumRows(Format format, int height) gfxGetFormatInfo(format, &sizeInfo); return (size_t)(height + sizeInfo.blockHeight - 1) / sizeInfo.blockHeight; } -VkAttachmentLoadOp translateLoadOp(IRenderPassLayout::AttachmentLoadOp loadOp) +VkAttachmentLoadOp translateLoadOp(IRenderPassLayout::TargetLoadOp loadOp) { switch (loadOp) { - case IRenderPassLayout::AttachmentLoadOp::Clear: + case IRenderPassLayout::TargetLoadOp::Clear: return VK_ATTACHMENT_LOAD_OP_CLEAR; - case IRenderPassLayout::AttachmentLoadOp::Load: + case IRenderPassLayout::TargetLoadOp::Load: return VK_ATTACHMENT_LOAD_OP_LOAD; default: return VK_ATTACHMENT_LOAD_OP_DONT_CARE; } } -VkAttachmentStoreOp translateStoreOp(IRenderPassLayout::AttachmentStoreOp storeOp) +VkAttachmentStoreOp translateStoreOp(IRenderPassLayout::TargetStoreOp storeOp) { switch (storeOp) { - case IRenderPassLayout::AttachmentStoreOp::Store: + case IRenderPassLayout::TargetStoreOp::Store: return VK_ATTACHMENT_STORE_OP_STORE; default: return VK_ATTACHMENT_STORE_OP_DONT_CARE; @@ -2999,18 +2999,18 @@ Result FramebufferLayoutImpl::init(DeviceImpl* renderer, const IFramebufferLayou m_renderer = renderer; m_renderTargetCount = desc.renderTargetCount; // Create render pass. - int numAttachments = m_renderTargetCount; - m_hasDepthStencilAttachment = (desc.depthStencil != nullptr); - if (m_hasDepthStencilAttachment) + int numTargets = m_renderTargetCount; + m_hasDepthStencilTarget = (desc.depthStencil != nullptr); + if (m_hasDepthStencilTarget) { - numAttachments++; + numTargets++; } // We need extra space if we have depth buffer - m_attachmentDescs.setCount(numAttachments); + m_targetDescs.setCount(numTargets); for (GfxIndex i = 0; i < desc.renderTargetCount; ++i) { auto& renderTarget = desc.renderTargets[i]; - VkAttachmentDescription& dst = m_attachmentDescs[i]; + VkAttachmentDescription& dst = m_targetDescs[i]; dst.flags = 0; dst.format = VulkanUtil::getVkFormat(renderTarget.format); @@ -3035,7 +3035,7 @@ Result FramebufferLayoutImpl::init(DeviceImpl* renderer, const IFramebufferLayou if (desc.depthStencil) { - VkAttachmentDescription& dst = m_attachmentDescs[desc.renderTargetCount]; + VkAttachmentDescription& dst = m_targetDescs[desc.renderTargetCount]; dst.flags = 0; dst.format = VulkanUtil::getVkFormat(desc.depthStencil->format); dst.samples = (VkSampleCountFlagBits)desc.depthStencil->sampleCount; @@ -3070,14 +3070,14 @@ Result FramebufferLayoutImpl::init(DeviceImpl* renderer, const IFramebufferLayou subpassDesc.colorAttachmentCount = desc.renderTargetCount; subpassDesc.pColorAttachments = colorReferences.getBuffer(); subpassDesc.pResolveAttachments = nullptr; - subpassDesc.pDepthStencilAttachment = m_hasDepthStencilAttachment ? &m_depthReference : nullptr; + subpassDesc.pDepthStencilAttachment = m_hasDepthStencilTarget ? &m_depthReference : nullptr; subpassDesc.preserveAttachmentCount = 0u; subpassDesc.pPreserveAttachments = nullptr; VkRenderPassCreateInfo renderPassCreateInfo = {}; renderPassCreateInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; - renderPassCreateInfo.attachmentCount = numAttachments; - renderPassCreateInfo.pAttachments = m_attachmentDescs.getBuffer(); + renderPassCreateInfo.attachmentCount = numTargets; + renderPassCreateInfo.pAttachments = m_targetDescs.getBuffer(); renderPassCreateInfo.subpassCount = 1; renderPassCreateInfo.pSubpasses = &subpassDesc; SLANG_VK_RETURN_ON_FAIL(m_renderer->m_api.vkCreateRenderPass( @@ -3106,11 +3106,11 @@ Result RenderPassLayoutImpl::init(DeviceImpl* renderer, const IRenderPassLayout: assert(desc.renderTargetCount == framebufferLayout->m_renderTargetCount); // We need extra space if we have depth buffer - Array<VkAttachmentDescription, kMaxAttachments> attachmentDescs; - attachmentDescs = framebufferLayout->m_attachmentDescs; + Array<VkAttachmentDescription, kMaxTargets> targetDescs; + targetDescs = framebufferLayout->m_targetDescs; for (GfxIndex i = 0; i < desc.renderTargetCount; ++i) { - VkAttachmentDescription& dst = attachmentDescs[i]; + VkAttachmentDescription& dst = targetDescs[i]; auto access = desc.renderTargetAccess[i]; // Fill in loadOp/storeOp and layout from desc. dst.loadOp = translateLoadOp(access.loadOp); @@ -3121,9 +3121,9 @@ Result RenderPassLayoutImpl::init(DeviceImpl* renderer, const IRenderPassLayout: dst.finalLayout = VulkanUtil::mapResourceStateToLayout(access.finalState); } - if (framebufferLayout->m_hasDepthStencilAttachment) + if (framebufferLayout->m_hasDepthStencilTarget) { - VkAttachmentDescription& dst = attachmentDescs[desc.renderTargetCount]; + VkAttachmentDescription& dst = targetDescs[desc.renderTargetCount]; auto access = *desc.depthStencilAccess; dst.loadOp = translateLoadOp(access.loadOp); dst.storeOp = translateStoreOp(access.storeOp); @@ -3141,7 +3141,7 @@ Result RenderPassLayoutImpl::init(DeviceImpl* renderer, const IRenderPassLayout: subpassDesc.colorAttachmentCount = desc.renderTargetCount; subpassDesc.pColorAttachments = framebufferLayout->m_colorReferences.getBuffer(); subpassDesc.pResolveAttachments = nullptr; - subpassDesc.pDepthStencilAttachment = framebufferLayout->m_hasDepthStencilAttachment + subpassDesc.pDepthStencilAttachment = framebufferLayout->m_hasDepthStencilTarget ? &framebufferLayout->m_depthReference : nullptr; subpassDesc.preserveAttachmentCount = 0u; @@ -3149,8 +3149,8 @@ Result RenderPassLayoutImpl::init(DeviceImpl* renderer, const IRenderPassLayout: VkRenderPassCreateInfo renderPassCreateInfo = {}; renderPassCreateInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; - renderPassCreateInfo.attachmentCount = (uint32_t)attachmentDescs.getCount(); - renderPassCreateInfo.pAttachments = attachmentDescs.getBuffer(); + renderPassCreateInfo.attachmentCount = (uint32_t)targetDescs.getCount(); + renderPassCreateInfo.pAttachments = targetDescs.getBuffer(); renderPassCreateInfo.subpassCount = 1; renderPassCreateInfo.pSubpasses = &subpassDesc; SLANG_VK_RETURN_ON_FAIL(m_renderer->m_api.vkCreateRenderPass( @@ -3201,11 +3201,11 @@ Result FramebufferImpl::init(DeviceImpl* renderer, const IFramebuffer::Desc& des if (layerCount == 0) layerCount = 1; // Create render pass. - int numAttachments = desc.renderTargetCount; + int numTargets = desc.renderTargetCount; if (desc.depthStencilView) - numAttachments++; - Array<VkImageView, kMaxAttachments> imageViews; - imageViews.setCount(numAttachments); + numTargets++; + Array<VkImageView, kMaxTargets> imageViews; + imageViews.setCount(numTargets); renderTargetViews.setCount(desc.renderTargetCount); for (GfxIndex i = 0; i < desc.renderTargetCount; ++i) { @@ -3233,7 +3233,7 @@ Result FramebufferImpl::init(DeviceImpl* renderer, const IFramebuffer::Desc& des VkFramebufferCreateInfo framebufferInfo = {}; framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; framebufferInfo.renderPass = m_layout->m_renderPass; - framebufferInfo.attachmentCount = numAttachments; + framebufferInfo.attachmentCount = numTargets; framebufferInfo.pAttachments = imageViews.getBuffer(); framebufferInfo.width = m_width; framebufferInfo.height = m_height; @@ -3463,16 +3463,16 @@ Result PipelineStateImpl::createVKGraphicsPipelineState() multisampling.alphaToOneEnable = VK_FALSE; auto targetCount = - Math::Min(framebufferLayoutImpl->m_renderTargetCount, (uint32_t)blendDesc.targetCount); - List<VkPipelineColorBlendAttachmentState> colorBlendAttachments; + GfxCount(Math::Min(framebufferLayoutImpl->m_renderTargetCount, (uint32_t)blendDesc.targetCount)); + List<VkPipelineColorBlendAttachmentState> colorBlendTargets; // Regardless of whether blending is enabled, Vulkan always applies the color write mask // operation, so if there is no blending then we need to add an attachment that defines // the color write mask to ensure colors are actually written. if (targetCount == 0) { - colorBlendAttachments.setCount(1); - auto& vkBlendDesc = colorBlendAttachments[0]; + colorBlendTargets.setCount(1); + auto& vkBlendDesc = colorBlendTargets[0]; memset(&vkBlendDesc, 0, sizeof(vkBlendDesc)); vkBlendDesc.blendEnable = VK_FALSE; vkBlendDesc.srcColorBlendFactor = VK_BLEND_FACTOR_ONE; @@ -3485,11 +3485,11 @@ Result PipelineStateImpl::createVKGraphicsPipelineState() } else { - colorBlendAttachments.setCount(targetCount); - for (UInt i = 0; i < targetCount; ++i) + colorBlendTargets.setCount(targetCount); + for (GfxIndex i = 0; i < targetCount; ++i) { auto& gfxBlendDesc = blendDesc.targets[i]; - auto& vkBlendDesc = colorBlendAttachments[i]; + auto& vkBlendDesc = colorBlendTargets[i]; vkBlendDesc.blendEnable = gfxBlendDesc.enableBlend; vkBlendDesc.srcColorBlendFactor = @@ -3511,8 +3511,8 @@ Result PipelineStateImpl::createVKGraphicsPipelineState() colorBlending.logicOpEnable = VK_FALSE; // TODO: D3D12 has per attachment logic op (and // both have way more than one op) colorBlending.logicOp = VK_LOGIC_OP_COPY; - colorBlending.attachmentCount = (uint32_t)colorBlendAttachments.getCount(); - colorBlending.pAttachments = colorBlendAttachments.getBuffer(); + colorBlending.attachmentCount = (uint32_t)colorBlendTargets.getCount(); + colorBlending.pAttachments = colorBlendTargets.getBuffer(); colorBlending.blendConstants[0] = 0.0f; colorBlending.blendConstants[1] = 0.0f; colorBlending.blendConstants[2] = 0.0f; @@ -7166,15 +7166,15 @@ void RenderCommandEncoder::beginPass(IRenderPassLayout* renderPass, IFramebuffer if (!framebuffer) framebufferImpl = this->m_device->m_emptyFramebuffer; RenderPassLayoutImpl* renderPassImpl = static_cast<RenderPassLayoutImpl*>(renderPass); - VkClearValue clearValues[kMaxAttachments] = {}; + VkClearValue clearValues[kMaxTargets] = {}; VkRenderPassBeginInfo beginInfo = {}; beginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; beginInfo.framebuffer = framebufferImpl->m_handle; beginInfo.renderPass = renderPassImpl->m_renderPass; - uint32_t attachmentCount = (uint32_t)framebufferImpl->renderTargetViews.getCount(); + uint32_t targetCount = (uint32_t)framebufferImpl->renderTargetViews.getCount(); if (framebufferImpl->depthStencilView) - attachmentCount++; - beginInfo.clearValueCount = attachmentCount; + targetCount++; + beginInfo.clearValueCount = targetCount; beginInfo.renderArea.extent.width = framebufferImpl->m_width; beginInfo.renderArea.extent.height = framebufferImpl->m_height; beginInfo.pClearValues = framebufferImpl->m_clearValues; diff --git a/tools/gfx/vulkan/render-vk.h b/tools/gfx/vulkan/render-vk.h index 091a490f2..646c3eb98 100644 --- a/tools/gfx/vulkan/render-vk.h +++ b/tools/gfx/vulkan/render-vk.h @@ -19,7 +19,7 @@ using namespace Slang; enum { kMaxRenderTargets = 8, - kMaxAttachments = kMaxRenderTargets + 1, + kMaxTargets = kMaxRenderTargets + 1, kMaxPushConstantSize = 256, kMaxDescriptorSets = 8, }; @@ -411,10 +411,10 @@ class FramebufferLayoutImpl : public FramebufferLayoutBase public: VkRenderPass m_renderPass; DeviceImpl* m_renderer; - Array<VkAttachmentDescription, kMaxAttachments> m_attachmentDescs; + Array<VkAttachmentDescription, kMaxTargets> m_targetDescs; Array<VkAttachmentReference, kMaxRenderTargets> m_colorReferences; VkAttachmentReference m_depthReference; - bool m_hasDepthStencilAttachment; + bool m_hasDepthStencilTarget; uint32_t m_renderTargetCount; VkSampleCountFlagBits m_sampleCount = VK_SAMPLE_COUNT_1_BIT; @@ -448,7 +448,7 @@ public: uint32_t m_width; uint32_t m_height; BreakableReference<DeviceImpl> m_renderer; - VkClearValue m_clearValues[kMaxAttachments]; + VkClearValue m_clearValues[kMaxTargets]; RefPtr<FramebufferLayoutImpl> m_layout; public: diff --git a/tools/platform/gui.cpp b/tools/platform/gui.cpp index a26e79be1..8bfff2d11 100644 --- a/tools/platform/gui.cpp +++ b/tools/platform/gui.cpp @@ -174,12 +174,12 @@ GUI::GUI( { IRenderPassLayout::Desc desc; desc.framebufferLayout = framebufferLayout; - IRenderPassLayout::AttachmentAccessDesc colorAccess; + IRenderPassLayout::TargetAccessDesc colorAccess; desc.depthStencilAccess = nullptr; colorAccess.initialState = ResourceState::Present; colorAccess.finalState = ResourceState::Present; - colorAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Load; - colorAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + colorAccess.loadOp = IRenderPassLayout::TargetLoadOp::Load; + colorAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; desc.renderTargetAccess = &colorAccess; desc.renderTargetCount = 1; renderPass = device->createRenderPassLayout(desc); diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 1e3caf781..332ba89ff 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -640,12 +640,12 @@ void RenderTestApp::_initializeRenderPass() ComPtr<gfx::IResourceView> dsv = m_device->createTextureView(depthBufferResource.get(), depthBufferViewDesc); - IFramebufferLayout::AttachmentLayout colorAttachment = {gfx::Format::R8G8B8A8_UNORM, 1}; - IFramebufferLayout::AttachmentLayout depthAttachment = {gfx::Format::D32_FLOAT, 1}; + IFramebufferLayout::TargetLayout colorTarget = {gfx::Format::R8G8B8A8_UNORM, 1}; + IFramebufferLayout::TargetLayout depthTarget = {gfx::Format::D32_FLOAT, 1}; gfx::IFramebufferLayout::Desc framebufferLayoutDesc; framebufferLayoutDesc.renderTargetCount = 1; - framebufferLayoutDesc.renderTargets = &colorAttachment; - framebufferLayoutDesc.depthStencil = &depthAttachment; + framebufferLayoutDesc.renderTargets = &colorTarget; + framebufferLayoutDesc.depthStencil = &depthTarget; m_device->createFramebufferLayout(framebufferLayoutDesc, m_framebufferLayout.writeRef()); gfx::IFramebuffer::Desc framebufferDesc; @@ -658,14 +658,14 @@ void RenderTestApp::_initializeRenderPass() IRenderPassLayout::Desc renderPassDesc = {}; renderPassDesc.framebufferLayout = m_framebufferLayout; renderPassDesc.renderTargetCount = 1; - IRenderPassLayout::AttachmentAccessDesc renderTargetAccess = {}; - IRenderPassLayout::AttachmentAccessDesc depthStencilAccess = {}; - renderTargetAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Clear; - renderTargetAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + IRenderPassLayout::TargetAccessDesc renderTargetAccess = {}; + IRenderPassLayout::TargetAccessDesc depthStencilAccess = {}; + renderTargetAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear; + renderTargetAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; renderTargetAccess.initialState = ResourceState::Undefined; renderTargetAccess.finalState = ResourceState::RenderTarget; - depthStencilAccess.loadOp = IRenderPassLayout::AttachmentLoadOp::Clear; - depthStencilAccess.storeOp = IRenderPassLayout::AttachmentStoreOp::Store; + depthStencilAccess.loadOp = IRenderPassLayout::TargetLoadOp::Clear; + depthStencilAccess.storeOp = IRenderPassLayout::TargetStoreOp::Store; depthStencilAccess.initialState = ResourceState::Undefined; depthStencilAccess.finalState = ResourceState::DepthWrite; renderPassDesc.renderTargetAccess = &renderTargetAccess; |
