[v2 PATCH 7/7] d3d10/effect: Add initial support for indexing expressions.

Nikolay Sivov nsivov at codeweavers.com
Tue Nov 2 16:27:17 CDT 2021



On 11/2/21 11:47 PM, Matteo Bruni wrote:
> On Mon, Nov 1, 2021 at 11:52 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
>> ---
>>  dlls/d3d10/effect.c       | 556 +++++++++++++++++++++++++++++++++++++-
>>  dlls/d3d10/tests/effect.c | 114 ++++++++
>>  2 files changed, 669 insertions(+), 1 deletion(-)
> Still looking into this one. For the time being I have a single
> nitpick, probably not worth acting on it just yet:
>
>> diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
>> index 78a3d0c386a..3ae2ad4f481 100644
>> --- a/dlls/d3d10/effect.c
>> +++ b/dlls/d3d10/effect.c
>> @@ -30,6 +30,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
>>      ((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
>>  #define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
>>  #define TAG_FX10 MAKE_TAG('F', 'X', '1', '0')
>> +#define TAG_FXLC MAKE_TAG('F', 'X', 'L', 'C')
>> +#define TAG_CLI4 MAKE_TAG('C', 'L', 'I', '4')
>> +#define TAG_CTAB MAKE_TAG('C', 'T', 'A', 'B')
>>
>>  #define D3D10_FX10_TYPE_COLUMN_SHIFT    11
>>  #define D3D10_FX10_TYPE_COLUMN_MASK     (0x7 << D3D10_FX10_TYPE_COLUMN_SHIFT)
>> @@ -180,6 +183,89 @@ static enum d3d10_effect_container_type get_var_container_type(const struct d3d1
>>      }
>>  }
>>
>> +struct preshader_instr
>> +{
>> +    unsigned int comp_count : 16;
>> +    unsigned int reserved   :  4;
>> +    unsigned int opcode     : 11;
>> +    unsigned int scalar     :  1;
>> +};
>> +
>> +typedef float (*pres_op_func)(float **args, unsigned int n);
>> +
>> +static float pres_ftou(float **args, unsigned int n)
>> +{
>> +    unsigned int u = *args[0];
>> +    return *(float *)&u;
>> +}
>> +
>> +static float pres_add(float **args, unsigned int n)
>> +{
>> +    return *args[0] + *args[1];
>> +}
>> +
>> +enum preshader_op
>> +{
>> +    D3D10_PRESHADER_OP_FTOU = 0,
>> +    D3D10_PRESHADER_OP_ADD,
>> +    D3D10_PRESHADER_OP_LAST_OP,
>> +};
>> +
>> +struct preshader_op_info
>> +{
>> +    unsigned short idx;
>> +    unsigned short opcode;
>> +    char name[8];
>> +    pres_op_func func;
>> +};
> idx is an enum preshader_op, right? Any reason you're not using that
> type? The field name seems to have room for improvement too (although
> I realize the trouble with "opcode" also there).
Correct, it's that enum. Strictly speaking I don't need that field at
all, for static array like that I can always use pointer value to get
the index.



More information about the wine-devel mailing list