Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_sm4.c:
const struct hlsl_type *resource_type, const struct hlsl_ir_node *dst, const struct hlsl_deref *resource, const struct hlsl_ir_node *coords)
{
bool uav = (resource_type->base_type == HLSL_TYPE_UAV); struct sm4_instruction instr; unsigned int dim_count;
memset(&instr, 0, sizeof(instr));
- instr.opcode = VKD3D_SM4_OP_LD;
- instr.opcode = uav ? VKD3D_SM5_OP_LD_UAV_TYPED : VKD3D_SM4_OP_LD;
It seems that the native compiler generates instructions like this: ``` ld_uav_typed_indexable(texture2d)(float,float,float,float) r0.xyzw, l(0, 0, 0, 0), u2.xyzw ``` The instruction you generate miss the `_indexable(texture2d)` bit. AFAIU that would require adding a modifier of type `VKD3D_SM5_MODIFIER_RESOURCE_TYPE`. Is it intentional?
I guess that if the compiled shader is fed to vkd3d/wine we don't care too much about that field, but should we write it any way in the interest of compatibility with native?