SWDEV-474989 - Fix texture filter test issues

Change-Id: I9b647aff79ba92f07b2ca18eac49d58ae63fa859


[ROCm/hip-tests commit: 8a9ed34f6a]
This commit is contained in:
taosang2
2024-07-30 09:35:04 -04:00
committed by Tao Sang
parent 2253b82046
commit 43b7d702ff
38 changed files with 488 additions and 645 deletions
@@ -56,8 +56,11 @@ TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeElementType", "", char, unsi
params.extent = make_hipExtent(16, 4, 0);
params.num_subdivisions = 4;
params.GenerateTextureDesc();
TextureTestFixture<TestType, false, true> fixture{params};
if (params.tex_desc.addressMode[0] != params.tex_desc.addressMode[1]) {
INFO("Different address modes on X, Y aren't supported. Skipped.");
return;
}
TextureTestFixture<TestType, false, false> fixture{params};
const auto [num_threads_x, num_blocks_x] = GetLaunchConfig(32, params.NumItersX());
const auto [num_threads_y, num_blocks_y] = GetLaunchConfig(32, params.NumItersY());
@@ -95,10 +98,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeElementType", "", char, unsi
INFO("y: " << std::fixed << std::setprecision(16) << y);
const auto ref_val = fixture.tex_h.Tex2D(x, y, params.tex_desc);
REQUIRE(ref_val.x == fixture.out_alloc_h[i].x);
REQUIRE(ref_val.y == fixture.out_alloc_h[i].y);
REQUIRE(ref_val.z == fixture.out_alloc_h[i].z);
REQUIRE(ref_val.w == fixture.out_alloc_h[i].w);
REQUIRE(fixture.Verify(fixture.out_alloc_h[i], ref_val));
}
}
@@ -127,8 +127,11 @@ TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeNormalizedFloat", "", char,
params.extent = make_hipExtent(16, 4, 0);
params.num_subdivisions = 4;
params.GenerateTextureDesc(hipReadModeNormalizedFloat);
TextureTestFixture<TestType, true, true> fixture{params};
if (params.tex_desc.addressMode[0] != params.tex_desc.addressMode[1]) {
INFO("Different address modes on X, Y aren't supported. Skipped.");
return;
}
TextureTestFixture<TestType, true, false> fixture{params};
const auto [num_threads_x, num_blocks_x] = GetLaunchConfig(32, params.NumItersX());
const auto [num_threads_y, num_blocks_y] = GetLaunchConfig(32, params.NumItersY());
@@ -165,12 +168,8 @@ TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeNormalizedFloat", "", char,
INFO("x: " << std::fixed << std::setprecision(16) << x);
INFO("y: " << std::fixed << std::setprecision(16) << y);
auto ref_val =
Vec4Map<TestType>(fixture.tex_h.Tex2D(x, y, params.tex_desc), NormalizeInteger<TestType>);
REQUIRE(ref_val.x == fixture.out_alloc_h[i].x);
REQUIRE(ref_val.y == fixture.out_alloc_h[i].y);
REQUIRE(ref_val.z == fixture.out_alloc_h[i].z);
REQUIRE(ref_val.w == fixture.out_alloc_h[i].w);
auto ref_val = fixture.tex_h.Tex2D(x, y, params.tex_desc);
REQUIRE(fixture.Verify(fixture.out_alloc_h[i], ref_val));
}
}