Skip to content

Commit

Permalink
[vulkan] Support for ti.u8 in vulkan (#3247)
Browse files Browse the repository at this point in the history
* u8

* remove legacy comments
  • Loading branch information
AmesingFlank authored Oct 22, 2021
1 parent 48c8c7d commit 6aa2fd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions taichi/backends/vulkan/data_type_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ namespace lang {
namespace vulkan {

inline std::size_t vk_data_type_size(DataType dt) {
// Vulkan buffers require a minimum alignment of 4 bytes.
// https://vulkan-tutorial.com/Uniform_buffers/Descriptor_pool_and_sets#page_Alignment-requirements
return std::max(data_type_size(dt), 4);
return data_type_size(dt);
}

} // namespace vulkan
Expand Down
3 changes: 3 additions & 0 deletions taichi/backends/vulkan/spirv_ir_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ SType IRBuilder::get_primitive_buffer_type(const bool struct_compiled,
} else if (dt->is_primitive(PrimitiveTypeID::i64) &&
device_->get_cap(cap::spirv_has_atomic_i64)) {
return t_int64_;
} else if (dt->is_primitive(PrimitiveTypeID::u8) &&
device_->get_cap(cap::spirv_has_int8)) {
return t_uint8_;
}
}
return t_int32_;
Expand Down

0 comments on commit 6aa2fd1

Please sign in to comment.