[PATCH vkd3d v3 01/12] vkd3d-shader/hlsl: Add support for sm4 instruction modifiers.

Zebediah Figura (she/her) zfigura at codeweavers.com
Mon Dec 20 11:57:52 CST 2021


On 12/20/21 06:25, Francisco Casas wrote:
> December 17, 2021 6:21 PM, "Zebediah Figura (she/her)" <zfigura at codeweavers.com> wrote:
> 
>> On 12/17/21 13:12, Francisco Casas wrote:
>>
>>> Signed-off-by: Francisco Casas <fcasas at codeweavers.com>
>>> ---
>>> libs/vkd3d-shader/hlsl_sm4.c | 54 ++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 54 insertions(+)
>>> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
>>> index 2458018f..07bbd376 100644
>>> --- a/libs/vkd3d-shader/hlsl_sm4.c
>>> +++ b/libs/vkd3d-shader/hlsl_sm4.c
>>> @@ -727,6 +727,46 @@ static enum vkd3d_sm4_resource_type sm4_resource_dimension(const struct
>>> hlsl_typ
>>> }
>>> }
>>>> +struct sm4_instruction_modifier
>>> +{
>>> + enum vkd3d_sm4_instruction_modifier type;
>>> +
>>> + union
>>> + {
>>> + struct
>>> + {
>>> + int u,v,w;
>>> + } aoffimmi;
>>> + };
>>> +};
>>> +
>>> +static uint32_t sm4_encode_instruction_modifier(struct sm4_instruction_modifier imod)
>>
>> This should be a const pointer instead, I think.
> 
> Okay,
> Is there any reason besides avoiding copying in the pass-by-value?
> Or is it because it looks more consistent with the rest of the code?

Yes, I think in general we want to avoid pass-by-value. There are some 
examples of it elsewhere in the code but they should probably be fixed.



More information about the wine-devel mailing list