mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Set compression format for AUX_MCS_LCE mode
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
26d2c29e27
commit
2bf08aaa67
@ -663,3 +663,24 @@ HWTEST2_F(XeHPAndLaterImageHelperTests, givenNotMediaCompressedImageWhenAppendin
|
||||
EXPECT_EQ(expectedGetSurfaceStateCompressionFormatCalled, gmmClientContext->getSurfaceStateCompressionFormatCalled);
|
||||
EXPECT_EQ(expectedGetMediaSurfaceStateCompressionFormatCalled, gmmClientContext->getMediaSurfaceStateCompressionFormatCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(XeHPAndLaterImageHelperTests, givenAuxModeMcsLceWhenAppendingSurfaceStateParamsForCompressionThenCallAppriopriateFunction, CompressionParamsSupportedMatcher) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
RENDER_SURFACE_STATE rss{};
|
||||
platformsImpl->clear();
|
||||
rss.setMemoryCompressionEnable(false);
|
||||
rss.setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE);
|
||||
mockGmmResourceInfo->getResourceFlags()->Info.MediaCompressed = true;
|
||||
gmmClientContext->compressionFormatToReturn = mockCompressionFormat;
|
||||
const auto expectedGetSurfaceStateCompressionFormatCalled = gmmClientContext->getSurfaceStateCompressionFormatCalled;
|
||||
const auto expectedGetMediaSurfaceStateCompressionFormatCalled = gmmClientContext->getMediaSurfaceStateCompressionFormatCalled + 1;
|
||||
|
||||
EncodeSurfaceState<FamilyType>::appendImageCompressionParams(&rss, image->getMultiGraphicsAllocation().getDefaultGraphicsAllocation(),
|
||||
context->getDevice(0)->getGmmHelper(), false);
|
||||
|
||||
EXPECT_EQ(platform(), nullptr);
|
||||
EXPECT_EQ(mockCompressionFormat, rss.getCompressionFormat());
|
||||
EXPECT_EQ(expectedGetSurfaceStateCompressionFormatCalled, gmmClientContext->getSurfaceStateCompressionFormatCalled);
|
||||
EXPECT_EQ(expectedGetMediaSurfaceStateCompressionFormatCalled, gmmClientContext->getMediaSurfaceStateCompressionFormatCalled);
|
||||
}
|
@ -13,7 +13,8 @@ namespace NEO {
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *surfaceState, GraphicsAllocation *allocation, GmmHelper *gmmHelper, bool imageFromBuffer) {
|
||||
const auto ccsMode = R_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E;
|
||||
if ((ccsMode == surfaceState->getAuxiliarySurfaceMode() || surfaceState->getMemoryCompressionEnable())) {
|
||||
const auto mcsLceMode = R_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE;
|
||||
if ((ccsMode == surfaceState->getAuxiliarySurfaceMode() || mcsLceMode == surfaceState->getAuxiliarySurfaceMode() || surfaceState->getMemoryCompressionEnable())) {
|
||||
uint8_t compressionFormat;
|
||||
auto gmmResourceInfo = allocation->getDefaultGmm()->gmmResourceInfo.get();
|
||||
if (gmmResourceInfo->getResourceFlags()->Info.MediaCompressed) {
|
||||
|
Reference in New Issue
Block a user