From 53a1d49d16251cda2c45ca2992ea599028c5dac7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2021 01:36:54 +0100 Subject: [PATCH 1/2] u8 --- taichi/backends/vulkan/data_type_utils.h | 2 +- taichi/backends/vulkan/spirv_ir_builder.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/taichi/backends/vulkan/data_type_utils.h b/taichi/backends/vulkan/data_type_utils.h index c837a9d6d39d3..ee2ae90fbc35a 100644 --- a/taichi/backends/vulkan/data_type_utils.h +++ b/taichi/backends/vulkan/data_type_utils.h @@ -12,7 +12,7 @@ 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 diff --git a/taichi/backends/vulkan/spirv_ir_builder.cpp b/taichi/backends/vulkan/spirv_ir_builder.cpp index 0203558c36ff1..725ca8964396d 100644 --- a/taichi/backends/vulkan/spirv_ir_builder.cpp +++ b/taichi/backends/vulkan/spirv_ir_builder.cpp @@ -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_; From 17688375766dc7c424bebffd773952d83faaffdf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2021 01:38:11 +0100 Subject: [PATCH 2/2] remove legacy comments --- taichi/backends/vulkan/data_type_utils.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/taichi/backends/vulkan/data_type_utils.h b/taichi/backends/vulkan/data_type_utils.h index ee2ae90fbc35a..8d95e33bfde44 100644 --- a/taichi/backends/vulkan/data_type_utils.h +++ b/taichi/backends/vulkan/data_type_utils.h @@ -10,8 +10,6 @@ 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 data_type_size(dt); }