update:
I discovered that in windowed mode (with the amd gpu) if I change the screen resolution, the background image will get stucked with the last rendered frame before the texture was changed (example Picture below)
And I really don't know if my log will help with something, but here's the performance usage from each part of the code:
Code: Select all
Function Name Total CPU (%) Self CPU (%) Total CPU (ms) Self CPU (ms) Module
- gzdoom.exe (PID: 11220) 100.00 % 0.00 % 77 0 gzdoom.exe
- [External Code] 100.00 % 10.39 % 77 8 10 modules
- WinMainCRTStartup 89.61 % 0.00 % 69 0 gzdoom.exe
- __scrt_common_main 89.61 % 0.00 % 69 0 gzdoom.exe
- __scrt_common_main_seh 89.61 % 0.00 % 69 0 gzdoom.exe
- invoke_main 89.61 % 0.00 % 69 0 gzdoom.exe
- WinMain 89.61 % 0.00 % 69 0 gzdoom.exe
- DoMain 89.61 % 0.00 % 69 0 gzdoom.exe
- D_DoomMain 89.61 % 0.00 % 69 0 gzdoom.exe
- D_DoomLoop 89.61 % 0.00 % 69 0 gzdoom.exe
- D_Display 84.42 % 0.00 % 65 0 gzdoom.exe
- OpenGLFrameBuffer::Update 29.87 % 0.00 % 23 0 gzdoom.exe
- OpenGLFrameBuffer::Swap 20.78 % 0.00 % 16 0 gzdoom.exe
- Win32GLFrameBuffer::SwapBuffers 9.09 % 0.00 % 7 0 gzdoom.exe
+ [External Code] 9.09 % 2.60 % 7 2 11 modules
- atioglxx.dll!0x00000004ba9826 9.09 % 0.00 % 7 0 atioglxx.dll
+ atioglxx.dll!0x000000056c730c 9.09 % 0.00 % 7 0 atioglxx.dll
- atioglxx.dll!0x00000004ba98c4 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000005897c32 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000005875ed8 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000005875d0e 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058b1d60 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058b7974 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058b90c7 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058c063e 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058cd793 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004b42fab 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004b6ae3b 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004b6852e 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004b6bb9c 2.60 % 0.00 % 2 0 atioglxx.dll
- atigktxx.dll!0x0000000f9b767b 2.60 % 0.00 % 2 0 atigktxx.dll
- atigktxx.dll!0x0000000f9b6663 1.30 % 0.00 % 1 0 atigktxx.dll
- atigktxx.dll!0x0000000f9ba8a2 1.30 % 0.00 % 1 0 atigktxx.dll
- atigktxx.dll!0x0000000f9ba0fc 1.30 % 0.00 % 1 0 atigktxx.dll
atigktxx.dll!0x0000000f9ba156 1.30 % 1.30 % 1 1 atigktxx.dll
- atigktxx.dll!0x0000000f9b6680 1.30 % 0.00 % 1 0 atigktxx.dll
- atigktxx.dll!0x0000000f9bd1e1 1.30 % 0.00 % 1 0 atigktxx.dll
[External Code] 1.30 % 1.30 % 1 1 7 modules
- FGLRenderer::Flush 7.79 % 0.00 % 6 0 gzdoom.exe
- FFlatVertexBuffer::RenderCurrent 6.49 % 0.00 % 5 0 gzdoom.exe
- FFlatVertexBuffer::RenderArray 6.49 % 0.00 % 5 0 gzdoom.exe
- atioglxx.dll!0x00000004d30939 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x00000004ef1fe4 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x00000004baa051 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004c7d1e0 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x0000000589c634 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058a7a2a 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000058b4f39 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x000000058a8b7e 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x000000058b4fa6 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000058a8bb3 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000058a9efc 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000057e511d 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x0000000576eb1e 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x0000000576e912 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x00000004baa031 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000004c7cd6a 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x0000000561bf98 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000005e287a3 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x00000004d30740 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x0000000561b550 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000004d35b03 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x0000000561b4ef 1.30 % 0.00 % 1 0 atioglxx.dll
+ atioglxx.dll!0x0000000561b1e7 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000005375b2d 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000004bb6900 1.30 % 1.30 % 1 1 atioglxx.dll
- OpenGLFrameBuffer::Begin2D 1.30 % 0.00 % 1 0 gzdoom.exe
+ FRenderState::ApplyMatrices 1.30 % 0.00 % 1 0 gzdoom.exe
- D_PageDrawer 27.27 % 0.00 % 21 0 gzdoom.exe
- DCanvas::DrawTexture 18.18 % 0.00 % 14 0 gzdoom.exe
- OpenGLFrameBuffer::DrawTextureParms 16.88 % 0.00 % 13 0 gzdoom.exe
+ FGLRenderer::DrawTexture 16.88 % 0.00 % 13 0 gzdoom.exe
$$Thunk@00008c24 1.30 % 1.30 % 1 1 gzdoom.exe
- DCanvas::FillBorder 9.09 % 0.00 % 7 0 gzdoom.exe
- OpenGLFrameBuffer::Clear 9.09 % 0.00 % 7 0 gzdoom.exe
- FGLRenderer::Clear 9.09 % 0.00 % 7 0 gzdoom.exe
- atioglxx.dll!0x00000005375ad7 7.79 % 0.00 % 6 0 atioglxx.dll
- atioglxx.dll!0x00000004bb6f98 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x00000005468dfa 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000054de52e 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x000000054dec62 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000054de07a 1.30 % 0.00 % 1 0 atioglxx.dll
+ atioglxx.dll!0x0000000589c634 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000054de8f4 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000005878fe3 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x000000058a9f51 1.30 % 1.30 % 1 1 atioglxx.dll
atioglxx.dll!0x00000005468f16 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x00000004bb6efe 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x000000056c0f6b 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x000000056c5911 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x000000056c1468 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x00000004b40769 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004b66dcc 2.60 % 0.00 % 2 0 atioglxx.dll
- atigktxx.dll!0x0000000f9b6282 1.30 % 0.00 % 1 0 atigktxx.dll
[External Code] 1.30 % 1.30 % 1 1 7 modules
atigktxx.dll!0x0000000f9bcbec 1.30 % 1.30 % 1 1 atigktxx.dll
- atioglxx.dll!0x00000004b40709 1.30 % 0.00 % 1 0 atioglxx.dll
[External Code] 1.30 % 1.30 % 1 1 8 modules
- atioglxx.dll!0x00000004c3bf83 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000004c4083a 1.30 % 1.30 % 1 1 atioglxx.dll
- M_Drawer 18.18 % 0.00 % 14 0 gzdoom.exe
- DListMenu::Drawer 14.29 % 0.00 % 11 0 gzdoom.exe
+ FListMenuItemPatch::Drawer 9.09 % 0.00 % 7 0 gzdoom.exe
- FListMenuItemStaticPatch::Drawer 3.90 % 0.00 % 3 0 gzdoom.exe
- DCanvas::DrawTexture 3.90 % 0.00 % 3 0 gzdoom.exe
- OpenGLFrameBuffer::DrawTextureParms 3.90 % 0.00 % 3 0 gzdoom.exe
- FGLRenderer::DrawTexture 3.90 % 0.00 % 3 0 gzdoom.exe
- FRenderState::SetMaterial 1.30 % 0.00 % 1 0 gzdoom.exe
- FMaterial::Bind 1.30 % 0.00 % 1 0 gzdoom.exe
- FGLTexture::Bind 1.30 % 0.00 % 1 0 gzdoom.exe
FGLTexture::CreateHwTexture 1.30 % 1.30 % 1 1 gzdoom.exe
- gl_SetRenderStyle 1.30 % 0.00 % 1 0 gzdoom.exe
atioglxx.dll!0x00000005375ce0 1.30 % 1.30 % 1 1 atioglxx.dll
- FFlatVertexBuffer::RenderCurrent 1.30 % 0.00 % 1 0 gzdoom.exe
+ FFlatVertexBuffer::RenderArray 1.30 % 0.00 % 1 0 gzdoom.exe
- DMenu::Drawer 1.30 % 0.00 % 1 0 gzdoom.exe
- DCanvas::DrawTexture 1.30 % 0.00 % 1 0 gzdoom.exe
- OpenGLFrameBuffer::DrawTextureParms 1.30 % 0.00 % 1 0 gzdoom.exe
- FGLRenderer::DrawTexture 1.30 % 0.00 % 1 0 gzdoom.exe
- FFlatVertexBuffer::RenderCurrent 1.30 % 0.00 % 1 0 gzdoom.exe
- FFlatVertexBuffer::RenderArray 1.30 % 0.00 % 1 0 gzdoom.exe
- atioglxx.dll!0x00000004ef1fe4 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000004baa051 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000004c7d1e0 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x0000000589c634 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000058a7a46 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000058ad7fa 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x000000058add19 1.30 % 0.00 % 1 0 atioglxx.dll
- atioglxx.dll!0x00000005773b0b 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000005774002 1.30 % 1.30 % 1 1 atioglxx.dll
- OpenGLFrameBuffer::Dim 2.60 % 0.00 % 2 0 gzdoom.exe
- DCanvas::Dim 2.60 % 0.00 % 2 0 gzdoom.exe
- OpenGLFrameBuffer::Dim 2.60 % 0.00 % 2 0 gzdoom.exe
+ FGLRenderer::Dim 2.60 % 0.00 % 2 0 gzdoom.exe
TArray<FListMenuItem *,FListMenuItem *>::operator[] 1.30 % 1.30 % 1 1 gzdoom.exe
- OpenGLFrameBuffer::Begin2D 9.09 % 0.00 % 7 0 gzdoom.exe
- FRenderState::ApplyMatrices 5.19 % 0.00 % 4 0 gzdoom.exe
- FShaderManager::ApplyMatrices 5.19 % 0.00 % 4 0 gzdoom.exe
- FShader::ApplyMatrices 5.19 % 0.00 % 4 0 gzdoom.exe
- FShader::Bind 5.19 % 0.00 % 4 0 gzdoom.exe
- FShaderManager::SetActiveShader 5.19 % 0.00 % 4 0 gzdoom.exe
- atioglxx.dll!0x00000004be02b0 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x000000055cf25c 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x000000055f8784 3.90 % 0.00 % 3 0 atioglxx.dll
- atioglxx.dll!0x0000000561d9e9 3.90 % 0.00 % 3 0 atioglxx.dll
atioglxx.dll!0x0000000561d29b 2.60 % 2.60 % 2 2 atioglxx.dll
atioglxx.dll!0x0000000561d2be 1.30 % 1.30 % 1 1 atioglxx.dll
- atioglxx.dll!0x00000004be027d 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000005492a14 1.30 % 1.30 % 1 1 atioglxx.dll
- FGLRenderer::Begin2D 3.90 % 0.00 % 3 0 gzdoom.exe
- FGLRenderBuffers::Setup 2.60 % 0.00 % 2 0 gzdoom.exe
- atioglxx.dll!0x00000005378f8b 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004bc5f4b 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x0000000546ae1d 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000005469ee0 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004d33c48 2.60 % 0.00 % 2 0 atioglxx.dll
- atioglxx.dll!0x00000004c837ee 1.30 % 0.00 % 1 0 atioglxx.dll
+ atioglxx.dll!0x00000004c81a1b 1.30 % 0.00 % 1 0 atioglxx.dll
atioglxx.dll!0x00000004c835ce 1.30 % 1.30 % 1 1 atioglxx.dll
- FGLRenderBuffers::BindHudFB 1.30 % 0.00 % 1 0 gzdoom.exe
- atioglxx.dll!0x00000005378f8b 1.30 % 0.00 % 1 0 atioglxx.dll
+ atioglxx.dll!0x00000004bc5f4b 1.30 % 0.00 % 1 0 atioglxx.dll
- TryRunTics 5.19 % 0.00 % 4 0 gzdoom.exe
- NetUpdate 3.90 % 0.00 % 3 0 gzdoom.exe
- I_StartTic 3.90 % 0.00 % 3 0 gzdoom.exe
- I_CheckNativeMouse 1.30 % 0.00 % 1 0 gzdoom.exe
[External Code] 1.30 % 1.30 % 1 1 8 modules
- I_GetEvent 1.30 % 0.00 % 1 0 gzdoom.exe
- [External Code] 1.30 % 0.00 % 1 0 3 modules
- WndProc 1.30 % 0.00 % 1 0 gzdoom.exe
[External Code] 1.30 % 1.30 % 1 1 10 modules
[External Code] 1.30 % 1.30 % 1 1 user32.dll
- G_Ticker 1.30 % 0.00 % 1 0 gzdoom.exe
cycle_t::Reset 1.30 % 1.30 % 1 1 gzdoom.exe
And here's also an update:
In void FGLRenderer::Flush()
removing the "if (FGLRenderBuffers::IsEnabled())" and Always executing the interior code from that if fixed the camera iuse (so it's not anymore black for intel neither amd), it also fixed the driver crash in fullscreen (and it even fixed the problem that froze the background when changing the resolution)...
but, it's not a perfect solution, it's a bit buggy with intel ( it doesn't show the doom 2 title background image, but after a time, it shows The background credits and then it shows the doom 2 logo background)
OFF: I synched the gzdoom GitHub with visual studio, This way I hope it's going to be Always the latest version
EDIT: looking better to the code, I saw that when changing the resolution the game doesn't crash neither freeze the background, but it gets stucked in the FShader::Load code for about 15 SECONDS!!!, after that time pass the cpu usage drops from "100%" (single core usage) to 0% and the game goes back and the screen is now updated.
EDIT2: Actuall the same happens in fullscreen mode ( I tested with two monitors to avoid some kind of crash).
this is the initial run from gzdoom in fullscreen mode, first, it takes almost 20 seconds under the same function, and when it finish loading the FShader, the cpu drop goes to zero, but I can only see a thing on screen when the last small rise from the cpu shows, then I can actually use the game and see the stuff...
Here's the cpu/ram usage
EDIT3: More numbers:
on void FShaderManager::CompileShaders():
each FShader *shc = Compile(defaultshaders
.ShaderName, defaultshaders.gettexelfunc, true); call takes +- 860ms to run
inside of FShader *FShaderManager::Compile (const char *ShaderName, const char *ShaderPath, bool usediscard) , the function that requires more cpu time is the function below
if (!shader->Load(ShaderName, "shaders/glsl/main.vp", "shaders/glsl/main.fp", ShaderPath, defines.GetChars())) +- 819ms to run
and inside of that if we found FShader::Load.
The only heavy functions inside of it were
glCompileShader(hFragProg); +- 7ms
glLinkProgram(hShader); +- 159ms
glUseProgram(hShader); +- 727ms
I belive the code somehow is working just fine, but it takes so many time to see something, but since you hear the sounds and can toy with the menu, you feel that the game crashed...