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