Signed-off-by: Thomas Faber thomas.faber@reactos.org --- dlls/wined3d/wined3d_private.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3e344a5f0f3..976ab6ffd3f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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 }
On 21 May 2018 at 19:08, Thomas Faber thomas.faber@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().
On 2018-05-21 20:03, Henri Verbeet wrote:
On 21 May 2018 at 19:08, Thomas Faber thomas.faber@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
On 21 May 2018 at 20:15, Thomas Faber thomas.faber@reactos.org wrote:
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.
If you don't mind, let's try that.