On Fri Oct 21 14:45:42 2022 +0000, Francisco Casas wrote:
These assertions fail when the object loaded is a member of a struct or array, for instance, with the following test:
[uav 2] size (1, 1) 0.1 0.2 0.3 0.4 [uav 3] size (1, 1) 0.5 0.6 0.7 0.8 [pixel shader] RWTexture2D<float4> u[2] : register(u3); float4 main() : sv_target1 { u[0][uint2(0, 0)] = float4(1.1, 1.2, 1.3, 1.4); u[1][uint2(0, 0)] = float4(2.1, 2.2, 2.3, 2.4); return 0; } [test] draw quad probe uav 2 (0, 0) rgba (1.1, 1.2, 1.3, 1.4) probe uav 3 (0, 0) rgba (2.1, 2.2, 2.3, 2.4)
It may be good to replace them with an hlsl_fixme for now, similar to the one we have in write_sm4_resource_load():
if (resource_type->type != HLSL_CLASS_OBJECT) { assert(resource_type->type == HLSL_CLASS_ARRAY || resource_type->type == HLSL_CLASS_STRUCT); hlsl_fixme(ctx, &load->node.loc, "Resource being a component of another variable."); return; }
Or outright supporting those cases if it proves to be simple enough.
Turns out it is quite simple, so I've added it in v2, and also your test. Thanks!