diff --git a/tools/clang/include/clang/SPIRV/SpirvBuilder.h b/tools/clang/include/clang/SPIRV/SpirvBuilder.h index 1a80d8fde..08fcfcff9 100644 --- a/tools/clang/include/clang/SPIRV/SpirvBuilder.h +++ b/tools/clang/include/clang/SPIRV/SpirvBuilder.h @@ -688,8 +688,9 @@ public: SpirvString *getString(llvm::StringRef str); - const HybridPointerType* getPhysicalStorageBufferType(QualType pointee); - const SpirvPointerType *getPhysicalStorageBufferType(const SpirvType* pointee); + const HybridPointerType *getPhysicalStorageBufferType(QualType pointee); + const SpirvPointerType * + getPhysicalStorageBufferType(const SpirvType *pointee); public: std::vector takeModule(); @@ -796,9 +797,10 @@ private: void SpirvBuilder::requireCapability(spv::Capability cap, SourceLocation loc) { auto *capability = new (context) SpirvCapability(loc, cap); if (mod->addCapability(capability)) { - if (cap == spv::Capability::PhysicalStorageBufferAddresses) { - mod->promoteAddressingModel(spv::AddressingModel::PhysicalStorageBuffer64); - } + if (cap == spv::Capability::PhysicalStorageBufferAddresses) { + mod->promoteAddressingModel( + spv::AddressingModel::PhysicalStorageBuffer64); + } } else { capability->releaseMemory(); } diff --git a/tools/clang/include/clang/SPIRV/SpirvInstruction.h b/tools/clang/include/clang/SPIRV/SpirvInstruction.h index 77aee344b..16a6d2e4c 100644 --- a/tools/clang/include/clang/SPIRV/SpirvInstruction.h +++ b/tools/clang/include/clang/SPIRV/SpirvInstruction.h @@ -330,7 +330,9 @@ public: spv::AddressingModel getAddressingModel() const { return addressModel; } spv::MemoryModel getMemoryModel() const { return memoryModel; } - void setAddressingModel(spv::AddressingModel addrModel) { addressModel = addrModel; } + void setAddressingModel(spv::AddressingModel addrModel) { + addressModel = addrModel; + } private: spv::AddressingModel addressModel; @@ -1868,8 +1870,8 @@ public: SpirvUnaryOp(spv::Op opcode, QualType resultType, SourceLocation loc, SpirvInstruction *op); - SpirvUnaryOp(spv::Op opcode, const SpirvType* resultType, SourceLocation loc, - SpirvInstruction* op); + SpirvUnaryOp(spv::Op opcode, const SpirvType *resultType, SourceLocation loc, + SpirvInstruction *op); DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvUnaryOp) diff --git a/tools/clang/lib/SPIRV/FeatureManager.cpp b/tools/clang/lib/SPIRV/FeatureManager.cpp index 6d3a9e31e..52549cd2b 100644 --- a/tools/clang/lib/SPIRV/FeatureManager.cpp +++ b/tools/clang/lib/SPIRV/FeatureManager.cpp @@ -143,7 +143,8 @@ Extension FeatureManager::getExtensionSymbol(llvm::StringRef name) { .Case("SPV_KHR_fragment_shading_rate", Extension::KHR_fragment_shading_rate) .Case("SPV_EXT_shader_image_int64", Extension::EXT_shader_image_int64) - .Case("SPV_KHR_physical_storage_buffer", Extension::KHR_physical_storage_buffer) + .Case("SPV_KHR_physical_storage_buffer", + Extension::KHR_physical_storage_buffer) .Default(Extension::Unknown); } @@ -198,7 +199,7 @@ const char *FeatureManager::getExtensionName(Extension symbol) { case Extension::EXT_shader_image_int64: return "SPV_EXT_shader_image_int64"; case Extension::KHR_physical_storage_buffer: - return "SPV_KHR_physical_storage_buffer"; + return "SPV_KHR_physical_storage_buffer"; default: break; } diff --git a/tools/clang/lib/SPIRV/SpirvEmitter.h b/tools/clang/lib/SPIRV/SpirvEmitter.h index f91a51131..1eb90deb6 100644 --- a/tools/clang/lib/SPIRV/SpirvEmitter.h +++ b/tools/clang/lib/SPIRV/SpirvEmitter.h @@ -594,9 +594,8 @@ private: /// Process spirv intrinsic instruction SpirvInstruction *processSpvIntrinsicCallExpr(const CallExpr *expr); - /// Custom intrinsic to support basic buffer_reference use case - SpirvInstruction *processRawBufferLoad(const CallExpr* callExpr); + SpirvInstruction *processRawBufferLoad(const CallExpr *callExpr); private: /// Returns the for constant value 0 of the given type. diff --git a/tools/clang/lib/SPIRV/SpirvInstruction.cpp b/tools/clang/lib/SPIRV/SpirvInstruction.cpp index d511ae741..7d8eadb19 100644 --- a/tools/clang/lib/SPIRV/SpirvInstruction.cpp +++ b/tools/clang/lib/SPIRV/SpirvInstruction.cpp @@ -756,7 +756,8 @@ void SpirvLoad::setAlignment(uint32_t alignment) { if (!memoryAccess.hasValue()) { memoryAccess = spv::MemoryAccessMask::Aligned; } else { - memoryAccess.getValue() = memoryAccess.getValue() | spv::MemoryAccessMask::Aligned; + memoryAccess.getValue() = + memoryAccess.getValue() | spv::MemoryAccessMask::Aligned; } memoryAlignment = alignment; } @@ -807,10 +808,9 @@ SpirvUnaryOp::SpirvUnaryOp(spv::Op opcode, QualType resultType, : SpirvInstruction(IK_UnaryOp, opcode, resultType, loc), operand(op) {} SpirvUnaryOp::SpirvUnaryOp(spv::Op opcode, const SpirvType *resultType, - SourceLocation loc, SpirvInstruction* op) - : SpirvInstruction(IK_UnaryOp, opcode, QualType(), loc), operand(op) -{ - setResultType(resultType); + SourceLocation loc, SpirvInstruction *op) + : SpirvInstruction(IK_UnaryOp, opcode, QualType(), loc), operand(op) { + setResultType(resultType); } bool SpirvUnaryOp::isConversionOp() const {