Add MVKCmdBeginRenderPass template specializations for 2 framebuffer attachments.
This commit is contained in:
parent
d402a3265f
commit
6fe4cc5e13
@ -89,9 +89,13 @@ typedef MVKCmdBeginRenderPass<1, 1> MVKCmdBeginRenderPass11;
|
||||
typedef MVKCmdBeginRenderPass<2, 1> MVKCmdBeginRenderPass21;
|
||||
typedef MVKCmdBeginRenderPass<9, 1> MVKCmdBeginRenderPassMulti1;
|
||||
|
||||
typedef MVKCmdBeginRenderPass<1, 8> MVKCmdBeginRenderPass1Multi;
|
||||
typedef MVKCmdBeginRenderPass<2, 8> MVKCmdBeginRenderPass2Multi;
|
||||
typedef MVKCmdBeginRenderPass<9, 8> MVKCmdBeginRenderPassMultiMulti;
|
||||
typedef MVKCmdBeginRenderPass<1, 2> MVKCmdBeginRenderPass12;
|
||||
typedef MVKCmdBeginRenderPass<2, 2> MVKCmdBeginRenderPass22;
|
||||
typedef MVKCmdBeginRenderPass<9, 2> MVKCmdBeginRenderPassMulti2;
|
||||
|
||||
typedef MVKCmdBeginRenderPass<1, 9> MVKCmdBeginRenderPass1Multi;
|
||||
typedef MVKCmdBeginRenderPass<2, 9> MVKCmdBeginRenderPass2Multi;
|
||||
typedef MVKCmdBeginRenderPass<9, 9> MVKCmdBeginRenderPassMultiMulti;
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
@ -111,10 +111,13 @@ template class MVKCmdBeginRenderPass<1, 1>;
|
||||
template class MVKCmdBeginRenderPass<2, 1>;
|
||||
template class MVKCmdBeginRenderPass<9, 1>;
|
||||
|
||||
template class MVKCmdBeginRenderPass<1, 8>;
|
||||
template class MVKCmdBeginRenderPass<2, 8>;
|
||||
template class MVKCmdBeginRenderPass<9, 8>;
|
||||
template class MVKCmdBeginRenderPass<1, 2>;
|
||||
template class MVKCmdBeginRenderPass<2, 2>;
|
||||
template class MVKCmdBeginRenderPass<9, 2>;
|
||||
|
||||
template class MVKCmdBeginRenderPass<1, 9>;
|
||||
template class MVKCmdBeginRenderPass<2, 9>;
|
||||
template class MVKCmdBeginRenderPass<9, 9>;
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark MVKCmdNextSubpass
|
||||
|
@ -568,6 +568,8 @@ void MVKCommandEncoder::endRenderpass() {
|
||||
endMetalRenderEncoding();
|
||||
|
||||
_renderPass = nullptr;
|
||||
_framebufferExtent = {};
|
||||
_framebufferLayerCount = 0;
|
||||
_attachments.clear();
|
||||
_renderSubpassIndex = 0;
|
||||
}
|
||||
|
@ -56,21 +56,26 @@
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##threshold3) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##Multi)
|
||||
|
||||
#define MVK_CMD_TYPE_POOLS_FROM_4_THRESHOLDS(cmdType, arg1Threshold1, arg1Threshold2, arg2Threshold1, arg2Threshold2) \
|
||||
#define MVK_CMD_TYPE_POOLS_FROM_5_THRESHOLDS(cmdType, \
|
||||
arg1Threshold1, arg1Threshold2, \
|
||||
arg2Threshold1, arg2Threshold2, arg2Threshold3) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold1 ##arg2Threshold1) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold1 ##arg2Threshold2) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold1 ##arg2Threshold3) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold1 ##Multi) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold2 ##arg2Threshold1) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold2 ##arg2Threshold2) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold2 ##arg2Threshold3) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##arg1Threshold2 ##Multi) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##Multi ##arg2Threshold1) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##Multi ##arg2Threshold2) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##Multi ##arg2Threshold3) \
|
||||
MVK_TMPLT_DECL MVK_CMD_TYPE_POOL(cmdType ##Multi ##Multi)
|
||||
|
||||
MVK_CMD_TYPE_POOLS_FROM_2_THRESHOLDS(PipelineBarrier, 1, 4)
|
||||
MVK_CMD_TYPE_POOL(BindGraphicsPipeline)
|
||||
MVK_CMD_TYPE_POOL(BindComputePipeline)
|
||||
MVK_CMD_TYPE_POOLS_FROM_4_THRESHOLDS(BeginRenderPass, 1, 2, 0, 1)
|
||||
MVK_CMD_TYPE_POOLS_FROM_5_THRESHOLDS(BeginRenderPass, 1, 2, 0, 1, 2)
|
||||
MVK_CMD_TYPE_POOL(NextSubpass)
|
||||
MVK_CMD_TYPE_POOL(EndRenderPass)
|
||||
MVK_CMD_TYPE_POOLS_FROM_THRESHOLD(ExecuteCommands, 1)
|
||||
|
@ -132,8 +132,9 @@ static inline void MVKTraceVulkanCallEndImpl(const char* funcName, uint64_t star
|
||||
}
|
||||
|
||||
// Add one of nine commands, based on comparing a command parameter against four threshold values
|
||||
#define MVKAddCmdFrom4Thresholds(baseCmdType, value1, arg1Threshold1, arg1Threshold2, \
|
||||
value2, arg2Threshold1, arg2Threshold2, vkCmdBuff, ...) \
|
||||
#define MVKAddCmdFrom5Thresholds(baseCmdType, value1, arg1Threshold1, arg1Threshold2, \
|
||||
value2, arg2Threshold1, arg2Threshold2, arg2Threshold3, \
|
||||
vkCmdBuff, ...) \
|
||||
if (value1 <= arg1Threshold1 && value2 <= arg2Threshold1) { \
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold1 ##arg2Threshold1, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 <= arg1Threshold2 && value2 <= arg2Threshold1) { \
|
||||
@ -146,9 +147,15 @@ static inline void MVKTraceVulkanCallEndImpl(const char* funcName, uint64_t star
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold2 ##arg2Threshold2, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 > arg1Threshold2 && value2 <= arg2Threshold2) { \
|
||||
MVKAddCmd(baseCmdType ##Multi ##arg2Threshold2, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 <= arg1Threshold1 && value2 > arg2Threshold2) { \
|
||||
} else if (value1 <= arg1Threshold1 && value2 <= arg2Threshold3) { \
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold1 ##arg2Threshold3, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 <= arg1Threshold2 && value2 <= arg2Threshold3) { \
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold2 ##arg2Threshold3, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 > arg1Threshold2 && value2 <= arg2Threshold3) { \
|
||||
MVKAddCmd(baseCmdType ##Multi ##arg2Threshold3, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 <= arg1Threshold1 && value2 > arg2Threshold3) { \
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold1 ##Multi, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else if (value1 <= arg1Threshold2 && value2 > arg2Threshold2) { \
|
||||
} else if (value1 <= arg1Threshold2 && value2 > arg2Threshold3) { \
|
||||
MVKAddCmd(baseCmdType ##arg1Threshold2 ##Multi, vkCmdBuff, ##__VA_ARGS__); \
|
||||
} else { \
|
||||
MVKAddCmd(baseCmdType ##Multi ##Multi, vkCmdBuff, ##__VA_ARGS__); \
|
||||
@ -1904,9 +1911,9 @@ MVK_PUBLIC_SYMBOL void vkCmdBeginRenderPass(
|
||||
break;
|
||||
}
|
||||
}
|
||||
MVKAddCmdFrom4Thresholds(BeginRenderPass,
|
||||
MVKAddCmdFrom5Thresholds(BeginRenderPass,
|
||||
pRenderPassBegin->clearValueCount, 1, 2,
|
||||
attachmentCount, 0, 1,
|
||||
attachmentCount, 0, 1, 2,
|
||||
commandBuffer,
|
||||
pRenderPassBegin,
|
||||
contents);
|
||||
@ -2335,9 +2342,9 @@ MVK_PUBLIC_SYMBOL void vkCmdBeginRenderPass2KHR(
|
||||
break;
|
||||
}
|
||||
}
|
||||
MVKAddCmdFrom4Thresholds(BeginRenderPass,
|
||||
MVKAddCmdFrom5Thresholds(BeginRenderPass,
|
||||
pRenderPassBegin->clearValueCount, 1, 2,
|
||||
attachmentCount, 0, 1,
|
||||
attachmentCount, 0, 1, 2,
|
||||
commandBuffer,
|
||||
pRenderPassBegin,
|
||||
pSubpassBeginInfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user