vkd3d: Move is_power_of_two to common header.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2020-05-05 13:13:06 +02:00 committed by Hans-Kristian Arntzen
parent 830f9642b5
commit fe13c017ea
2 changed files with 5 additions and 5 deletions

View File

@ -210,6 +210,11 @@ static inline LONG InterlockedDecrement(LONG volatile *x)
# define atomic_load_acquire(ptr) atomic_add_fetch(ptr, 0)
#endif
static inline bool is_power_of_two(unsigned int x)
{
return x && !(x & (x -1));
}
static inline void vkd3d_parse_version(const char *version, int *major, int *minor)
{
*major = atoi(version);

View File

@ -580,11 +580,6 @@ bool is_write_resource_state(D3D12_RESOURCE_STATES state)
| D3D12_RESOURCE_STATE_RESOLVE_DEST);
}
static bool is_power_of_two(unsigned int x)
{
return x && !(x & (x -1));
}
bool is_valid_resource_state(D3D12_RESOURCE_STATES state)
{
const D3D12_RESOURCE_STATES valid_states =