@@ -270,15 +270,21 @@ function Base.:(==)(x::SPIRType, y::SPIRType)
270270end
271271
272272function Base. hash (type:: SPIRType , h:: UInt )
273- h = hash (SPIRType, hash (type. typename, h))
274- @match type. typename begin
275- & SPIR_TYPE_FUNCTION => begin
276- (; rettype, argtypes) = type. function
277- hash (rettype, hash (argtypes, h))
278- end
279- & SPIR_TYPE_STRUCT => hash (type. struct. uuid, h)
280- _ => hash (type. data, h)
273+ h = @match type. typename begin
274+ & SPIR_TYPE_FLOAT => hash (type. float)
275+ & SPIR_TYPE_INTEGER => hash (type. integer)
276+ & SPIR_TYPE_VECTOR => hash (type. vector)
277+ & SPIR_TYPE_MATRIX => hash (type. matrix)
278+ & SPIR_TYPE_ARRAY => hash (type. array)
279+ & SPIR_TYPE_OPAQUE => hash (type. opaque)
280+ & SPIR_TYPE_IMAGE => hash (type. image)
281+ & SPIR_TYPE_SAMPLED_IMAGE => hash (type. image_type)
282+ & SPIR_TYPE_STRUCT => hash (type. struct. uuid)
283+ & SPIR_TYPE_POINTER => hash (type. pointer)
284+ & SPIR_TYPE_FUNCTION => hash (type. function)
285+ _ => hash (type. data)
281286 end
287+ hash (SPIRType, hash (type. typename, h))
282288end
283289
284290const IS_SPEC_CONST_FALSE = Ref (false )
0 commit comments