Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force GPU to always render if on hud #22

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

@@ -440,6 +440,9 @@ local function GPU_DrawHUD()
local screenWidth = ScrW()
local screenHeight = ScrH()

if math.min(1/30,CurTime() - (videoGPU.PreviousTime or 0)) > 0 then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This equation looks wrong. Also why not just draw every frame instead of framerate limiting it?

Copy link
Member Author

@DerelictDrone DerelictDrone Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think it's safe to remove the framelimit check, I was paranoid about making sure I'm calling ent:draw when it will guarantee a rendered frame but hudpaint seems like a safe context(delta-wise) to call the gpu's draw function without a framelimit check.

So, my reasoning was that with the GPU's draw func, it checks the equation(I copied it from ent:draw) it doesn't check between last rendered frame and now, only between last draw call and now, so if this gets called quickly enough that it results in a deltatime of less than or equal to 0 it will stall GPU rendering entirely(until called less frequently) rather than stall until time between lastframe and now is within frame limit, this should be reworked soon.

@thegrb93 thegrb93 merged commit 6892e61 into wiremod:master Nov 27, 2023
1 check failed
@DerelictDrone DerelictDrone deleted the gpu-render-fixes branch November 27, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants