Skip to content

Commit

Permalink
[spirv] Fix generating array type in SPIR-V
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed Apr 21, 2023
1 parent 570d249 commit 8f35995
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions taichi/codegen/spirv/spirv_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,10 @@ class Translate2Spirv : public TypeVisitor {

void visit_array_type(const ArrayType *type) override {
SType vt = spir_builder_->get_null_type();
spir_builder_->declare_global(spv::OpTypeArray, vt,
ir_node_2_spv_value[type->element_type()],
type->get_constant_shape()[0]);
spir_builder_->declare_global(
spv::OpTypeArray, vt, ir_node_2_spv_value[type->element_type()],
spir_builder_->int_immediate_number(spir_builder_->i32_type(),
type->get_constant_shape()[0]));
ir_node_2_spv_value[type] = vt.id;
spir_builder_->decorate(spv::OpDecorate, vt, spv::DecorationArrayStride,
type->memory_alignment_size(layout_context_));
Expand Down

0 comments on commit 8f35995

Please sign in to comment.