mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-04 07:34:15 +08:00
compiler/types: fix serialization of cooperative matrix
Encoding of cmat_desc is overwriting the base_type with the type of the
elements of the matrix.
Fixes: 2d0f4f2c17
("compiler/types: Add support for Cooperative Matrix types")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28086>
This commit is contained in:
parent
fc2b619621
commit
e1b66f9707
@ -3161,6 +3161,11 @@ encode_type_to_blob(struct blob *blob, const glsl_type *type)
|
|||||||
encode_type_to_blob(blob, type->fields.array);
|
encode_type_to_blob(blob, type->fields.array);
|
||||||
return;
|
return;
|
||||||
case GLSL_TYPE_COOPERATIVE_MATRIX:
|
case GLSL_TYPE_COOPERATIVE_MATRIX:
|
||||||
|
/* The first 5 bits of encoded/decoded are used to identify the
|
||||||
|
* actual type, but cmat_desc already is 32-bit without that tag, so
|
||||||
|
* encode just the cmat base type first, then the actual cmat desc.
|
||||||
|
*/
|
||||||
|
blob_write_uint32(blob, encoded.u32);
|
||||||
encoded.cmat_desc = type->cmat_desc;
|
encoded.cmat_desc = type->cmat_desc;
|
||||||
blob_write_uint32(blob, encoded.u32);
|
blob_write_uint32(blob, encoded.u32);
|
||||||
return;
|
return;
|
||||||
@ -3271,6 +3276,7 @@ decode_type_from_blob(struct blob_reader *blob)
|
|||||||
explicit_stride);
|
explicit_stride);
|
||||||
}
|
}
|
||||||
case GLSL_TYPE_COOPERATIVE_MATRIX: {
|
case GLSL_TYPE_COOPERATIVE_MATRIX: {
|
||||||
|
encoded.u32 = blob_read_uint32(blob);
|
||||||
return glsl_cmat_type(&encoded.cmat_desc);
|
return glsl_cmat_type(&encoded.cmat_desc);
|
||||||
}
|
}
|
||||||
case GLSL_TYPE_STRUCT:
|
case GLSL_TYPE_STRUCT:
|
||||||
|
Loading…
Reference in New Issue
Block a user