Browse Source

[spirv] Remove unused method getGlPerVertexStruct() (#1267)

Lei Zhang 7 years ago
parent
commit
a8752663c3
2 changed files with 0 additions and 46 deletions
  1. 0 33
      tools/clang/lib/SPIRV/TypeTranslator.cpp
  2. 0 13
      tools/clang/lib/SPIRV/TypeTranslator.h

+ 0 - 33
tools/clang/lib/SPIRV/TypeTranslator.cpp

@@ -671,39 +671,6 @@ uint32_t TypeTranslator::getACSBufferCounter() {
                                   decorations);
 }
 
-uint32_t TypeTranslator::getGlPerVertexStruct(
-    uint32_t clipArraySize, uint32_t cullArraySize, llvm::StringRef name,
-    const llvm::SmallVector<std::string, 4> &fieldSemantics) {
-  const uint32_t f32Type = theBuilder.getFloat32Type();
-  const uint32_t v4f32Type = theBuilder.getVecType(f32Type, 4);
-  const uint32_t clipType = theBuilder.getArrayType(
-      f32Type, theBuilder.getConstantUint32(clipArraySize));
-  const uint32_t cullType = theBuilder.getArrayType(
-      f32Type, theBuilder.getConstantUint32(cullArraySize));
-
-  auto &ctx = *theBuilder.getSPIRVContext();
-  llvm::SmallVector<const Decoration *, 1> decorations;
-
-  decorations.push_back(Decoration::getBuiltIn(ctx, spv::BuiltIn::Position, 0));
-  decorations.push_back(
-      Decoration::getBuiltIn(ctx, spv::BuiltIn::PointSize, 1));
-  decorations.push_back(
-      Decoration::getBuiltIn(ctx, spv::BuiltIn::ClipDistance, 2));
-  decorations.push_back(
-      Decoration::getBuiltIn(ctx, spv::BuiltIn::CullDistance, 3));
-  decorations.push_back(Decoration::getBlock(ctx));
-
-  if (spirvOptions.enableReflect) {
-    for (uint32_t i = 0; i < 4; ++i)
-      if (!fieldSemantics[i].empty())
-        decorations.push_back(
-            Decoration::getHlslSemanticGOOGLE(ctx, fieldSemantics[i], i));
-  }
-
-  return theBuilder.getStructType({v4f32Type, f32Type, clipType, cullType},
-                                  name, {}, decorations);
-}
-
 bool TypeTranslator::isScalarType(QualType type, QualType *scalarType) {
   bool isScalar = false;
   QualType ty = {};

+ 0 - 13
tools/clang/lib/SPIRV/TypeTranslator.h

@@ -65,19 +65,6 @@ public:
   /// integer value. This type will be decorated with BufferBlock.
   uint32_t getACSBufferCounter();
 
-  /// \brief Returns the type for the gl_PerVertex struct:
-  ///
-  /// struct gl_PerVertex {
-  ///   float4 gl_Position;
-  ///   float  gl_PointSize;
-  ///   float  gl_ClipDistance[];
-  ///   float  gl_CullDistance[];
-  /// };
-  uint32_t
-  getGlPerVertexStruct(uint32_t clipArraySize, uint32_t cullArraySize,
-                       llvm::StringRef structName,
-                       const llvm::SmallVector<std::string, 4> &fieldSemantics);
-
   /// \brief Returns true if the given type is a (RW)StructuredBuffer type.
   static bool isStructuredBuffer(QualType type);