Status bar is broken with "LB" resolutions.

Bugs that have been resolved.

Moderator: Graf Zahl

ibm5155
Posts: 152
Joined: Tue Oct 25, 2011 13:05

Status bar is broken with "LB" resolutions.

Post by ibm5155 »

Image
Set any kind of LB resolution (found in 16:9 aspect ratio menu) and you'll see hom where the statusbar is.

It's not showing under the image, but I belive the hud is trying to be rendered below the screen (because I see the hud burder, and a hom where the hud should be, but for some reason the screenshot didn't registered that área)
EDIT: It does't happen in windowed mode, only fullscreen
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

Seems to be happening here too. Looking into it.

One dumb question: what is the difference between 1920x1080 and 1920x1080 LB? They are both 16:9 resolutions.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Status bar is broken with "LB" resolutions.

Post by Graf Zahl »

One draws 1920x1080 in a 4:3 window. The difference is the height value of the OpenGLFramebuffer.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

You mean 1920x1080 LB should be 1920x1080 with black bars in the sides and a 4:3 scene in the center?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Status bar is broken with "LB" resolutions.

Post by Graf Zahl »

No. It's a 16:9 screen letterboxed on a 4:3 screen. And from the image it looks like some value is still from that 4:3 screen which causes the status bar to be drawn in the wrong place.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

I'm not sure I fully understand. Let's say I've selected 1920x1080 LB in the menu options and gone full screen. What physical monitor resolution does it mode switch to? What should the viewport size be for the scene and what should it be for the 2D/screen?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Status bar is broken with "LB" resolutions.

Post by Graf Zahl »

It would switch to 1920x1440 with black bars at top and bottom.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

Okay, got it. For windowed mode it stays at 1920x1080, and for fullscreen the "true height" becomes 1440. Makes me wonder if I should try get rid of GetTrueHeight() entirely as the present shader code letterboxes it automatically.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Status bar is broken with "LB" resolutions.

Post by Graf Zahl »

If you create a framebuffer that only contains the actual display area, that's what GetTrueHeight should return.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

What I mean is the GetClientHeight function I added to the video classes makes GetTrueHeight redundant. I think I can reduce the entire thing into calculating two viewport boxes (mScreenViewport and mSceneViewport) and then deal with the letterboxing exclusively in the CopyToBackbuffer function.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

Pull request fixing this: https://github.com/coelckers/gzdoom/pull/80

I've changed it so that FGLRenderer::SetOutputViewport calculates where all the gzdoom glViewport locations are. It outputs three rects:
  • mOutputLetterbox - The final location in the back buffer where the game is rendered. For LB resolutions it will be located so there's a black bar above it and below. For non-LB it should be covering the entire back buffer. For windowed mode it is located so there might be bars to the left and right instead, depending on how the user sizes the window.
  • mScreenViewport - The location where gzdoom renders 2D. It has the values that glViewport needs to cover the entire screen.
  • mSceneViewport - The box where the scene is rendered.
To fix the map lines issue I've changed it so that the screen is up scaled during rendering rather in CopyToBackbuffer. I've added a debug gl_scale_viewport cvar that can be set to false to enable the old behavior.

The PR also fixes the post processing bug ticket. The bloom pass was grabbing pixels from non-scene parts of the screen when not using a maximized HUD.
_mental_
Developer
Developer
Posts: 259
Joined: Sun Aug 07, 2011 13:36

Re: Status bar is broken with "LB" resolutions.

Post by _mental_ »

I've got glCheckFramebufferStatus failed: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error with this pull request on macOS.
GZDoom's master branch works fine.
Spoiler: Callstack
Also, a bit unrelated to this particular issue, I tried to enable Core Profile on macOS. It shows nothing more than a black screen.
Launching GZDoom from Apple's OpenGL profiler revealed lots of GL errors.
Apple's implementation is known to be very picky (or strict to the spec, depending on point of view).
If you can debug on Mac hardware probably it makes sense to give it a try.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Status bar is broken with "LB" resolutions.

Post by dpJudas »

Seems this is due to the SDLGLFB::GetClientWidth + SDLGLFB::GetClientHeight functions returning 0, thus making it create 0x0 buffers. The GL errors are probably due to it trying to create a 0x0 texture before aborting with the incomplete attachment check.

Ideally those functions would return the size of the OpenGL frame buffer on Mac. It is essentially the view size, but in backing size rather than device independent pixels. Looking into fixing this and adding that to the PR.

About the core profile: from what I've understood from Graf the core profile doesn't support persistent mapping on Mac, which it needs to render anything.
ibm5155
Posts: 152
Joined: Tue Oct 25, 2011 13:05

Re: Status bar is broken with "LB" resolutions.

Post by ibm5155 »

I confirm that the LB resolutions are working fine now.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Status bar is broken with "LB" resolutions.

Post by Graf Zahl »

dpJudas wrote:About the core profile: from what I've understood from Graf the core profile doesn't support persistent mapping on Mac, which it needs to render anything.
Correct. But I have started work on it, the 2D part should be done. But at the moment the main vertex buffer that's being created will not work on a core profile and that may just be reason enough for failure.

Return to “Closed Bugs”