2018-01-23 20:40:37 +08:00
|
|
|
/*
|
2021-02-12 01:29:50 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-01-23 20:40:37 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-23 20:40:37 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-12-15 01:40:08 +08:00
|
|
|
#include "shared/test/common/test_macros/test.h"
|
|
|
|
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/fixtures/image_fixture.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
2020-02-23 05:50:57 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-01-23 20:40:37 +08:00
|
|
|
|
|
|
|
typedef ::testing::Test gen9ImageTests;
|
|
|
|
|
2020-10-14 16:12:00 +08:00
|
|
|
GEN9TEST_F(gen9ImageTests, appendSurfaceSWhenAppendingSurfaceStateParamsThenSurfaceStateDoesNotChangetateParamsDoesNothing) {
|
2018-01-23 20:40:37 +08:00
|
|
|
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
|
|
|
|
MockContext context;
|
|
|
|
auto image = std::unique_ptr<Image>(ImageHelper<Image1dDefaults>::create(&context));
|
2019-01-18 00:10:12 +08:00
|
|
|
auto surfaceStateBefore = FamilyType::cmdInitRenderSurfaceState;
|
|
|
|
auto surfaceStateAfter = FamilyType::cmdInitRenderSurfaceState;
|
2018-01-23 20:40:37 +08:00
|
|
|
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
|
|
|
|
|
|
|
EXPECT_EQ(0, memcmp(&surfaceStateBefore, &surfaceStateAfter, sizeof(RENDER_SURFACE_STATE)));
|
|
|
|
|
2021-02-12 01:29:50 +08:00
|
|
|
imageHw->appendSurfaceStateParams(&surfaceStateAfter, context.getDevice(0)->getRootDeviceIndex(), false);
|
2018-01-23 20:40:37 +08:00
|
|
|
|
|
|
|
EXPECT_EQ(0, memcmp(&surfaceStateBefore, &surfaceStateAfter, sizeof(RENDER_SURFACE_STATE)));
|
|
|
|
}
|