Ver código fonte

shaderpipeline: Fix UBO matrix stride for shader gen in Vulkan

rdb 1 ano atrás
pai
commit
6e6115ad0b
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      panda/src/shaderpipeline/spirVTransformPass.cxx

+ 1 - 1
panda/src/shaderpipeline/spirVTransformPass.cxx

@@ -1002,7 +1002,7 @@ r_annotate_struct_layout(uint32_t type_id) {
     if (const ShaderType::Matrix *matrix_type = base_type->as_matrix()) {
       // Matrix types need to be explicitly laid out.
       add_annotation(spv::OpMemberDecorate,
-        {type_id, i, spv::DecorationMatrixStride, matrix_type->get_num_columns() * 4});
+        {type_id, i, spv::DecorationMatrixStride, (matrix_type->get_scalar_type() == ShaderType::ST_double) ? 32 : 16});
       add_annotation(spv::OpMemberDecorate,
         {type_id, i, spv::DecorationColMajor});
     } else {