waSamplerCacheFlushBetweenRedescribedSurfaceReads fix

Change-Id: Id322f58ce6997c8710ed2d8faf4f3c3f3d2ef0c3
This commit is contained in:
Jacek Danecki
2018-01-10 14:05:34 +01:00
parent e35a066f79
commit 73e2e72d07
24 changed files with 279 additions and 4 deletions

View File

@@ -254,6 +254,17 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "this->taskLevel", (uint32_t)this->taskLevel);
if (getMemoryManager()->device->getWaTable()->waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
if (this->samplerCacheFlushRequired != SamplerCacheFlushState::samplerCacheFlushNotRequired) {
auto pCmd = addPipeControlCmd(commandStreamCSR);
pCmd->setTextureCacheInvalidationEnable(true);
if (this->samplerCacheFlushRequired == SamplerCacheFlushState::samplerCacheFlushBefore) {
this->samplerCacheFlushRequired = SamplerCacheFlushState::samplerCacheFlushAfter;
} else {
this->samplerCacheFlushRequired = SamplerCacheFlushState::samplerCacheFlushNotRequired;
}
}
}
// Add a PC if we have a dependency on a previous walker to avoid concurrency issues.
if (taskLevel > this->taskLevel) {
//Some architectures (SKL) requires to have pipe control prior to pipe control with tag write, add it here
@@ -272,6 +283,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
pCmd->setConstantCacheInvalidationEnable(true);
pCmd->setStateCacheInvalidationEnable(true);
}
auto address = (uint64_t)this->getTagAddress();
pCmd->setAddressHigh(address >> 32);
pCmd->setAddress(address & (0xffffffff));
@@ -514,6 +526,11 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
size += getCmdSizeForMediaSampler(dispatchFlags.mediaSamplerRequired);
size += PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(dispatchFlags.preemptionMode, this->lastPreemptionMode);
if (getMemoryManager()->device->getWaTable()->waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
if (this->samplerCacheFlushRequired != SamplerCacheFlushState::samplerCacheFlushNotRequired) {
size += sizeof(typename GfxFamily::PIPE_CONTROL);
}
}
return size;
}