mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Flush state caches after command list is destroyed
When state base address tracking is enabled and command list use private heaps then command list at destroy time must calls all compute CSRs that were using that heap to invalidate state caches. This allows new command list to reuse the same heap allocation for different surface states, so before new use cached states are invalidated. Related-To: NEO-5055 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
820a189c52
commit
6437c1a91e
@@ -93,6 +93,7 @@ class CommandStreamReceiver {
|
||||
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
|
||||
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) = 0;
|
||||
virtual CompletionStamp flushBcsTask(LinearStream &commandStream, size_t commandStreamStart, const DispatchBcsFlags &dispatchBcsFlags, const HardwareInfo &hwInfo) = 0;
|
||||
virtual SubmissionStatus sendRenderStateCacheFlush() = 0;
|
||||
|
||||
virtual bool flushBatchedSubmissions() = 0;
|
||||
MOCKABLE_VIRTUAL SubmissionStatus submitBatchBuffer(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
||||
|
||||
@@ -100,10 +100,11 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
|
||||
SubmissionStatus flushTagUpdate() override;
|
||||
SubmissionStatus flushMiFlushDW();
|
||||
SubmissionStatus flushPipeControl();
|
||||
SubmissionStatus flushPipeControl(bool stateCacheFlush);
|
||||
SubmissionStatus flushSmallTask(LinearStream &commandStreamTask,
|
||||
size_t commandStreamStartTask);
|
||||
SubmissionStatus flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
||||
SubmissionStatus sendRenderStateCacheFlush() override;
|
||||
|
||||
bool isUpdateTagFromWaitEnabled() override;
|
||||
void updateTagFromWait() override;
|
||||
|
||||
@@ -1365,7 +1365,7 @@ inline SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushTagUpdate() {
|
||||
if (EngineHelpers::isBcs(this->osContext->getEngineType())) {
|
||||
return this->flushMiFlushDW();
|
||||
} else {
|
||||
return this->flushPipeControl();
|
||||
return this->flushPipeControl(false);
|
||||
}
|
||||
}
|
||||
return SubmissionStatus::DEVICE_UNINITIALIZED;
|
||||
@@ -1393,7 +1393,7 @@ inline SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushMiFlushDW() {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushPipeControl() {
|
||||
SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushPipeControl(bool stateCacheFlush) {
|
||||
auto lock = obtainUniqueOwnership();
|
||||
|
||||
PipeControlArgs args;
|
||||
@@ -1401,6 +1401,12 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushPipeControl() {
|
||||
args.notifyEnable = isUsedNotifyEnableForPostSync();
|
||||
args.workloadPartitionOffset = isMultiTileOperationEnabled();
|
||||
|
||||
if (stateCacheFlush) {
|
||||
args.textureCacheInvalidationEnable = true;
|
||||
args.renderTargetCacheFlushEnable = true;
|
||||
args.stateCacheInvalidationEnable = true;
|
||||
}
|
||||
|
||||
auto dispatchSize = MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(peekRootDeviceEnvironment(), args.tlbInvalidation) + this->getCmdSizeForPrologue();
|
||||
|
||||
auto &commandStream = getCS(dispatchSize);
|
||||
@@ -1454,6 +1460,11 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushSmallTask(LinearStream
|
||||
return submissionStatus;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
SubmissionStatus CommandStreamReceiverHw<GfxFamily>::sendRenderStateCacheFlush() {
|
||||
return this->flushPipeControl(true);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
||||
auto status = flush(batchBuffer, allocationsForResidency);
|
||||
|
||||
Reference in New Issue
Block a user