diff --git a/src/d3d9/d3d9_util.h b/src/d3d9/d3d9_util.h index e5bc4166..a3ad1ff7 100644 --- a/src/d3d9/d3d9_util.h +++ b/src/d3d9/d3d9_util.h @@ -9,6 +9,7 @@ #include "../dxvk/dxvk_device.h" #include "../util/util_matrix.h" +#include "../util/util_misc.h" #include @@ -102,14 +103,6 @@ namespace dxvk { VkImageUsageFlags GetImageUsageFlags(DWORD Usage); - inline void DecodeD3DCOLOR(D3DCOLOR color, float* rgba) { - // Encoded in D3DCOLOR as argb - rgba[3] = (float)((color & 0xff000000) >> 24) / 255.0f; - rgba[0] = (float)((color & 0x00ff0000) >> 16) / 255.0f; - rgba[1] = (float)((color & 0x0000ff00) >> 8) / 255.0f; - rgba[2] = (float)((color & 0x000000ff)) / 255.0f; - } - inline VkFormat PickSRGB(VkFormat format, VkFormat srgbFormat, bool srgb) { return srgb ? srgbFormat : format; } diff --git a/src/util/util_misc.h b/src/util/util_misc.h new file mode 100644 index 00000000..6fb41f15 --- /dev/null +++ b/src/util/util_misc.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace dxvk { + + inline void DecodeD3DCOLOR(D3DCOLOR color, float* rgba) { + // Encoded in D3DCOLOR as argb + rgba[3] = (float)((color & 0xff000000) >> 24) / 255.0f; + rgba[0] = (float)((color & 0x00ff0000) >> 16) / 255.0f; + rgba[1] = (float)((color & 0x0000ff00) >> 8) / 255.0f; + rgba[2] = (float)((color & 0x000000ff)) / 255.0f; + } + +} \ No newline at end of file