HLSL offsetting

Zebediah Figura zfigura at codeweavers.com
Sat Jun 25 12:29:09 CDT 2022

On 6/24/22 23:46, Francisco Casas wrote:
> Hello,
> I attach the third version of the previous patch, applying the
> suggestions made by Zeb, and some other changes that arose from them.
> The patch is based on the master branch, but I guess I will have to
> update it if the recent patches from Giovanni are accepted, before
> sending it for review.

Is it not possible to split up this patch, as I had asked earlier?

There's also a couple things I notice from skimming:

* I think add_load() should also be split into deref / component 
versions. Most of its users only need to count components.

* Actually, should we be passing a deref instead of just a var to 
hlsl_new_component_load()? See e.g. add_cast(). That would make it a 
simple wrapper around hlsl_new_load_from_deref() [and the names would 
also need to be changed...] I'm not sure why I thought it made sense 
like this, frankly.

* Do we need to always split up matrices into scalars? Should we make 
non-contiguous loads a problem for parse time? As long as we're trying 
to keep backend-specific details out of the HLSL IR, that seems 
potentially reasonable; it'd just require emitting multiple copy 
instructions for some cases. That would allow us to simplify 
split_copy() and add_matrix_scalar_load(), and I believe would thus also 
get rid of the need to pass multiple offsets to hlsl_new_load_from_deref().

More information about the wine-devel mailing list