mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Setup create function in redescribed image
Related-To: NEO-3691 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0ba4bf3c1e
commit
7a2d3d6369
@ -1079,6 +1079,7 @@ Image *Image::redescribe() {
|
||||
image->setQPitch(this->getQPitch());
|
||||
image->setCubeFaceIndex(this->getCubeFaceIndex());
|
||||
image->associatedMemObject = this->associatedMemObject;
|
||||
image->createFunction = createFunction;
|
||||
return image;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/image_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
@ -226,3 +227,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
testing::Combine(
|
||||
::testing::Range(readWriteSurfaceFormatsStart, SurfaceFormats::readWrite().size()),
|
||||
::testing::ValuesIn(ImageTypes)));
|
||||
|
||||
TEST(ImageRedescribeTestSimple, givenImageWhenItIsRedescribedThenCreateFunctionIsSameAsInOriginalImage) {
|
||||
MockContext context;
|
||||
std::unique_ptr<Image> image(ImageHelper<Image1dDefaults>::create(&context));
|
||||
std::unique_ptr<Image> imageNew(image->redescribe());
|
||||
ASSERT_NE(nullptr, imageNew);
|
||||
EXPECT_EQ(image->createFunction, imageNew->createFunction);
|
||||
}
|
||||
|
Reference in New Issue
Block a user