fSupportsCopiesAsDraws = false;
fMustSubmitCommandsBeforeCopyOp = false;
fMustSleepOnTearDown = false;
- fNewSecondaryCBOnPipelineChange = false;
+ fNewCBOnPipelineChange = false;
/**************************************************************************
* GrDrawTargetCaps fields
// AMD seems to have issues binding new VkPipelines inside a secondary command buffer.
// Current workaround is to use a different secondary command buffer for each new VkPipeline.
if (kAMD_VkVendor == properties.vendorID) {
- fNewSecondaryCBOnPipelineChange = true;
+ fNewCBOnPipelineChange = true;
}
}
return fMustSleepOnTearDown;
}
- // Returns true if while adding commands to secondary command buffers, we must make a new
- // secondary command buffer everytime we want to bind a new VkPipeline. This is to work around a
- // driver bug specifically on AMD.
- bool newSecondaryCBOnPipelineChange() const {
- return fNewSecondaryCBOnPipelineChange;
+ // Returns true if while adding commands to command buffers, we must make a new command buffer
+ // everytime we want to bind a new VkPipeline. This is true for both primary and secondary
+ // command buffers. This is to work around a driver bug specifically on AMD.
+ bool newCBOnPipelineChange() const {
+ return fNewCBOnPipelineChange;
}
/**
bool fMustSleepOnTearDown;
- bool fNewSecondaryCBOnPipelineChange;
+ bool fNewCBOnPipelineChange;
typedef GrCaps INHERITED;
};
return false;
}
+ if (gpu->vkCaps().newCBOnPipelineChange()) {
+ // We bind a new pipeline here for the copy so we must start a new command buffer.
+ gpu->finishFlush();
+ }
+
GrVkRenderTarget* rt = static_cast<GrVkRenderTarget*>(dst->asRenderTarget());
if (!rt) {
return false;
if (!cbInfo.fIsEmpty &&
fLastPipelineState && fLastPipelineState != pipelineState.get() &&
- fGpu->vkCaps().newSecondaryCBOnPipelineChange()) {
+ fGpu->vkCaps().newCBOnPipelineChange()) {
this->addAdditionalCommandBuffer();
}
fLastPipelineState = pipelineState.get();