[PATCH v2 2/6] wined3d: Add a real implementation of wined3d_check_device_multisample_type().

Henri Verbeet hverbeet at gmail.com
Mon Jan 18 08:50:50 CST 2016


I finally had a look at D3D FSAAViewer on Windows, and I think this
makes sense in general.

On 14 January 2016 at 00:00, Matteo Bruni <mbruni at codeweavers.com> wrote:
> +static inline unsigned int popcount(unsigned int v)
> +{
> +    v -= v >> 1 & 0x55555555;
> +    v = (v & 0x33333333) + (v >> 2 & 0x33333333);
> +    return ((v + (v >> 4)) & 0x0f0f0f0f) * 0x01010101 >> 24;
> +}
> +
This is probably at least as good as the existing count_bits(), but it
does duplicate that function. GCC's __builtin_popcount() may also be
worth a look. I'd probably call it wined3d_popcount() for consistency
with e.g. wined3d_log2i().



More information about the wine-devel mailing list