tests: Change name SampledImageCase -> ImageAccessCase
Bug: tint:109 Change-Id: I6f5b1d3cf73fa58ae9f4c37d155199649eb37518 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34423 Commit-Queue: David Neto <dneto@google.com> Auto-Submit: David Neto <dneto@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
2082beed0f
commit
21e9204e14
|
@ -794,20 +794,20 @@ TEST_F(SpvParserTest, GetMemoryObjectDeclarationForHandle_FuncParam_Image) {
|
|||
|
||||
// Test RegisterHandleUsage, sampled image cases
|
||||
|
||||
struct UsageSampledImageCase {
|
||||
struct UsageImageAccessCase {
|
||||
std::string inst;
|
||||
std::string expected_sampler_usage;
|
||||
std::string expected_image_usage;
|
||||
};
|
||||
inline std::ostream& operator<<(std::ostream& out,
|
||||
const UsageSampledImageCase& c) {
|
||||
out << "UsageSampledImageCase(" << c.inst << ", " << c.expected_sampler_usage
|
||||
const UsageImageAccessCase& c) {
|
||||
out << "UsageImageAccessCase(" << c.inst << ", " << c.expected_sampler_usage
|
||||
<< ", " << c.expected_image_usage << ")";
|
||||
return out;
|
||||
}
|
||||
|
||||
using SpvParserTest_RegisterHandleUsage_SampledImage =
|
||||
SpvParserTestBase<::testing::TestWithParam<UsageSampledImageCase>>;
|
||||
SpvParserTestBase<::testing::TestWithParam<UsageImageAccessCase>>;
|
||||
|
||||
TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, Variable) {
|
||||
const auto assembly = Preamble() + CommonTypes() + R"(
|
||||
|
@ -885,12 +885,12 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
::testing::Values(
|
||||
|
||||
// OpImageGather
|
||||
UsageSampledImageCase{"%result = OpImageGather "
|
||||
UsageImageAccessCase{"%result = OpImageGather "
|
||||
"%v4float %sampled_image %coords %uint_1",
|
||||
"Usage(Sampler( ))",
|
||||
"Usage(Texture( is_sampled ))"},
|
||||
// OpImageDrefGather
|
||||
UsageSampledImageCase{"%result = OpImageDrefGather "
|
||||
UsageImageAccessCase{"%result = OpImageDrefGather "
|
||||
"%v4float %sampled_image %coords %depth",
|
||||
"Usage(Sampler( comparison ))",
|
||||
"Usage(Texture( is_sampled depth ))"},
|
||||
|
@ -898,22 +898,22 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// Sample the texture.
|
||||
|
||||
// OpImageSampleImplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleImplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords",
|
||||
"Usage(Sampler( ))",
|
||||
"Usage(Texture( is_sampled ))"},
|
||||
// OpImageSampleExplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleExplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords Lod %float_null",
|
||||
"Usage(Sampler( ))",
|
||||
"Usage(Texture( is_sampled ))"},
|
||||
// OpImageSampleDrefImplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleDrefImplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleDrefImplicitLod "
|
||||
"%v4float %sampled_image %coords %depth",
|
||||
"Usage(Sampler( comparison ))",
|
||||
"Usage(Texture( is_sampled depth ))"},
|
||||
// OpImageSampleDrefExplicitLod
|
||||
UsageSampledImageCase{
|
||||
UsageImageAccessCase{
|
||||
"%result = OpImageSampleDrefExplicitLod "
|
||||
"%v4float %sampled_image %coords %depth Lod %float_null",
|
||||
"Usage(Sampler( comparison ))",
|
||||
|
@ -923,29 +923,29 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// support them.
|
||||
|
||||
// OpImageSampleProjImplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleProjImplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleProjImplicitLod "
|
||||
"%v4float %sampled_image %coords",
|
||||
"Usage(Sampler( ))",
|
||||
"Usage(Texture( is_sampled ))"},
|
||||
// OpImageSampleProjExplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleProjExplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleProjExplicitLod "
|
||||
"%v4float %sampled_image %coords Lod %float_null",
|
||||
"Usage(Sampler( ))",
|
||||
"Usage(Texture( is_sampled ))"},
|
||||
// OpImageSampleProjDrefImplicitLod
|
||||
UsageSampledImageCase{"%result = OpImageSampleProjDrefImplicitLod "
|
||||
UsageImageAccessCase{"%result = OpImageSampleProjDrefImplicitLod "
|
||||
"%v4float %sampled_image %coords %depth",
|
||||
"Usage(Sampler( comparison ))",
|
||||
"Usage(Texture( is_sampled depth ))"},
|
||||
// OpImageSampleProjDrefExplicitLod
|
||||
UsageSampledImageCase{
|
||||
UsageImageAccessCase{
|
||||
"%result = OpImageSampleProjDrefExplicitLod "
|
||||
"%v4float %sampled_image %coords %depth Lod %float_null",
|
||||
"Usage(Sampler( comparison ))",
|
||||
"Usage(Texture( is_sampled depth ))"},
|
||||
|
||||
// OpImageQueryLod
|
||||
UsageSampledImageCase{
|
||||
UsageImageAccessCase{
|
||||
"%result = OpImageQueryLod %v2float %sampled_image %coords",
|
||||
"Usage(Sampler( ))", "Usage(Texture( is_sampled ))"}));
|
||||
|
||||
|
@ -1188,14 +1188,14 @@ INSTANTIATE_TEST_SUITE_P(Images,
|
|||
// Test emission of variables when we have sampled image accesses in
|
||||
// executable code.
|
||||
|
||||
struct SampledImageCase {
|
||||
struct ImageAccessCase {
|
||||
// SPIR-V image type, excluding result ID and opcode
|
||||
std::string spirv_image_type_details;
|
||||
std::string spirv_image_access; // The provoking image access instruction.
|
||||
std::string var_decl; // WGSL variable declaration
|
||||
std::string texture_builtin; // WGSL texture usage.
|
||||
};
|
||||
inline std::ostream& operator<<(std::ostream& out, const SampledImageCase& c) {
|
||||
inline std::ostream& operator<<(std::ostream& out, const ImageAccessCase& c) {
|
||||
out << "ImageCase(" << c.spirv_image_type_details << "\n"
|
||||
<< c.spirv_image_access << "\n"
|
||||
<< c.var_decl << "\n"
|
||||
|
@ -1204,7 +1204,7 @@ inline std::ostream& operator<<(std::ostream& out, const SampledImageCase& c) {
|
|||
}
|
||||
|
||||
using SpvParserTest_DeclHandle_SampledImage =
|
||||
SpvParserTestBase<::testing::TestWithParam<SampledImageCase>>;
|
||||
SpvParserTestBase<::testing::TestWithParam<ImageAccessCase>>;
|
||||
|
||||
TEST_P(SpvParserTest_DeclHandle_SampledImage, Variable) {
|
||||
const auto assembly = Preamble() + R"(
|
||||
|
@ -1282,7 +1282,7 @@ TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, DISABLED_FunctionParam) {
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
DISABLED_ImageGather,
|
||||
SpvParserTest_DeclHandle_SampledImage,
|
||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
||||
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||
// TODO(dneto): OpImageGather
|
||||
// TODO(dneto): OpImageGather with ConstOffset (signed and unsigned)
|
||||
// TODO(dneto): OpImageGather with Offset (signed and unsigned)
|
||||
|
@ -1292,7 +1292,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
DISABLED_ImageDrefGather,
|
||||
SpvParserTest_DeclHandle_SampledImage,
|
||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
||||
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||
// TODO(dneto): OpImageDrefGather
|
||||
// TODO(dneto): OpImageDrefGather with ConstOffset (signed and
|
||||
// unsigned)
|
||||
|
@ -1306,7 +1306,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
::testing::Values(
|
||||
|
||||
// OpImageSampleImplicitLod
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords12",
|
||||
R"(
|
||||
|
@ -1339,7 +1339,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleImplicitLod arrayed
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords123",
|
||||
R"(
|
||||
|
@ -1382,7 +1382,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleImplicitLod with ConstOffset
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords12 ConstOffset %offsets2d",
|
||||
|
@ -1417,7 +1417,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleImplicitLod arrayed with ConstOffset
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords123 ConstOffset %offsets2d",
|
||||
|
@ -1462,7 +1462,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleImplicitLod with Bias
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords12 Bias %float_7",
|
||||
R"(
|
||||
|
@ -1496,7 +1496,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleImplicitLod arrayed with Bias
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords123 Bias %float_7",
|
||||
R"(
|
||||
|
@ -1542,7 +1542,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// OpImageSampleImplicitLod with Bias and ConstOffset
|
||||
// TODO(dneto): OpImageSampleImplicitLod with Bias and unsigned
|
||||
// ConstOffset
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords12 Bias|ConstOffset "
|
||||
"%float_7 %offsets2d",
|
||||
|
@ -1577,7 +1577,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
)
|
||||
})"},
|
||||
// OpImageSampleImplicitLod arrayed with Bias
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleImplicitLod "
|
||||
"%v4float %sampled_image %coords123 Bias|ConstOffset "
|
||||
"%float_7 %offsets2d",
|
||||
|
@ -1631,7 +1631,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
::testing::Values(
|
||||
|
||||
// OpImageSampleImplicitLod
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown", R"(
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown", R"(
|
||||
%sam_dref = OpLoad %sampler %30
|
||||
%sampled_dref_image = OpSampledImage %si_ty %im %sam_dref
|
||||
|
||||
|
@ -1708,7 +1708,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
SpvParserTest_DeclHandle_SampledImage,
|
||||
::testing::Values(
|
||||
// ImageSampleDrefImplicitLod
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleDrefImplicitLod "
|
||||
"%v4float %sampled_image %coords12 %depth",
|
||||
R"(
|
||||
|
@ -1741,7 +1741,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
)
|
||||
})"},
|
||||
// ImageSampleDrefImplicitLod - arrayed
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleDrefImplicitLod "
|
||||
"%v4float %sampled_image %coords123 %depth",
|
||||
R"(
|
||||
|
@ -1784,7 +1784,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
)
|
||||
})"},
|
||||
// ImageSampleDrefImplicitLod with ConstOffset
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleDrefImplicitLod %v4float "
|
||||
"%sampled_image %coords12 %depth ConstOffset %offsets2d",
|
||||
|
@ -1819,7 +1819,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
)
|
||||
})"},
|
||||
// ImageSampleDrefImplicitLod arrayed with ConstOffset
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleDrefImplicitLod %v4float "
|
||||
"%sampled_image %coords123 %depth ConstOffset %offsets2d",
|
||||
|
@ -1870,7 +1870,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
::testing::Values(
|
||||
|
||||
// OpImageSampleExplicitLod - using Lod
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords12 Lod %float_null",
|
||||
R"(
|
||||
|
@ -1904,7 +1904,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleExplicitLod arrayed - using Lod
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords123 Lod %float_null",
|
||||
R"(
|
||||
|
@ -1950,7 +1950,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// OpImageSampleExplicitLod - using Lod and ConstOffset
|
||||
// TODO(dneto) OpImageSampleExplicitLod - using Lod and unsigned
|
||||
// ConstOffset
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords12 Lod|ConstOffset "
|
||||
"%float_null %offsets2d",
|
||||
|
@ -1986,7 +1986,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleExplicitLod arrayed - using Lod and ConstOffset
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords123 Lod|ConstOffset "
|
||||
"%float_null %offsets2d",
|
||||
|
@ -2032,7 +2032,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleExplicitLod - using Grad
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords12 Grad %float_7 %float_null",
|
||||
|
@ -2068,7 +2068,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
})"},
|
||||
|
||||
// OpImageSampleExplicitLod arrayed - using Grad
|
||||
SampledImageCase{
|
||||
ImageAccessCase{
|
||||
"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords123 Grad %float_7 %float_null",
|
||||
|
@ -2116,7 +2116,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// OpImageSampleExplicitLod - using Grad and ConstOffset
|
||||
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
||||
// ConstOffset
|
||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords12 Grad|ConstOffset "
|
||||
"%float_7 %float_null %offsets2d",
|
||||
|
@ -2154,7 +2154,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
// OpImageSampleExplicitLod arrayed - using Grad and ConstOffset
|
||||
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
||||
// ConstOffset
|
||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
||||
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||
"%result = OpImageSampleExplicitLod "
|
||||
"%v4float %sampled_image %coords123 Grad|ConstOffset "
|
||||
"%float_7 %float_null %offsets2d",
|
||||
|
@ -2207,7 +2207,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
ImageSampleExplicitLod_DepthTexture,
|
||||
SpvParserTest_DeclHandle_SampledImage,
|
||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
||||
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||
// Test a non-depth case.
|
||||
// (This is already tested above in the ImageSampleExplicitLod suite,
|
||||
// but I'm repeating here for the contrast with the depth case.)
|
||||
|
|
Loading…
Reference in New Issue