[5/5] WineD3D: Use GL_ATI_meminfo if available
Henri Verbeet
hverbeet at gmail.com
Sun Sep 6 15:27:14 CDT 2009
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.
More information about the wine-devel
mailing list