Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/spirv.c:
else { val_id = vkd3d_spirv_build_op_image_query_size(builder, type_id, image.image_id); - /* For UAVs the returned miplevel count is always 1. */ - miplevel_count_id = spirv_compiler_get_constant_uint(compiler, 1); + if (image.resource_type_info->ms && instruction->flags == VKD3DSI_RESINFO_UINT_DST) + { + /* In this case resinfo must also return the sample count. */ + type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_UINT, 1); + miplevel_count_id = vkd3d_spirv_build_op_image_query_samples(builder, type_id, image.image_id); + } + else + { + /* For UAVs the returned miplevel count is always 1. */ + miplevel_count_id = spirv_compiler_get_constant_uint(compiler, 1); + }
Mmmh, I think we're packing too much content into this single bit: this doesn't just control the destination type, but also putting the sample count in the last component. And `resinfo` feels to me already quite overloaded, I wouldn't add more stuff to it. Could the DXIL frontend call `resinfo` and `sampleinfo` and then stitch the results together as needed? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/629#note_60183