Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vulkan] Support for ti.u8 in vulkan #3247

Merged
merged 2 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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