[v2 6/6] d3dx9: Support parameters sharing in effect.
Paul Gofman
gofmanp at gmail.com
Tue Apr 25 11:24:54 CDT 2017
On 04/25/2017 07:09 PM, Matteo Bruni wrote:
>
>>>> static void free_effect_pool(struct d3dx_effect_pool *pool)
>>>> {
>>>> + unsigned int i;
>>>> +
>>>> + for (i = 0; i < pool->table_size; ++i)
>>>> + {
>>>> + if (pool->shared_data[i].refcount)
>>>> + ERR("Releasing pool with referenced parameters, shared data
>>>> is not freed.\n");
>>>> + }
>>> This can be triggered by an application so it should be a WARN().
>>> BTW, this probably needs a test. On pool destruction, the effects
>>> still using it might be "unshared" i.e. data from the pool might be
>>> moved back to the effects. Or maybe the effects still using the pool
>>> are simply broken and accessing parameter data after the pool is
>>> destroyed crashes.
>>>
>>>
>> Yes, sure, there is one of the marginal cases to be tested more (probably
>> along with more precise understanding on how shared shader parameters
>> setting works when sharing non-NULL and NULL shader). Until then maybe we
>> could leave something more severe than WARN here, as if we reach this point
>> it most likely mean that something is wrong and it would be nice to have an
>> indication right away.
> I think we want to know what happens before we go ahead with the code above.
>
I just tested, manually releasing pool before effect just crash when I
use native d3dx dll. Please see attached patch. I have to do release
twice as it is referenced from 2 effects. If I release pool just once,
it crashes in freeing effect.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pool_release_crash.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170425/0a3e0a14/attachment.bin>
More information about the wine-devel
mailing list