mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: don't flush texture cache if not required
Related-To: NEO-14645 Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b423084861
commit
4d60465a9e
@@ -203,6 +203,8 @@ class GfxCoreHelper {
|
||||
virtual bool getSipBinaryFromExternalLib() const = 0;
|
||||
virtual uint32_t getImplicitArgsVersion() const = 0;
|
||||
|
||||
virtual bool isCacheFlushPriorImageReadRequired() const = 0;
|
||||
|
||||
virtual ~GfxCoreHelper() = default;
|
||||
|
||||
protected:
|
||||
@@ -450,6 +452,8 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
bool getSipBinaryFromExternalLib() const override;
|
||||
|
||||
bool isCacheFlushPriorImageReadRequired() const override;
|
||||
|
||||
~GfxCoreHelperHw() override = default;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -848,4 +848,9 @@ uint32_t GfxCoreHelperHw<Family>::getImplicitArgsVersion() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
bool GfxCoreHelperHw<Family>::isCacheFlushPriorImageReadRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -91,4 +91,9 @@ bool GfxCoreHelperHw<Family>::usmCompressionSupported(const NEO::HardwareInfo &h
|
||||
return hwInfo.capabilityTable.ftrRenderCompressedBuffers;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::isCacheFlushPriorImageReadRequired() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1932,3 +1932,8 @@ HWTEST_F(GfxCoreHelperTest, givenDebugFlagForceUseOnlyGlobalTimestampsSetWhenCal
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_TRUE(gfxCoreHelper.useOnlyGlobalTimestamps());
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, whenIsCacheFlushPriorImageReadRequiredCalledThenFalseIsReturned, IsBeforeXe2HpgCore) {
|
||||
auto &helper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_FALSE(helper.isCacheFlushPriorImageReadRequired());
|
||||
}
|
||||
@@ -106,3 +106,9 @@ HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenEncodeAdditionalT
|
||||
EXPECT_EQ(storeRegMem->getRegisterAddress(), RegisterOffsets::globalTimestampUn);
|
||||
EXPECT_EQ(storeRegMem->getMemoryAddress(), sndAddress + sizeof(uint32_t));
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenIsCacheFlushPriorImageReadRequiredThenTrueIsReturned, IsAtLeastXe2HpgCore) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
||||
EXPECT_TRUE(gfxCoreHelper.isCacheFlushPriorImageReadRequired());
|
||||
}
|
||||
Reference in New Issue
Block a user