HLSL: Correct some mistakes for min16 types

- Add missing constructor ops to support float16/int16/uint16 types
- Allow half float literals
- Correct two errors of double literal parse in HLSL: extension check and
  postfix
This commit is contained in:
Rex Xu
2018-03-12 23:15:11 +08:00
parent 845860d565
commit a00e51b5b2
5 changed files with 50 additions and 9 deletions

View File

@@ -8320,6 +8320,22 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
// First, convert types as needed.
//
switch (op) {
case EOpConstructF16Vec2:
case EOpConstructF16Vec3:
case EOpConstructF16Vec4:
case EOpConstructF16Mat2x2:
case EOpConstructF16Mat2x3:
case EOpConstructF16Mat2x4:
case EOpConstructF16Mat3x2:
case EOpConstructF16Mat3x3:
case EOpConstructF16Mat3x4:
case EOpConstructF16Mat4x2:
case EOpConstructF16Mat4x3:
case EOpConstructF16Mat4x4:
case EOpConstructFloat16:
basicOp = EOpConstructFloat16;
break;
case EOpConstructVec2:
case EOpConstructVec3:
case EOpConstructVec4:
@@ -8352,6 +8368,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
basicOp = EOpConstructDouble;
break;
case EOpConstructI16Vec2:
case EOpConstructI16Vec3:
case EOpConstructI16Vec4:
case EOpConstructInt16:
basicOp = EOpConstructInt16;
break;
case EOpConstructIVec2:
case EOpConstructIVec3:
case EOpConstructIVec4:
@@ -8368,6 +8391,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
basicOp = EOpConstructInt;
break;
case EOpConstructU16Vec2:
case EOpConstructU16Vec3:
case EOpConstructU16Vec4:
case EOpConstructUint16:
basicOp = EOpConstructUint16;
break;
case EOpConstructUVec2:
case EOpConstructUVec3:
case EOpConstructUVec4: