Skip to content

Commit

Permalink
revert BufferArgument change
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Apr 10, 2021
1 parent fb27fbb commit 69f2d05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/target/spirv/codegen_spirv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include <string>

#include "../../runtime/vulkan/vulkan_common.h"
#include "../../runtime/pack_args.h"
#include "../../runtime/vulkan/vulkan_common.h"

namespace tvm {
namespace codegen {
Expand Down
13 changes: 6 additions & 7 deletions src/target/spirv/ir_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 2 additions & 7 deletions src/target/spirv/ir_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<SType>& 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
Expand Down

0 comments on commit 69f2d05

Please sign in to comment.