浏览代码

[spirv] Fix typo and remove unused code.

Ehsan 6 年之前
父节点
当前提交
1b2aa0a4db

+ 2 - 4
tools/clang/lib/SPIRV/SpirvType.cpp

@@ -55,8 +55,6 @@ bool SpirvType::isSampler(const SpirvType *type) {
 
 
 bool SpirvType::isBuffer(const SpirvType *type) {
 bool SpirvType::isBuffer(const SpirvType *type) {
   if (const auto *imageType = dyn_cast<ImageType>(type)) {
   if (const auto *imageType = dyn_cast<ImageType>(type)) {
-    const auto dim = imageType->getDimension();
-    const auto withSampler = imageType->withSampler();
     return imageType->getDimension() == spv::Dim::Buffer &&
     return imageType->getDimension() == spv::Dim::Buffer &&
            imageType->withSampler() == ImageType::WithSampler::Yes;
            imageType->withSampler() == ImageType::WithSampler::Yes;
   }
   }
@@ -110,11 +108,11 @@ bool SpirvType::isOrContains16BitType(const SpirvType *type) {
     return isOrContains16BitType(vecType->getElementType());
     return isOrContains16BitType(vecType->getElementType());
   if (const auto *matType = dyn_cast<MatrixType>(type))
   if (const auto *matType = dyn_cast<MatrixType>(type))
     return isOrContains16BitType(matType->getElementType());
     return isOrContains16BitType(matType->getElementType());
-  if (const auto *arrType = dyn_cast<MatrixType>(type))
+  if (const auto *arrType = dyn_cast<ArrayType>(type))
     return isOrContains16BitType(arrType->getElementType());
     return isOrContains16BitType(arrType->getElementType());
   if (const auto *pointerType = dyn_cast<SpirvPointerType>(type))
   if (const auto *pointerType = dyn_cast<SpirvPointerType>(type))
     return isOrContains16BitType(pointerType->getPointeeType());
     return isOrContains16BitType(pointerType->getPointeeType());
-  if (const auto *raType = dyn_cast<MatrixType>(type))
+  if (const auto *raType = dyn_cast<RuntimeArrayType>(type))
     return isOrContains16BitType(raType->getElementType());
     return isOrContains16BitType(raType->getElementType());
   if (const auto *imgType = dyn_cast<ImageType>(type))
   if (const auto *imgType = dyn_cast<ImageType>(type))
     return isOrContains16BitType(imgType->getSampledType());
     return isOrContains16BitType(imgType->getSampledType());

+ 1 - 1
tools/clang/test/CodeGenSPIRV/vk.layout.16bit-types.sbuffer.hlsl

@@ -1,6 +1,6 @@
 // Run: %dxc -T ps_6_2 -E main -enable-16bit-types
 // Run: %dxc -T ps_6_2 -E main -enable-16bit-types
 
 
-// CHECK: OpCapability StorageBuffer16BitAccess
+// XXXXX: OpCapability StorageBuffer16BitAccess
 
 
 // CHECK: OpExtension "SPV_KHR_16bit_storage"
 // CHECK: OpExtension "SPV_KHR_16bit_storage"