Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/fx.c:
+ { + if (!(var->storage_modifiers & HLSL_STORAGE_UNIFORM) || hlsl_type_is_resource(var->data_type)) + continue; + + if (hlsl_var_has_buffer_offset_register_reservation(ctx, var)) + hlsl_calculate_buffer_offset(ctx, var, true); + } + + LIST_FOR_EACH_ENTRY(var, &ctx->globals->vars, struct hlsl_ir_var, scope_entry) + { + if (!(var->storage_modifiers & HLSL_STORAGE_UNIFORM) || hlsl_type_is_resource(var->data_type)) + continue; + + if (!hlsl_var_has_buffer_offset_register_reservation(ctx, var)) + hlsl_calculate_buffer_offset(ctx, var, false); + } Duplicating this code is a bit unfortunate. Can we use a helper instead?
Also, what about the rest of allocate_buffers()? Should we be moving things to $Params? validate_buffer_offsets()? Is buffer binding allocation validated, even if it's not going to be used? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/636#note_61208