Browse Source

[spirv] Add half as allowed (RW)Buffer element type

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/1672
Lei Zhang 6 years ago
parent
commit
5fb1e5313f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      tools/clang/lib/SPIRV/LowerTypeVisitor.cpp

+ 1 - 0
tools/clang/lib/SPIRV/LowerTypeVisitor.cpp

@@ -645,6 +645,7 @@ LowerTypeVisitor::translateSampledTypeToImageFormat(QualType sampledType,
                               : elemCount == 2 ? spv::ImageFormat::Rg32ui
                               : elemCount == 2 ? spv::ImageFormat::Rg32ui
                                                : spv::ImageFormat::Rgba32ui;
                                                : spv::ImageFormat::Rgba32ui;
       case BuiltinType::Float:
       case BuiltinType::Float:
+      case BuiltinType::HalfFloat:
         return elemCount == 1 ? spv::ImageFormat::R32f
         return elemCount == 1 ? spv::ImageFormat::R32f
                               : elemCount == 2 ? spv::ImageFormat::Rg32f
                               : elemCount == 2 ? spv::ImageFormat::Rg32f
                                                : spv::ImageFormat::Rgba32f;
                                                : spv::ImageFormat::Rgba32f;