[PATCH vkd3d 3/5] vkd3d-shader/hlsl: Write SM4 negation instructions.
Zebediah Figura (she/her)
zfigura at codeweavers.com
Tue Aug 31 20:24:50 CDT 2021
On 8/31/21 6:33 PM, Matteo Bruni wrote:
> On Mon, Aug 30, 2021 at 7:21 PM Zebediah Figura <zfigura at codeweavers.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
>> ---
>> Makefile.am | 5 +----
>> libs/vkd3d-shader/hlsl_sm4.c | 32 ++++++++++++++++++++++++++++++++
>> 2 files changed, 33 insertions(+), 4 deletions(-)
>
>> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
>> index ace2eb66..160da47f 100644
>> --- a/libs/vkd3d-shader/hlsl_sm4.c
>> +++ b/libs/vkd3d-shader/hlsl_sm4.c
>> @@ -561,6 +561,7 @@ struct sm4_register
>> unsigned int idx_count;
>> enum vkd3d_sm4_dimension dim;
>> uint32_t immconst_uint[4];
>> + unsigned int mod;
>> };
>>
>> struct sm4_instruction
>> @@ -710,6 +711,8 @@ static uint32_t sm4_register_order(const struct sm4_register *reg)
>> if (reg->type == VKD3D_SM4_RT_IMMCONST)
>> order += reg->dim == VKD3D_SM4_DIMENSION_VEC4 ? 4 : 1;
>> order += reg->idx_count;
>> + if (reg->mod)
>> + ++order;
>> return order;
>> }
>
> Something that came to my mind at least twice while looking at that
> function... Do you know e.g. by random looks to DXC's sources what the
> size of a register in the bytecode is supposed to be called? "Order"
> feels like a curious choice for a name.
>
> No need to go investigate, just wondering if you happened to see anything.
>
I recently discovered that the SM4 format is effectively documented in
headers released with the DDK, namely "d3d10tokenizedprogramformat.hpp"
and similar. Anyway, their version of SM4_REGISTER_ORDER_* is
D3D10_SB_OPERAND_INDEX_DIMENSION_*.
More information about the wine-devel
mailing list