Fixes from PR code review.

Inline MVKRenderSubpass::hasDepthStencilAttachment() and fix minor comment typo.
This commit is contained in:
Bill Hollings 2021-07-26 16:51:58 -04:00
parent 293c049a16
commit 0de4cafb72
3 changed files with 2 additions and 6 deletions

View File

@ -1452,7 +1452,7 @@ void MVKGraphicsPipeline::addFragmentOutputToPipeline(MTLRenderPipelineDescripto
: mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(pCreateInfo->pInputAssemblyState->topology);
}
// Color attachments - must ignore bad pColorBlendState pointer if rasterization is disable or subpass has not color attachments
// Color attachments - must ignore bad pColorBlendState pointer if rasterization is disabled or subpass has no color attachments
uint32_t caCnt = 0;
if (_isRasterizingColor && pCreateInfo->pColorBlendState) {
for (uint32_t caIdx = 0; caIdx < pCreateInfo->pColorBlendState->attachmentCount; caIdx++) {

View File

@ -56,7 +56,7 @@ public:
bool hasColorAttachments();
/** Returns whether this subpass has a depth/stencil attachment. */
bool hasDepthStencilAttachment();
bool hasDepthStencilAttachment() { return _depthStencilAttachment.attachment != VK_ATTACHMENT_UNUSED; }
/** Returns the number of color attachments, which may be zero for depth-only rendering. */
uint32_t getColorAttachmentCount() { return uint32_t(_colorAttachments.size()); }

View File

@ -42,10 +42,6 @@ bool MVKRenderSubpass::hasColorAttachments() {
return false;
}
bool MVKRenderSubpass::hasDepthStencilAttachment() {
return _depthStencilAttachment.attachment != VK_ATTACHMENT_UNUSED;
}
VkFormat MVKRenderSubpass::getColorAttachmentFormat(uint32_t colorAttIdx) {
if (colorAttIdx < _colorAttachments.size()) {
uint32_t rpAttIdx = _colorAttachments[colorAttIdx].attachment;