[5/5] WineD3D: Use GL_ATI_meminfo if available

Stefan Dösinger stefan at codeweavers.com
Sun Sep 6 19:05:15 CDT 2009


Am Sunday 06 September 2009 22:27:14 schrieb Henri Verbeet:
> 2009/9/5 Stefan Dösinger <stefan at codeweavers.com>:
> > +        /* All GL_ATI_meminfo enums return 4 ints, even the
> > (undocumented) +         * GL_TOTAL_PHYSICAL_MEMORY_ATI one, which
> > returns {mem, 0, 0, 0} */ +        GLint mem[4];
> > +        /* Returns the vidmem in KB */
> > +        glGetIntegerv(GL_TOTAL_PHYSICAL_MEMORY_ATI, mem);
> > +        checkGLcall("glGetIntegerv(GL_TOTAL_PHYSICAL_MEMORY_ATI, mem)");
> > +
> > +        /* The first driver version that supports ATI_meminfo doesn't
> > implement +         * GL_TOTAL_PHYSICAL_MEMORY_ATI - catch this situation
> > as adviced by AMD +         */
> > +        if(mem[0] < 65536)
>
> If the implementation doesn't recognise "GL_TOTAL_PHYSICAL_MEMORY_ATI"
> you're testing uninitialized memory here. I hope AMD didn't actually
> advice you to code it like that.
Hmm, you got a point here - the GL call won't initialize the memory on an 
invalid token(or at least, I couldn't rely on that), and I'd have to init the 
memory to zero manually before.

Your other objection sounds reasonable as well - I guess I'll /dev/null the 
patches for now and hope AMD fixes the extension



More information about the wine-devel mailing list