diff --git a/src/target/spirv/codegen_spirv.cc b/src/target/spirv/codegen_spirv.cc index 371877a7dab8..9ff18e9b3529 100644 --- a/src/target/spirv/codegen_spirv.cc +++ b/src/target/spirv/codegen_spirv.cc @@ -30,8 +30,8 @@ #include -#include "../../runtime/vulkan/vulkan_common.h" #include "../../runtime/pack_args.h" +#include "../../runtime/vulkan/vulkan_common.h" namespace tvm { namespace codegen { diff --git a/src/target/spirv/ir_builder.cc b/src/target/spirv/ir_builder.cc index 41e5fe1b99d4..1b56fee19578 100644 --- a/src/target/spirv/ir_builder.cc +++ b/src/target/spirv/ir_builder.cc @@ -185,15 +185,14 @@ Value IRBuilder::FloatImm(const SType& dtype, double value) { } Value IRBuilder::BufferArgument(const SType& value_type, uint32_t descriptor_set, - uint32_t binding, bool uniform) { + uint32_t binding) { // NOTE: BufferBlock was deprecated in SPIRV 1.3 // use StorageClassStorageBuffer instead. - spv::StorageClass storage_class; - if (uniform) { - storage_class = spv::StorageClassUniform; - } else { - storage_class = spv::StorageClassStorageBuffer; - } +#if SPV_VERSION >= 0x10300 + spv::StorageClass storage_class = spv::StorageClassStorageBuffer; +#else + spv::StorageClass storage_class = spv::StorageClassUniform; +#endif SType sarr_type = GetStructArrayType(value_type, 0); SType ptr_type = GetPointerType(sarr_type, storage_class); diff --git a/src/target/spirv/ir_builder.h b/src/target/spirv/ir_builder.h index d8627f02c3e7..0dae60f6da72 100644 --- a/src/target/spirv/ir_builder.h +++ b/src/target/spirv/ir_builder.h @@ -472,7 +472,7 @@ class IRBuilder { * \param binding The binding locaiton in descriptor set. * \param The argument type. */ - Value BufferArgument(const SType& value_type, uint32_t descriptor_set, uint32_t binding, bool uniform=false); + Value BufferArgument(const SType& value_type, uint32_t descriptor_set, uint32_t binding); /*! * \brief Declare POD arguments through push constants. @@ -490,13 +490,8 @@ class IRBuilder { */ Value GetPushConstant(Value ptr_push_const, const SType& v_type, uint32_t index); + // TODO doc Value DeclareUBO(const std::vector& value_types, uint32_t binding); - /*! - * \brief Get i-th push constant - * \param v_type The value type - * \param index The push constant index - * \return the value of push constant - */ Value GetUBO(Value ptr_ubo, const SType& v_type, uint32_t index); /*! * \brief Declare a new function