Parser: Implement extension GL_AMD_gpu_shader_half_float.
- Add built-in types: float16_t, f16vec, f16mat. - Add support of half float constant: hf, HF. - Extend built-in floating-point operators: +, -, *, /, ++, --, +=, -=, *=, /=, ==, !=, >=, <=, >, <. - Add support of type conversions: float16_t -> XXX, XXX -> float16_t. - Add new built-in functions.
This commit is contained in:
@@ -67,6 +67,9 @@ using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
#endif
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
|
||||
// generate SPIR-V.
|
||||
@@ -138,6 +141,17 @@ TEST_P(GlslIoMap, FromFile)
|
||||
GetParam().flattenUniforms);
|
||||
}
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
|
||||
// Expected to successfully generate SPIR-V.
|
||||
TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(),
|
||||
Source::GLSL, Semantics::Vulkan,
|
||||
Target::Spv);
|
||||
}
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileVulkanToSpirvTest,
|
||||
@@ -324,6 +338,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileVulkanToSpirvTestAMD,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
"spv.float16.frag",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
Reference in New Issue
Block a user