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
|
// Test RegisterHandleUsage, sampled image cases
|
||||||
|
|
||||||
struct UsageSampledImageCase {
|
struct UsageImageAccessCase {
|
||||||
std::string inst;
|
std::string inst;
|
||||||
std::string expected_sampler_usage;
|
std::string expected_sampler_usage;
|
||||||
std::string expected_image_usage;
|
std::string expected_image_usage;
|
||||||
};
|
};
|
||||||
inline std::ostream& operator<<(std::ostream& out,
|
inline std::ostream& operator<<(std::ostream& out,
|
||||||
const UsageSampledImageCase& c) {
|
const UsageImageAccessCase& c) {
|
||||||
out << "UsageSampledImageCase(" << c.inst << ", " << c.expected_sampler_usage
|
out << "UsageImageAccessCase(" << c.inst << ", " << c.expected_sampler_usage
|
||||||
<< ", " << c.expected_image_usage << ")";
|
<< ", " << c.expected_image_usage << ")";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
using SpvParserTest_RegisterHandleUsage_SampledImage =
|
using SpvParserTest_RegisterHandleUsage_SampledImage =
|
||||||
SpvParserTestBase<::testing::TestWithParam<UsageSampledImageCase>>;
|
SpvParserTestBase<::testing::TestWithParam<UsageImageAccessCase>>;
|
||||||
|
|
||||||
TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, Variable) {
|
TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, Variable) {
|
||||||
const auto assembly = Preamble() + CommonTypes() + R"(
|
const auto assembly = Preamble() + CommonTypes() + R"(
|
||||||
|
@ -885,35 +885,35 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
|
||||||
// OpImageGather
|
// OpImageGather
|
||||||
UsageSampledImageCase{"%result = OpImageGather "
|
UsageImageAccessCase{"%result = OpImageGather "
|
||||||
"%v4float %sampled_image %coords %uint_1",
|
"%v4float %sampled_image %coords %uint_1",
|
||||||
"Usage(Sampler( ))",
|
"Usage(Sampler( ))",
|
||||||
"Usage(Texture( is_sampled ))"},
|
"Usage(Texture( is_sampled ))"},
|
||||||
// OpImageDrefGather
|
// OpImageDrefGather
|
||||||
UsageSampledImageCase{"%result = OpImageDrefGather "
|
UsageImageAccessCase{"%result = OpImageDrefGather "
|
||||||
"%v4float %sampled_image %coords %depth",
|
"%v4float %sampled_image %coords %depth",
|
||||||
"Usage(Sampler( comparison ))",
|
"Usage(Sampler( comparison ))",
|
||||||
"Usage(Texture( is_sampled depth ))"},
|
"Usage(Texture( is_sampled depth ))"},
|
||||||
|
|
||||||
// Sample the texture.
|
// Sample the texture.
|
||||||
|
|
||||||
// OpImageSampleImplicitLod
|
// OpImageSampleImplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleImplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords",
|
"%v4float %sampled_image %coords",
|
||||||
"Usage(Sampler( ))",
|
"Usage(Sampler( ))",
|
||||||
"Usage(Texture( is_sampled ))"},
|
"Usage(Texture( is_sampled ))"},
|
||||||
// OpImageSampleExplicitLod
|
// OpImageSampleExplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleExplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords Lod %float_null",
|
"%v4float %sampled_image %coords Lod %float_null",
|
||||||
"Usage(Sampler( ))",
|
"Usage(Sampler( ))",
|
||||||
"Usage(Texture( is_sampled ))"},
|
"Usage(Texture( is_sampled ))"},
|
||||||
// OpImageSampleDrefImplicitLod
|
// OpImageSampleDrefImplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleDrefImplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleDrefImplicitLod "
|
||||||
"%v4float %sampled_image %coords %depth",
|
"%v4float %sampled_image %coords %depth",
|
||||||
"Usage(Sampler( comparison ))",
|
"Usage(Sampler( comparison ))",
|
||||||
"Usage(Texture( is_sampled depth ))"},
|
"Usage(Texture( is_sampled depth ))"},
|
||||||
// OpImageSampleDrefExplicitLod
|
// OpImageSampleDrefExplicitLod
|
||||||
UsageSampledImageCase{
|
UsageImageAccessCase{
|
||||||
"%result = OpImageSampleDrefExplicitLod "
|
"%result = OpImageSampleDrefExplicitLod "
|
||||||
"%v4float %sampled_image %coords %depth Lod %float_null",
|
"%v4float %sampled_image %coords %depth Lod %float_null",
|
||||||
"Usage(Sampler( comparison ))",
|
"Usage(Sampler( comparison ))",
|
||||||
|
@ -923,29 +923,29 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
// support them.
|
// support them.
|
||||||
|
|
||||||
// OpImageSampleProjImplicitLod
|
// OpImageSampleProjImplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleProjImplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleProjImplicitLod "
|
||||||
"%v4float %sampled_image %coords",
|
"%v4float %sampled_image %coords",
|
||||||
"Usage(Sampler( ))",
|
"Usage(Sampler( ))",
|
||||||
"Usage(Texture( is_sampled ))"},
|
"Usage(Texture( is_sampled ))"},
|
||||||
// OpImageSampleProjExplicitLod
|
// OpImageSampleProjExplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleProjExplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleProjExplicitLod "
|
||||||
"%v4float %sampled_image %coords Lod %float_null",
|
"%v4float %sampled_image %coords Lod %float_null",
|
||||||
"Usage(Sampler( ))",
|
"Usage(Sampler( ))",
|
||||||
"Usage(Texture( is_sampled ))"},
|
"Usage(Texture( is_sampled ))"},
|
||||||
// OpImageSampleProjDrefImplicitLod
|
// OpImageSampleProjDrefImplicitLod
|
||||||
UsageSampledImageCase{"%result = OpImageSampleProjDrefImplicitLod "
|
UsageImageAccessCase{"%result = OpImageSampleProjDrefImplicitLod "
|
||||||
"%v4float %sampled_image %coords %depth",
|
"%v4float %sampled_image %coords %depth",
|
||||||
"Usage(Sampler( comparison ))",
|
"Usage(Sampler( comparison ))",
|
||||||
"Usage(Texture( is_sampled depth ))"},
|
"Usage(Texture( is_sampled depth ))"},
|
||||||
// OpImageSampleProjDrefExplicitLod
|
// OpImageSampleProjDrefExplicitLod
|
||||||
UsageSampledImageCase{
|
UsageImageAccessCase{
|
||||||
"%result = OpImageSampleProjDrefExplicitLod "
|
"%result = OpImageSampleProjDrefExplicitLod "
|
||||||
"%v4float %sampled_image %coords %depth Lod %float_null",
|
"%v4float %sampled_image %coords %depth Lod %float_null",
|
||||||
"Usage(Sampler( comparison ))",
|
"Usage(Sampler( comparison ))",
|
||||||
"Usage(Texture( is_sampled depth ))"},
|
"Usage(Texture( is_sampled depth ))"},
|
||||||
|
|
||||||
// OpImageQueryLod
|
// OpImageQueryLod
|
||||||
UsageSampledImageCase{
|
UsageImageAccessCase{
|
||||||
"%result = OpImageQueryLod %v2float %sampled_image %coords",
|
"%result = OpImageQueryLod %v2float %sampled_image %coords",
|
||||||
"Usage(Sampler( ))", "Usage(Texture( is_sampled ))"}));
|
"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
|
// Test emission of variables when we have sampled image accesses in
|
||||||
// executable code.
|
// executable code.
|
||||||
|
|
||||||
struct SampledImageCase {
|
struct ImageAccessCase {
|
||||||
// SPIR-V image type, excluding result ID and opcode
|
// SPIR-V image type, excluding result ID and opcode
|
||||||
std::string spirv_image_type_details;
|
std::string spirv_image_type_details;
|
||||||
std::string spirv_image_access; // The provoking image access instruction.
|
std::string spirv_image_access; // The provoking image access instruction.
|
||||||
std::string var_decl; // WGSL variable declaration
|
std::string var_decl; // WGSL variable declaration
|
||||||
std::string texture_builtin; // WGSL texture usage.
|
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"
|
out << "ImageCase(" << c.spirv_image_type_details << "\n"
|
||||||
<< c.spirv_image_access << "\n"
|
<< c.spirv_image_access << "\n"
|
||||||
<< c.var_decl << "\n"
|
<< c.var_decl << "\n"
|
||||||
|
@ -1204,7 +1204,7 @@ inline std::ostream& operator<<(std::ostream& out, const SampledImageCase& c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
using SpvParserTest_DeclHandle_SampledImage =
|
using SpvParserTest_DeclHandle_SampledImage =
|
||||||
SpvParserTestBase<::testing::TestWithParam<SampledImageCase>>;
|
SpvParserTestBase<::testing::TestWithParam<ImageAccessCase>>;
|
||||||
|
|
||||||
TEST_P(SpvParserTest_DeclHandle_SampledImage, Variable) {
|
TEST_P(SpvParserTest_DeclHandle_SampledImage, Variable) {
|
||||||
const auto assembly = Preamble() + R"(
|
const auto assembly = Preamble() + R"(
|
||||||
|
@ -1282,7 +1282,7 @@ TEST_P(SpvParserTest_RegisterHandleUsage_SampledImage, DISABLED_FunctionParam) {
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DISABLED_ImageGather,
|
DISABLED_ImageGather,
|
||||||
SpvParserTest_DeclHandle_SampledImage,
|
SpvParserTest_DeclHandle_SampledImage,
|
||||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||||
// TODO(dneto): OpImageGather
|
// TODO(dneto): OpImageGather
|
||||||
// TODO(dneto): OpImageGather with ConstOffset (signed and unsigned)
|
// TODO(dneto): OpImageGather with ConstOffset (signed and unsigned)
|
||||||
// TODO(dneto): OpImageGather with Offset (signed and unsigned)
|
// TODO(dneto): OpImageGather with Offset (signed and unsigned)
|
||||||
|
@ -1292,7 +1292,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
DISABLED_ImageDrefGather,
|
DISABLED_ImageDrefGather,
|
||||||
SpvParserTest_DeclHandle_SampledImage,
|
SpvParserTest_DeclHandle_SampledImage,
|
||||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||||
// TODO(dneto): OpImageDrefGather
|
// TODO(dneto): OpImageDrefGather
|
||||||
// TODO(dneto): OpImageDrefGather with ConstOffset (signed and
|
// TODO(dneto): OpImageDrefGather with ConstOffset (signed and
|
||||||
// unsigned)
|
// unsigned)
|
||||||
|
@ -1306,10 +1306,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
|
||||||
// OpImageSampleImplicitLod
|
// OpImageSampleImplicitLod
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords12",
|
"%v4float %sampled_image %coords12",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1328,7 +1328,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSample}
|
Identifier[not set]{textureSample}
|
||||||
(
|
(
|
||||||
|
@ -1339,10 +1339,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleImplicitLod arrayed
|
// OpImageSampleImplicitLod arrayed
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords123",
|
"%v4float %sampled_image %coords123",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1361,7 +1361,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSample}
|
Identifier[not set]{textureSample}
|
||||||
(
|
(
|
||||||
|
@ -1382,7 +1382,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleImplicitLod with ConstOffset
|
// OpImageSampleImplicitLod with ConstOffset
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 0 0 1 Unknown",
|
"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords12 ConstOffset %offsets2d",
|
"%v4float %sampled_image %coords12 ConstOffset %offsets2d",
|
||||||
|
@ -1417,7 +1417,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleImplicitLod arrayed with ConstOffset
|
// OpImageSampleImplicitLod arrayed with ConstOffset
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 1 0 1 Unknown",
|
"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords123 ConstOffset %offsets2d",
|
"%v4float %sampled_image %coords123 ConstOffset %offsets2d",
|
||||||
|
@ -1462,10 +1462,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleImplicitLod with Bias
|
// OpImageSampleImplicitLod with Bias
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Bias %float_7",
|
"%v4float %sampled_image %coords12 Bias %float_7",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1484,7 +1484,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleBias}
|
Identifier[not set]{textureSampleBias}
|
||||||
(
|
(
|
||||||
|
@ -1496,10 +1496,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleImplicitLod arrayed with Bias
|
// OpImageSampleImplicitLod arrayed with Bias
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Bias %float_7",
|
"%v4float %sampled_image %coords123 Bias %float_7",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1518,7 +1518,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleBias}
|
Identifier[not set]{textureSampleBias}
|
||||||
(
|
(
|
||||||
|
@ -1542,11 +1542,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
// OpImageSampleImplicitLod with Bias and ConstOffset
|
// OpImageSampleImplicitLod with Bias and ConstOffset
|
||||||
// TODO(dneto): OpImageSampleImplicitLod with Bias and unsigned
|
// TODO(dneto): OpImageSampleImplicitLod with Bias and unsigned
|
||||||
// ConstOffset
|
// ConstOffset
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Bias|ConstOffset "
|
"%v4float %sampled_image %coords12 Bias|ConstOffset "
|
||||||
"%float_7 %offsets2d",
|
"%float_7 %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1565,7 +1565,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleBias}
|
Identifier[not set]{textureSampleBias}
|
||||||
(
|
(
|
||||||
|
@ -1577,11 +1577,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
)
|
)
|
||||||
})"},
|
})"},
|
||||||
// OpImageSampleImplicitLod arrayed with Bias
|
// OpImageSampleImplicitLod arrayed with Bias
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleImplicitLod "
|
"%result = OpImageSampleImplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Bias|ConstOffset "
|
"%v4float %sampled_image %coords123 Bias|ConstOffset "
|
||||||
"%float_7 %offsets2d",
|
"%float_7 %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1600,7 +1600,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleBias}
|
Identifier[not set]{textureSampleBias}
|
||||||
(
|
(
|
||||||
|
@ -1631,14 +1631,14 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
|
||||||
// OpImageSampleImplicitLod
|
// OpImageSampleImplicitLod
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown", R"(
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown", R"(
|
||||||
%sam_dref = OpLoad %sampler %30
|
%sam_dref = OpLoad %sampler %30
|
||||||
%sampled_dref_image = OpSampledImage %si_ty %im %sam_dref
|
%sampled_dref_image = OpSampledImage %si_ty %im %sam_dref
|
||||||
|
|
||||||
%200 = OpImageSampleImplicitLod %v4float %sampled_image %coords12
|
%200 = OpImageSampleImplicitLod %v4float %sampled_image %coords12
|
||||||
%210 = OpImageSampleDrefImplicitLod %v4float %sampled_dref_image %coords12 %depth
|
%210 = OpImageSampleDrefImplicitLod %v4float %sampled_dref_image %coords12 %depth
|
||||||
)",
|
)",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampler_comparison
|
__sampler_comparison
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
VariableDeclStatement{
|
VariableDeclStatement{
|
||||||
VariableConst{
|
VariableConst{
|
||||||
x_200
|
x_200
|
||||||
|
@ -1708,10 +1708,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
SpvParserTest_DeclHandle_SampledImage,
|
SpvParserTest_DeclHandle_SampledImage,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
// ImageSampleDrefImplicitLod
|
// ImageSampleDrefImplicitLod
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleDrefImplicitLod "
|
"%result = OpImageSampleDrefImplicitLod "
|
||||||
"%v4float %sampled_image %coords12 %depth",
|
"%v4float %sampled_image %coords12 %depth",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1730,7 +1730,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__depth_texture_2d
|
__depth_texture_2d
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleCompare}
|
Identifier[not set]{textureSampleCompare}
|
||||||
(
|
(
|
||||||
|
@ -1741,10 +1741,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
)
|
)
|
||||||
})"},
|
})"},
|
||||||
// ImageSampleDrefImplicitLod - arrayed
|
// ImageSampleDrefImplicitLod - arrayed
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleDrefImplicitLod "
|
"%result = OpImageSampleDrefImplicitLod "
|
||||||
"%v4float %sampled_image %coords123 %depth",
|
"%v4float %sampled_image %coords123 %depth",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1763,7 +1763,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__depth_texture_2d_array
|
__depth_texture_2d_array
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleCompare}
|
Identifier[not set]{textureSampleCompare}
|
||||||
(
|
(
|
||||||
|
@ -1784,7 +1784,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
)
|
)
|
||||||
})"},
|
})"},
|
||||||
// ImageSampleDrefImplicitLod with ConstOffset
|
// ImageSampleDrefImplicitLod with ConstOffset
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 0 0 1 Unknown",
|
"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleDrefImplicitLod %v4float "
|
"%result = OpImageSampleDrefImplicitLod %v4float "
|
||||||
"%sampled_image %coords12 %depth ConstOffset %offsets2d",
|
"%sampled_image %coords12 %depth ConstOffset %offsets2d",
|
||||||
|
@ -1819,7 +1819,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
)
|
)
|
||||||
})"},
|
})"},
|
||||||
// ImageSampleDrefImplicitLod arrayed with ConstOffset
|
// ImageSampleDrefImplicitLod arrayed with ConstOffset
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 1 0 1 Unknown",
|
"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleDrefImplicitLod %v4float "
|
"%result = OpImageSampleDrefImplicitLod %v4float "
|
||||||
"%sampled_image %coords123 %depth ConstOffset %offsets2d",
|
"%sampled_image %coords123 %depth ConstOffset %offsets2d",
|
||||||
|
@ -1870,10 +1870,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
|
||||||
// OpImageSampleExplicitLod - using Lod
|
// OpImageSampleExplicitLod - using Lod
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Lod %float_null",
|
"%v4float %sampled_image %coords12 Lod %float_null",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1892,7 +1892,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleLevel}
|
Identifier[not set]{textureSampleLevel}
|
||||||
(
|
(
|
||||||
|
@ -1904,10 +1904,10 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleExplicitLod arrayed - using Lod
|
// OpImageSampleExplicitLod arrayed - using Lod
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Lod %float_null",
|
"%v4float %sampled_image %coords123 Lod %float_null",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1926,7 +1926,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleLevel}
|
Identifier[not set]{textureSampleLevel}
|
||||||
(
|
(
|
||||||
|
@ -1950,11 +1950,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
// OpImageSampleExplicitLod - using Lod and ConstOffset
|
// OpImageSampleExplicitLod - using Lod and ConstOffset
|
||||||
// TODO(dneto) OpImageSampleExplicitLod - using Lod and unsigned
|
// TODO(dneto) OpImageSampleExplicitLod - using Lod and unsigned
|
||||||
// ConstOffset
|
// ConstOffset
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Lod|ConstOffset "
|
"%v4float %sampled_image %coords12 Lod|ConstOffset "
|
||||||
"%float_null %offsets2d",
|
"%float_null %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -1973,7 +1973,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleLevel}
|
Identifier[not set]{textureSampleLevel}
|
||||||
(
|
(
|
||||||
|
@ -1986,11 +1986,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleExplicitLod arrayed - using Lod and ConstOffset
|
// OpImageSampleExplicitLod arrayed - using Lod and ConstOffset
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Lod|ConstOffset "
|
"%v4float %sampled_image %coords123 Lod|ConstOffset "
|
||||||
"%float_null %offsets2d",
|
"%float_null %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -2009,7 +2009,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleLevel}
|
Identifier[not set]{textureSampleLevel}
|
||||||
(
|
(
|
||||||
|
@ -2032,7 +2032,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleExplicitLod - using Grad
|
// OpImageSampleExplicitLod - using Grad
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 0 0 1 Unknown",
|
"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Grad %float_7 %float_null",
|
"%v4float %sampled_image %coords12 Grad %float_7 %float_null",
|
||||||
|
@ -2068,7 +2068,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
})"},
|
})"},
|
||||||
|
|
||||||
// OpImageSampleExplicitLod arrayed - using Grad
|
// OpImageSampleExplicitLod arrayed - using Grad
|
||||||
SampledImageCase{
|
ImageAccessCase{
|
||||||
"%float 2D 0 1 0 1 Unknown",
|
"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Grad %float_7 %float_null",
|
"%v4float %sampled_image %coords123 Grad %float_7 %float_null",
|
||||||
|
@ -2116,11 +2116,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
// OpImageSampleExplicitLod - using Grad and ConstOffset
|
// OpImageSampleExplicitLod - using Grad and ConstOffset
|
||||||
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
||||||
// ConstOffset
|
// ConstOffset
|
||||||
SampledImageCase{"%float 2D 0 0 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords12 Grad|ConstOffset "
|
"%v4float %sampled_image %coords12 Grad|ConstOffset "
|
||||||
"%float_7 %float_null %offsets2d",
|
"%float_7 %float_null %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -2139,7 +2139,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d__f32
|
__sampled_texture_2d__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleGrad}
|
Identifier[not set]{textureSampleGrad}
|
||||||
(
|
(
|
||||||
|
@ -2154,11 +2154,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
// OpImageSampleExplicitLod arrayed - using Grad and ConstOffset
|
// OpImageSampleExplicitLod arrayed - using Grad and ConstOffset
|
||||||
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
// TODO(dneto): OpImageSampleExplicitLod - using Grad and unsigned
|
||||||
// ConstOffset
|
// ConstOffset
|
||||||
SampledImageCase{"%float 2D 0 1 0 1 Unknown",
|
ImageAccessCase{"%float 2D 0 1 0 1 Unknown",
|
||||||
"%result = OpImageSampleExplicitLod "
|
"%result = OpImageSampleExplicitLod "
|
||||||
"%v4float %sampled_image %coords123 Grad|ConstOffset "
|
"%v4float %sampled_image %coords123 Grad|ConstOffset "
|
||||||
"%float_7 %float_null %offsets2d",
|
"%float_7 %float_null %offsets2d",
|
||||||
R"(
|
R"(
|
||||||
DecoratedVariable{
|
DecoratedVariable{
|
||||||
Decorations{
|
Decorations{
|
||||||
SetDecoration{0}
|
SetDecoration{0}
|
||||||
|
@ -2177,7 +2177,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
uniform_constant
|
uniform_constant
|
||||||
__sampled_texture_2d_array__f32
|
__sampled_texture_2d_array__f32
|
||||||
})",
|
})",
|
||||||
R"(
|
R"(
|
||||||
Call[not set]{
|
Call[not set]{
|
||||||
Identifier[not set]{textureSampleGrad}
|
Identifier[not set]{textureSampleGrad}
|
||||||
(
|
(
|
||||||
|
@ -2207,7 +2207,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
ImageSampleExplicitLod_DepthTexture,
|
ImageSampleExplicitLod_DepthTexture,
|
||||||
SpvParserTest_DeclHandle_SampledImage,
|
SpvParserTest_DeclHandle_SampledImage,
|
||||||
::testing::ValuesIn(std::vector<SampledImageCase>{
|
::testing::ValuesIn(std::vector<ImageAccessCase>{
|
||||||
// Test a non-depth case.
|
// Test a non-depth case.
|
||||||
// (This is already tested above in the ImageSampleExplicitLod suite,
|
// (This is already tested above in the ImageSampleExplicitLod suite,
|
||||||
// but I'm repeating here for the contrast with the depth case.)
|
// but I'm repeating here for the contrast with the depth case.)
|
||||||
|
|
Loading…
Reference in New Issue