[PATCH] wined3d: Implement wined3d_pause for MSVC.

Thomas Faber thomas.faber at reactos.org
Mon May 21 13:15:46 CDT 2018


On 2018-05-21 20:03, Henri Verbeet wrote:
> On 21 May 2018 at 19:08, Thomas Faber <thomas.faber at reactos.org> wrote:
>> @@ -367,8 +367,12 @@ static inline unsigned int wined3d_popcount(unsigned
>> int x)
>>
>>   static inline void wined3d_pause(void)
>>   {
>> -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
>> +#if defined(__i386__) || defined(__x86_64__)
>> +#if defined(__GNUC__)
>>       __asm__ __volatile__( "rep;nop" : : : "memory" );
>> +#elif defined(_MSC_VER)
>> +    _mm_pause();
>> +#endif
>>   #endif
>>   }
> Doesn't _mm_pause() require an include of the appropriate header? I'm
> also somewhat tempted to argue for using YieldProcessor().

It seems to work without any includes, with all warnings turned on, so I 
assumed it was fine.
I was considering YieldProcessor but Wine's headers don't have it.
If you prefer, I could add it to winnt.h and replace wined3d_pause
entirely.

Thanks,
Thomas



More information about the wine-devel mailing list