Merge pull request #1079 from cdavis5e/indexed-non-indexed-tess-draw
MVKPipeline: Don't rely on the index buffer to tell apart indexed draws.
This commit is contained in:
commit
1831eb9f38
@ -108,6 +108,8 @@ void MVKCmdDraw::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
return;
|
||||
}
|
||||
|
||||
cmdEncoder->_isIndexedDraw = false;
|
||||
|
||||
auto* pipeline = (MVKGraphicsPipeline*)cmdEncoder->_graphicsPipelineState.getPipeline();
|
||||
|
||||
MVKPiplineStages stages;
|
||||
@ -302,6 +304,8 @@ void MVKCmdDrawIndexed::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
return;
|
||||
}
|
||||
|
||||
cmdEncoder->_isIndexedDraw = true;
|
||||
|
||||
auto* pipeline = (MVKGraphicsPipeline*)cmdEncoder->_graphicsPipelineState.getPipeline();
|
||||
|
||||
MVKPiplineStages stages;
|
||||
@ -510,6 +514,8 @@ static const uint32_t kMVKDrawIndirectVertexCountUpperBound = 131072;
|
||||
|
||||
void MVKCmdDrawIndirect::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
|
||||
cmdEncoder->_isIndexedDraw = false;
|
||||
|
||||
auto* pipeline = (MVKGraphicsPipeline*)cmdEncoder->_graphicsPipelineState.getPipeline();
|
||||
bool needsInstanceAdjustment = cmdEncoder->getSubpass()->isMultiview() &&
|
||||
cmdEncoder->getDevice()->getPhysicalDevice()->canUseInstancingForMultiview();
|
||||
@ -820,6 +826,8 @@ VkResult MVKCmdDrawIndexedIndirect::setContent(MVKCommandBuffer* cmdBuff,
|
||||
|
||||
void MVKCmdDrawIndexedIndirect::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
|
||||
cmdEncoder->_isIndexedDraw = true;
|
||||
|
||||
MVKIndexMTLBufferBinding& ibb = cmdEncoder->_graphicsResourcesState._mtlIndexBufferBinding;
|
||||
auto* pipeline = (MVKGraphicsPipeline*)cmdEncoder->_graphicsPipelineState.getPipeline();
|
||||
bool needsInstanceAdjustment = cmdEncoder->getSubpass()->isMultiview() &&
|
||||
|
@ -452,6 +452,9 @@ public:
|
||||
/** Indicates whether the current render subpass is able to render to an array (layered) framebuffer. */
|
||||
bool _canUseLayeredRendering;
|
||||
|
||||
/** Indicates whether the current draw is an indexed draw. */
|
||||
bool _isIndexedDraw;
|
||||
|
||||
|
||||
#pragma mark Construction
|
||||
|
||||
|
@ -207,7 +207,7 @@ void MVKGraphicsPipeline::encode(MVKCommandEncoder* cmdEncoder, uint32_t stage)
|
||||
|
||||
id<MTLComputePipelineState> plState;
|
||||
const MVKIndexMTLBufferBinding& indexBuff = cmdEncoder->_graphicsResourcesState._mtlIndexBufferBinding;
|
||||
if (!indexBuff.mtlBuffer) {
|
||||
if (!cmdEncoder->_isIndexedDraw) {
|
||||
plState = getTessVertexStageState();
|
||||
} else if (indexBuff.mtlIndexType == MTLIndexTypeUInt16) {
|
||||
plState = getTessVertexStageIndex16State();
|
||||
|
Loading…
x
Reference in New Issue
Block a user