Our copies as draws have the same bug on amd as normal bugs where we need
to start a new command buffer before binding a pipeline to it.
Bug: skia:
Change-Id: If9cade2e069bf09758c5328bf606c9bd5b5aab9c
Reviewed-on: https://skia-review.googlesource.com/17213
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
fSupportsCopiesAsDraws = false;
fMustSubmitCommandsBeforeCopyOp = false;
fMustSleepOnTearDown = false;
fSupportsCopiesAsDraws = false;
fMustSubmitCommandsBeforeCopyOp = false;
fMustSleepOnTearDown = false;
- fNewSecondaryCBOnPipelineChange = false;
+ fNewCBOnPipelineChange = false;
/**************************************************************************
* GrDrawTargetCaps fields
/**************************************************************************
* 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) {
// 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;
}
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 fMustSleepOnTearDown;
- bool fNewSecondaryCBOnPipelineChange;
+ bool fNewCBOnPipelineChange;
typedef GrCaps INHERITED;
};
typedef GrCaps INHERITED;
};
+ 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;
GrVkRenderTarget* rt = static_cast<GrVkRenderTarget*>(dst->asRenderTarget());
if (!rt) {
return false;
if (!cbInfo.fIsEmpty &&
fLastPipelineState && fLastPipelineState != pipelineState.get() &&
if (!cbInfo.fIsEmpty &&
fLastPipelineState && fLastPipelineState != pipelineState.get() &&
- fGpu->vkCaps().newSecondaryCBOnPipelineChange()) {
+ fGpu->vkCaps().newCBOnPipelineChange()) {
this->addAdditionalCommandBuffer();
}
fLastPipelineState = pipelineState.get();
this->addAdditionalCommandBuffer();
}
fLastPipelineState = pipelineState.get();