GHOST/WIN32: remove start time offset from getMilliSeconds #117618
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117618
Loading…
Reference in New Issue
No description provided.
Delete Branch "ideasman42/blender:pr-win32-time-offset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This isn't necessary and has been removed from macOS & X11,
Wayland never did this.
Besides removing the offset GetTickCount() has been replaced by
GetTickCount64 to prevent 32bit rollover when high resolution timers
aren't supported.
GetTickCount64 is supported by Windows Vista and newer.
@blender-bot build windows
c4a5970132
toc2390b4da5
c2390b4da5
todcc54ad7c9
@ideasman42
Sorry for the delay in looking at this.
With this PR we are saying that for these message times we don't care what the actual values are as we only care about the differences between them. So we can have the values be an amount of time since the computer was turned on, rather than from when blender was started. That does simplify things.
The only thing I noticed while testing this is a problem that already exists in that
getMessageTime
so it is hard to change that without fixing that too.On Blender startup we currently call
getMessageTime
four times or so before we get any Windows messages in our queue. In that state the return of GetMessageTime() is zero.GetTickCount
still gives a proper value so we end up calculating a delta that is a negative value equal to the number of ticks since the system was started.I think we need that function to look something like?
ideally
getMessageTime
shouldn't be called unless we're handling a message, where do those 4 calls originate? can we eliminate them?When we are creating the window, so within
GHOST_WindowWin32()
but near the very end of it, we call::UpdateWindow(m_hWnd);
with a comment of "Force an initial paint of the window" (GHOST_WindowWin32.cc at around line 209). This causes use to get WM_ACTIVATE, WM_SIZE, WM_MOVE, and then WM_PAINT. While processing these messages the return of GetMessageTime () is zero.Yes, there is nothing that looks weird if UpdateWindow() is not called.
@LazyDodo - So we could take this PR as it is, and remove that UpdateWindow() separately.
Looking into this further it looks like we can skip UpdateWindow. Will make a separate PR for that.
Further cleanup can be done,
QueryPerformanceFrequency
is guaranteed to return true on XP+ som_hasPerformanceCounter
will never ever be false...