MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / InitDeviceAndWindow

Method InitDeviceAndWindow

Rtxpt/SampleCommon/SampleBaseApp.cpp:334–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334bool SampleBaseApp::InitDeviceAndWindow(const donut::app::DeviceCreationParameters& deviceParams)
335{
336 if (m_CmdLine.noWindow)
337 {
338 if (!m_DeviceManager->CreateInstance(deviceParams))
339 {
340 donut::log::fatal("CreateDeviceAndSwapChain failed: Cannot initialize a graphics device with the requested parameters");
341 return false;
342 }
343 }
344 else
345 {
346 if (!m_DeviceManager->CreateWindowDeviceAndSwapChain(deviceParams, g_windowTitle))
347 {
348 donut::log::fatal("Cannot initialize a graphics device with the requested parameters");
349 return false;
350 }
351 HelpersRegisterActiveWindow();
352 }
353
354#if 0 && RTXPT_D3D12_WITH_NVAPI
355 static bool NVAPI_VALIDATION = false;
356 auto device = m_DeviceManager->GetDevice();
357 if (NVAPI_VALIDATION && device->getGraphicsAPI() == nvrhi::GraphicsAPI::D3D12)
358 {
359 NvAPI_Status res;
360 auto nativeObj = device->getNativeObject(nvrhi::ObjectTypes::D3D12_Device);
361 //res = NvAPI_D3D12_EnableRaytracingValidation(nativeObj, NVAPI_D3D12_RAYTRACING_VALIDATION_FLAG_NONE);
362 res = NvAPI_D3D12_RegisterRaytracingValidationMessageCallback(nativeObj, &myValidationMessageCallback, (void*)this, &this->m_NVAPIValidationHandle);
363 assert( res == NvAPI_Status:: NVAPI_OK );
364 }
365#endif
366
367 return true;
368}
369
370bool SampleBaseApp::CheckDeviceFeatureSupport(const donut::app::DeviceCreationParameters& deviceParams)
371{

Callers

nothing calls this directly

Calls 2

GetDeviceMethod · 0.45

Tested by

no test coverage detected