mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[util] Add sfence helper
This commit is contained in:
parent
9c395fd60d
commit
64074a44a6
1 changed files with 13 additions and 0 deletions
|
@ -632,4 +632,17 @@ namespace dxvk::bit {
|
|||
return float(n) / float(1u << F);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Flush pending stores, if any
|
||||
*
|
||||
* Needed on x86 after writing to mapped memory or using non-temporal
|
||||
* stores in order to flush write-combined buffers.
|
||||
*/
|
||||
inline void sfence() {
|
||||
#if defined(DXVK_ARCH_X86) && (defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER))
|
||||
_mm_sfence();
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue