Hi,
Il 15/10/21 04:39, Zebediah Figura ha scritto:
Not that HLSL is a pinnacle of good language design, but I'm sure if this weren't C I'd find it more idiomatic.
That's funny: passing pointer is precisely what I would consider the idiomatic C way to return more than one value. Even for HLSL, out parameter essentially have the semantics of passing by reference instead of by value, AFAIK.
(we still have the Microsoft way, though: return type << 16 | dimx << 8 | dimy, would that be better? :-P)
As it is I still have a mild preference for avoiding the output parameters, just for the sake of what I see as idiomatic code, but I won't object if you keep it the way it is.
I think in this case I'd prefer to keep the way it is, but I'll concede for 5/6, which hopefully can be a good compromise for you.
Giovanni.