mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
a358722f71
The assumption that sampler registers never have a swizzle is not totally correct. For instance, for the following shader: Texture2D tex; sampler sam; float4 main() : sv_target { return tex.GatherGreen(sam, float2(0, 0)); } the gather instruction is being disassembled as gather4_indexable(texture2d) o0.xyzw, l(0.0, 0.0, 0.0, 0.0), t0.xyzw, s0 instead of gather4_indexable(texture2d)(float,float,float,float) o0.xyzw, l(0.0, 0.0, 0.0, 0.0), t0.xyzw, s0.y (notice the missing swizzle in the last parameter s0). This is because the Gather instructions give the sampler register a vec4 dimension (and scalar swizzle type) to indicate the channel for the gather operation. The solution is using the new vkd3d_shader_register.dimension instead of checking the swizzle type.