MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / isDX12Supported

Function isDX12Supported

cmp_framework/compute_base.cpp:209–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207
208#ifdef _WIN32
209bool isDX12Supported()
210{
211 typedef LONG NTSTATUS, *PNTSTATUS;
212 typedef NTSTATUS(WINAPI * RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
213 RTL_OSVERSIONINFOW win10OSver = {0};
214
215 HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
216 if (hMod)
217 {
218 RtlGetVersionPtr fxPtr = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
219 if (fxPtr != nullptr)
220 {
221 RTL_OSVERSIONINFOW rovi = {0};
222 rovi.dwOSVersionInfoSize = sizeof(rovi);
223 if (0 == fxPtr(&rovi))
224 {
225 win10OSver = rovi;
226 }
227 }
228 }
229
230 if (win10OSver.dwMajorVersion < 10)
231 {
232 return false;
233 }
234
235 if ((win10OSver.dwBuildNumber != 0) && (win10OSver.dwBuildNumber < 15063))
236 {
237 return false;
238 }
239
240 return true;
241}
242#else
243bool isDX12Supported()
244{

Callers 2

cp3DModelViewMethod · 0.85
CMP_CreateComputeLibraryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected