SWDEV-474989 - Fix texture filter test issues
Change-Id: I9b647aff79ba92f07b2ca18eac49d58ae63fa859
[ROCm/hip-tests commit: 8a9ed34f6a]
This commit is contained in:
@@ -51,14 +51,19 @@ THE SOFTWARE.
|
||||
TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeElementType", "", char,
|
||||
unsigned char, short, unsigned short, int, unsigned int, float) {
|
||||
CHECK_IMAGE_SUPPORT;
|
||||
|
||||
INFO("texCubemap isn't supported. Skipped.");
|
||||
return;
|
||||
TextureTestParams<TestType> params = {};
|
||||
params.extent = make_hipExtent(2, 2, 6);
|
||||
params.num_subdivisions = 4;
|
||||
params.layers = 1;
|
||||
params.cubemap = true;
|
||||
params.GenerateTextureDesc();
|
||||
|
||||
if (params.tex_desc.addressMode[0] != params.tex_desc.addressMode[1] ||
|
||||
params.tex_desc.addressMode[0] != params.tex_desc.addressMode[2]) {
|
||||
INFO("Different address modes on X, Y, Z aren't supported. Skipped.");
|
||||
return;
|
||||
}
|
||||
TextureTestFixture<TestType, false, true> fixture{params};
|
||||
|
||||
const auto [num_threads_x, num_blocks_x] = GetLaunchConfig(10, params.NumItersX());
|
||||
@@ -110,10 +115,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeElementType", ""
|
||||
auto index = k * params.NumItersX() * params.NumItersY() + j * params.NumItersX() + i;
|
||||
|
||||
const auto ref_val = fixture.tex_h.TexCubemap(x, y, z, params.tex_desc);
|
||||
REQUIRE(ref_val.x == fixture.out_alloc_h[index].x);
|
||||
REQUIRE(ref_val.y == fixture.out_alloc_h[index].y);
|
||||
REQUIRE(ref_val.z == fixture.out_alloc_h[index].z);
|
||||
REQUIRE(ref_val.w == fixture.out_alloc_h[index].w);
|
||||
REQUIRE(fixture.Verify(fixture.out_alloc_h[index], ref_val));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,14 +142,19 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeElementType", ""
|
||||
TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeNormalizedFloat", "", char,
|
||||
unsigned char, short, unsigned short) {
|
||||
CHECK_IMAGE_SUPPORT;
|
||||
|
||||
INFO("texCubemap isn't supported. Skipped.");
|
||||
return;
|
||||
TextureTestParams<TestType> params = {};
|
||||
params.extent = make_hipExtent(2, 2, 6);
|
||||
params.num_subdivisions = 4;
|
||||
params.layers = 1;
|
||||
params.cubemap = true;
|
||||
params.GenerateTextureDesc(hipReadModeNormalizedFloat);
|
||||
|
||||
if (params.tex_desc.addressMode[0] != params.tex_desc.addressMode[1] ||
|
||||
params.tex_desc.addressMode[0] != params.tex_desc.addressMode[2]) {
|
||||
INFO("Different address modes on X, Y, Z aren't supported. Skipped.");
|
||||
return;
|
||||
}
|
||||
TextureTestFixture<TestType, true, true> fixture{params};
|
||||
|
||||
const auto [num_threads_x, num_blocks_x] = GetLaunchConfig(10, params.NumItersX());
|
||||
@@ -198,12 +205,8 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeNormalizedFloat"
|
||||
|
||||
auto index = k * params.NumItersX() * params.NumItersY() + j * params.NumItersX() + i;
|
||||
|
||||
auto ref_val = Vec4Map<TestType>(fixture.tex_h.TexCubemap(x, y, z, params.tex_desc),
|
||||
NormalizeInteger<TestType>);
|
||||
REQUIRE(ref_val.x == fixture.out_alloc_h[index].x);
|
||||
REQUIRE(ref_val.y == fixture.out_alloc_h[index].y);
|
||||
REQUIRE(ref_val.z == fixture.out_alloc_h[index].z);
|
||||
REQUIRE(ref_val.w == fixture.out_alloc_h[index].w);
|
||||
auto ref_val = fixture.tex_h.TexCubemap(x, y, z, params.tex_desc);
|
||||
REQUIRE(fixture.Verify(fixture.out_alloc_h[index], ref_val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user