Dawn&Tint: Implement F16 pipeline IO

This CL implement f16 for pipeline IO, i.e. vertex shader input,
interstage variables between vertex and fragment shader, and fragment
shader output (render target). Unit tests and E2E tests for Tint and
Dawn are also implemented.

Bugs: tint:1473, tint:1502
Change-Id: If0d6b2b3171ec8b7e4efc0efd58cc803c6a3d3a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111160
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Zhaoming Jiang
2022-12-07 04:33:24 +00:00
committed by Dawn LUCI CQ
parent 800b3c2851
commit 6198bea2ac
98 changed files with 4956 additions and 140 deletions

View File

@@ -606,17 +606,14 @@ static constexpr Params cases[] = {
ParamsFor<alias<i32>>(true), //
ParamsFor<alias<u32>>(true), //
ParamsFor<alias<bool>>(false), //
// Currently entry point IO of f16 types are not implemented yet.
// TODO(tint:1473, tint:1502): Change f16 and vecN<f16> cases to valid after f16 is supported in
// entry point IO.
ParamsFor<f16>(false), //
ParamsFor<vec2<f16>>(false), //
ParamsFor<vec3<f16>>(false), //
ParamsFor<vec4<f16>>(false), //
ParamsFor<f16>(true), //
ParamsFor<vec2<f16>>(true), //
ParamsFor<vec3<f16>>(true), //
ParamsFor<vec4<f16>>(true), //
ParamsFor<mat2x2<f16>>(false), //
ParamsFor<mat3x3<f16>>(false), //
ParamsFor<mat4x4<f16>>(false), //
ParamsFor<alias<f16>>(false), //
ParamsFor<alias<f16>>(true), //
};
TEST_P(TypeValidationTest, BareInputs) {

View File

@@ -1068,13 +1068,6 @@ bool Validator::EntryPoint(const sem::Function* func, ast::PipelineStage stage)
ParamOrRetType param_or_ret,
bool is_struct_member,
std::optional<uint32_t> location) {
// Temporally forbid using f16 types in entry point IO.
// TODO(tint:1473, tint:1502): Remove this error after f16 is supported in entry point IO.
if (Is<sem::F16>(sem::Type::DeepestElementOf(ty))) {
AddError("entry point IO of f16 types is not implemented yet", source);
return false;
}
// Scan attributes for pipeline IO attributes.
// Check for overlap with attributes that have been seen previously.
const ast::Attribute* pipeline_io_attribute = nullptr;