MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Create

Method Create

ogsr_engine/Layers/xrRender/dxRenderDeviceRender.cpp:101–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void dxRenderDeviceRender::Create(HWND hWnd, u32& dwWidth, u32& dwHeight, float& fWidth_2, float& fHeight_2)
102{
103 if (strstr(Core.Params, "-shadersdbg"))
104 {
105 ps_r2_ls_flags_ext.set(R2FLAGEXT_SHADER_DBG, TRUE);
106 }
107
108#ifdef USE_RENDERDOC
109 if (!g_renderdoc_api)
110 {
111 {
112 static HMODULE hModule = GetModuleHandle("renderdoc.dll");
113 if (!hModule)
114 hModule = LoadLibrary("renderdoc.dll");
115
116 if (hModule)
117 {
118 const auto RENDERDOC_GetAPI = reinterpret_cast<pRENDERDOC_GetAPI>(GetProcAddress(hModule, "RENDERDOC_GetAPI"));
119 const auto Result = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_0_0, reinterpret_cast<void**>(&g_renderdoc_api));
120
121 if (Result == 1)
122 {
123 g_renderdoc_api->UnloadCrashHandler();
124
125 string_path FolderName{};
126 FS.update_path(FolderName, fsgame::app_data_root, "renderdoc_captures\\");
127 VerifyPath(FolderName);
128 g_renderdoc_api->SetCaptureFilePathTemplate(FolderName);
129 Msg("~~[%s] RenderDoc folder: [%s]", __FUNCTION__, FolderName);
130
131 RENDERDOC_InputButton CaptureButton[] = {eRENDERDOC_Key_Home};
132 g_renderdoc_api->SetCaptureKeys(CaptureButton, std::size(CaptureButton));
133 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_AllowVSync, 0);
134 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_DebugOutputMute, 0);
135
136 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_RefAllResources, 1);
137 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_CaptureCallstacks, 1);
138 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_VerifyBufferAccess, 1);
139 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_APIValidation, 1);
140 g_renderdoc_api->SetCaptureOptionU32(eRENDERDOC_Option_CaptureAllCmdLists, 1);
141 }
142 }
143 }
144 }
145#endif
146
147 HW.CreateDevice(hWnd);
148
149 dwWidth = HW.m_ChainDesc.BufferDesc.Width;
150 dwHeight = HW.m_ChainDesc.BufferDesc.Height;
151
152 fWidth_2 = float(dwWidth / 2);
153 fHeight_2 = float(dwHeight / 2);
154
155 Resources = xr_new<CResourceManager>();
156}
157
158void dxRenderDeviceRender::DeferredLoad(BOOL E) { Resources->DeferredLoad(E); }

Callers 1

OnDeviceCreateMethod · 0.45

Calls 6

VerifyPathFunction · 0.85
MsgFunction · 0.85
CreateDeviceMethod · 0.80
sizeFunction · 0.50
setMethod · 0.45
update_pathMethod · 0.45

Tested by

no test coverage detected