Unfortunate. How does this interact with the target environment? I.e., does this patch do the right thing when VKD3D_SHADER_SPIRV_ENVIRONMENT_OPENGL_4_5 is specified?
The GL spec (and the ARB_gl_spirv spec), as far as I can find, is annoyingly vague about how GLSL sampler types correspond to GL texture bindings, and doesn't seem to specify at all how SPIR-V image types correspond to GL texture bindings (or, for that matter, how GLSL sampler types correspond to SPIR-V image types).
I can only assume that sampler2D <-> SPIRV MS = 0 <-> GL_TEXTURE_2D, and sampler2DMS <-> SPIRV MS = 1 <-> GL_TEXTURE_2D_MULTISAMPLE. That seems like the only reasonable mapping, and it'd be consistent with how GLSL maps to GL when SPIR-V isn't involved. In that case this patch should do the right thing.