d3dx9: Implement adjacency in D3DXCreateSphere

Nozomi Kodama nozomi.kodama at yahoo.com
Mon Jun 24 18:41:16 CDT 2013


Hello

Thank you for the feedback, Rico.

But, there is a problem with this patch.  Native d3dx9 does not call GenerateAdjacency. It hardcodes the adjacency. That is proved by the case D3DXCreateSpehere(device, 0.0f, 10,10,adjacency) where native gives different result using GenerateAdjacency or not. I need thinking more how to hardcode adjacency.


The side effect is to show there is a bug in our built-in GenerateAdjacency


Nozomi



________________________________
 De : Rico Schüller <kgbricola at web.de>
À : Nozomi Kodama <nozomi.kodama at yahoo.com> 
Cc : wine-devel at winehq.org 
Envoyé le : Vendredi 21 juin 2013 23h24
Objet : Re: d3dx9: Implement adjacency in D3DXCreateSphere
 

On 20.06.2013 21:25, Nozomi Kodama wrote:
> +    if (adjacency)
> +    {
> +        DWORD *buffer, size;
> +        ID3DXBuffer *temp;
> +
> +        size = 3 * sphere->lpVtbl->GetNumFaces(sphere) * sizeof(DWORD);
> +        hr = D3DXCreateBuffer(size, &temp);
> +        if (hr != D3D_OK)
> +            return hr;
> +
> +        buffer = (DWORD *)(ID3DXBuffer_GetBufferPointer(temp));
Are the outer parentheses needed? Is the cast needed?

> +        hr = sphere->lpVtbl->GenerateAdjacency(sphere, -0.000001f, buffer);
> +        if (hr != D3D_OK)
> +            return hr;
This may leak the temp ID3DXBuffer in the error case.

Cheers
Rico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130625/aac1d27e/attachment.html>


More information about the wine-devel mailing list