On Mon, 26 Dec 2016 13:32:10 +0100
Anton Khirnov <an...@khirnov.net> wrote:

> Quoting wm4 (2016-12-20 16:02:20)
> > On Mon, 19 Dec 2016 13:04:38 +0100
> > Anton Khirnov <an...@khirnov.net> wrote:
> >   
> > > Quoting Steve Lhomme (2016-12-16 11:05:40)  
> > > > From: Steve Lhomme <rob...@gmail.com>
> > > >   
> >   
> > > > +    ZeroMemory(&texDesc, sizeof(texDesc));    
> > > 
> > > Isn't this just memset(.., 0, ..)?  
> > 
> > He should use "D3D11_TEXTURE2D_DESC texDesc = {0};" in the first place.
> > For arrays, a calloc-style function should be used.
> >   
> > > > +    if (device) {
> > > > +        HMODULE dxgilib = LoadLibrary("dxgi.dll");
> > > > +        if (dxgilib) {    
> > > 
> > > In what circumstances will this library be missing? I think if the
> > > caller requests a specific device and this function is unable to
> > > deliver, it should fail, not return some random otehr device.  
> > 
> > The DLL is always available as long as D3D11 is.
> > 
> > IMHO, we should execute all these LoadLibrary and GetProcAddress in an
> > init_once function, and store them in global variables. Unloading them
> > is just wasted effort (and apparently even can make some drivers crash
> > under certain circumstances).  
> 
> Evil evil global state =p
> 

Not really. It's essentially state not observable from the outside, and
the only real difference is not unloading the D3D DLLs. Which is
probably a good idea anyway: unloading barely has any advantages, but
can trigger driver bugs, and frequent unloading and reloading isn't
very efficient either.
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to