Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.l:
return {return KW_RETURN; } register {return KW_REGISTER; } RWBuffer {return KW_RWBUFFER; } +RWStructuredBuffer {return KW_RWSTRUCTUREDBUFFER; }
With this patch the HLSL compiler will accept this program: ``` RWStructuredBuffer<float4> u : register(u2);
float4 main() : sv_target1 { u[0] = float4(11.1, 12.2, 13.3, 14.4); return 0; } ``` but will generate this code: ``` ps_5_0 dcl_uav_structured u2, 16 dcl_output o1.xyzw dcl_temps 2 mov r0.xyzw, l(1.11000004e+01, 1.21999998e+01, 1.33000002e+01, 1.43999996e+01) mov r1.x, l(0.00000000e+00) store_uav_typed u2.xyzw, r1.x, r0.xyzw mov r0.xyzw, l(0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00) mov o1.xyzw, r0.xyzw ret ``` where opcode `store_uav_types` is used to store to a structured buffer. I guess that's incorrect, given that native uses `store_structured`. It's fine to keep the patch, but please emit a fixme when trying to write to the resource.