#include <intrin.h>
static auto wanted_ret_address = _ReturnAddress();
if (_ReturnAddress() == wanted_ret_address)
[{
//backup render states
DWORD colorwrite, srgbwrite;
device->GetRenderState(D3DRS_COLORWRITEENABLE, &colorwrite);
device->GetRenderState(D3DRS_SRGBWRITEENABLE, &srgbwrite);
device->SetRenderState(D3DRS_COLORWRITEENABLE, 0xffffffff);
device->SetRenderState(D3DRS_SRGBWRITEENABLE, false);
//RENDER
device->SetRenderState(D3DRS_COLORWRITEENABLE, colorwrite);
device->SetRenderState(D3DRS_SRGBWRITEENABLE, srgbwrite);
}