[PATCH v2] wined3d: Decompress DXTn 3D textures on upload.

Connor McAdams conmanx360 at gmail.com
Sun Aug 12 20:25:16 CDT 2018


Yeah, I can. I think the conclusion that was came to in IRC at some
point though was that it would turn out to be pretty ugly... Might
need some back and forth on the specifics of doing it.

On Sun, Aug 12, 2018 at 5:55 PM, Matteo Bruni <matteo.mystral at gmail.com> wrote:
> On Mon, Aug 6, 2018 at 11:05 PM Henri Verbeet <hverbeet at codeweavers.com> wrote:
>>
>> From: Connor McAdams <conmanx360 at gmail.com>
>
>> +        /* Note that uploading 3D textures may require quite some address
>> +         * space; it may make sense to upload them per-slice instead. */
>
> I think Connor wrote (but probably didn't send) a version of this
> patch doing exactly that. Actually IIRC that was necessary to avoid
> running out of address space in Halo Online.
> Connor, do you want to prepare a followup patch to improve on that?
>
> Tiny nitpick:
>
>> +static void build_dxtn_alpha_table(BYTE alpha0, BYTE alpha1, BYTE alpha_table[8])
>> +{
>> +    unsigned int i;
>> +
>> +    alpha_table[0] = alpha0;
>> +    alpha_table[1] = alpha1;
>> +
>> +    if (alpha0 > alpha1)
>> +    {
>> +        for (i = 0; i < 6; ++i)
>> +        {
>> +            alpha_table[2 + i] = ((6 - i) * alpha0 + (i + 1) * alpha1) / 7;
>> +        }
>> +        return;
>> +    }
>> +    else
>> +    {
>> +        for (i = 0; i < 4; ++i)
>> +        {
>> +            alpha_table[2 + i] = ((4 - i) * alpha0 + (i + 1) * alpha1) / 5;
>> +        }
>> +        alpha_table[6] = 0x00;
>> +        alpha_table[7] = 0xff;
>> +    }
>> +}
>
> Technically this is DXT5 / BC3 only, the function name could reflect that.
>
>



More information about the wine-devel mailing list