Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
struct hlsl_ir_node *load; bool multisampled;
+ if (object_type->sampler_dim == HLSL_SAMPLER_DIM_BUFFER + || object_type->sampler_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER) + { + return add_buffer_load_method_call(ctx, instrs, object, name, params, loc); + }
As I said somewhere else, I don't like this kind of control flow too much. Something in the form: ```c if (condition) { return f(); } // do work ``` seems to suggest that `f()` is somehow an exceptional or simpler case of the main branch. Here that's not the case: the two branches are essentially equivalent. So I would rather move the main branch in a dedicated helper too and have something like: ```c if (condition) return f(); else return g(); ``` which suggests symmetry between the two alternatives. Something I would like even more is to add a knowledge of the supported classes directly in `struct method_function`, but that's more complicated so I'm not necessarily pushing for that. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/234#note_35601