Re: [PATCH v4 0/2] MR188: vkd3d-shader/tpf: Add support for emitting sample_l instructions
I just realized one more thing. I think we are not properly following the specification for both sample_l and sample_b. In the **Restrictions** section of the documentation for sample_b it is mentioned that the last src register must use a single component selector if it is not a scalar immediate. This "select_component" is also ilustrated in the sample_l format: ``` sample_l[_aoffimmi(u,v,w)] dest[.mask], srcAddress[.swizzle], srcResource[.swizzle], srcSampler, srcLOD.select_component ``` Currently, we are not respecting that since sm4_src_from_node() sets ``` src->swizzle_type = VKD3D_SM4_SWIZZLE_VEC4; ``` by default. It should be VKD3D_SM4_SWIZZLE_SCALAR in this case. If I am not mistaken, a simple: ``` instr.srcs[3].swizzle_type = VKD3D_SM4_SWIZZLE_SCALAR; ``` after calling sm4_src_from_node() should do. The disassembly should show a single component in the swizzle of the last src register. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/188#note_31568
participants (1)
-
Francisco Casas (@fcasas)