1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-09 04:54:15 +01:00
dxvk/src/util/util_misc.h
Joshua Ashton a010397f34 [util] Move DecodeD3DColor to util
This will be used in the D3D11UserDefinedAnnotation implementation to handle PIX calls which contain a color.
2022-03-17 11:35:19 +01:00

15 lines
397 B
C++

#pragma once
#include <d3d9types.h>
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;
}
}