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
@@ -57,8 +57,11 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeElementType", "", cha
params.layers = 2;
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());
@@ -98,10 +101,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeElementType", "", cha
INFO("y: " << std::fixed << std::setprecision(16) << y);
const auto ref_val = fixture.tex_h.Tex2DLayered(x, y, layer, 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));
}
}
}
@@ -132,8 +132,11 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeNormalizedFloat", "",
params.layers = 2;
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());
@@ -172,12 +175,8 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeNormalizedFloat", "",
INFO("x: " << std::fixed << std::setprecision(16) << x);
INFO("y: " << std::fixed << std::setprecision(16) << y);
auto ref_val = Vec4Map<TestType>(fixture.tex_h.Tex2DLayered(x, y, layer, 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.Tex2DLayered(x, y, layer, params.tex_desc);
REQUIRE(fixture.Verify(fixture.out_alloc_h[i], ref_val));
}
}
}