mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 20:13:04 +08:00
In gen/sku specific tests include only required files to reduce dependency on not related HW scpecific headers and improve build performance. This is achieved by reduce in usage of hw_test.h and related collateral, like shared/source/helpers/definitions/hw_cmds.h which can be replaced by sku specific hw_cmds_<sku>.h Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
45 lines
2.2 KiB
C++
45 lines
2.2 KiB
C++
/*
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
|
#include "shared/source/gen9/hw_cmds.h"
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
#include "shared/test/common/test_macros/test.h"
|
|
#include "shared/test/unit_test/image/image_surface_state_fixture.h"
|
|
|
|
using namespace NEO;
|
|
|
|
using ImageSurfaceStateTestsGen9 = ImageSurfaceStateTests;
|
|
|
|
GEN9TEST_F(ImageSurfaceStateTestsGen9, givenGmmWithMediaCompressedWhenSetFlagsForMediaCompressionThenAuxiliarySurfaceNoneIsSet) {
|
|
auto size = sizeof(typename FamilyType::RENDER_SURFACE_STATE);
|
|
auto surfaceState = std::make_unique<char[]>(size);
|
|
auto castSurfaceState = reinterpret_cast<typename FamilyType::RENDER_SURFACE_STATE *>(surfaceState.get());
|
|
castSurfaceState->setAuxiliarySurfaceMode(FamilyType::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
|
|
|
mockGmm->gmmResourceInfo->getResourceFlags()->Info.MediaCompressed = false;
|
|
EncodeSurfaceState<FamilyType>::setFlagsForMediaCompression(castSurfaceState, mockGmm.get());
|
|
EXPECT_EQ(castSurfaceState->getAuxiliarySurfaceMode(), FamilyType::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
|
mockGmm->gmmResourceInfo->getResourceFlags()->Info.MediaCompressed = true;
|
|
EncodeSurfaceState<FamilyType>::setFlagsForMediaCompression(castSurfaceState, mockGmm.get());
|
|
EXPECT_EQ(castSurfaceState->getAuxiliarySurfaceMode(), FamilyType::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
|
}
|
|
|
|
GEN9TEST_F(ImageSurfaceStateTestsGen9, givenGmmWithMediaCompressedWhenSetMipTailStartLodThenMipTailStartLodIsSet) {
|
|
auto size = sizeof(typename FamilyType::RENDER_SURFACE_STATE);
|
|
auto surfaceState = std::make_unique<char[]>(size);
|
|
auto castSurfaceState = reinterpret_cast<typename FamilyType::RENDER_SURFACE_STATE *>(surfaceState.get());
|
|
|
|
setMipTailStartLod<FamilyType>(castSurfaceState, nullptr);
|
|
|
|
EXPECT_EQ(castSurfaceState->getMipTailStartLod(), 0u);
|
|
|
|
setMipTailStartLod<FamilyType>(castSurfaceState, mockGmm.get());
|
|
|
|
EXPECT_EQ(castSurfaceState->getMipTailStartLod(), mockGmm->gmmResourceInfo->getMipTailStartLodSurfaceState());
|
|
}
|