mirror of
https://github.com/microsoft/terminal.git
synced 2026-09-23 23:45:08 +00:00
Fix integer overflow in custom shader Time calculation (#20360)
This PR removes an unnecessary 32-bit integer truncation in shader time
computation and preserves the original modulo-based architecture while
improving precision in the tick-to-seconds conversion.
(cherry picked from commit 27da3bce62)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zg6CoUY
Service-Version: 1.25
This commit is contained in:
committed by
Dustin L. Howett
parent
f86d9e4df5
commit
de9c19e0c8
@@ -2329,7 +2329,7 @@ void BackendD3D::_executeCustomShader(RenderingPayload& p)
|
||||
{
|
||||
// See the comment in _recreateCustomShader() which initializes the two members below and explains what they do.
|
||||
const auto now = queryPerfCount();
|
||||
const auto time = static_cast<int>(now % _customShaderPerfTickMod) * _customShaderSecsPerPerfTick;
|
||||
const auto time = (now % _customShaderPerfTickMod) * _customShaderSecsPerPerfTick;
|
||||
|
||||
const CustomConstBuffer data{
|
||||
.time = time,
|
||||
|
||||
Reference in New Issue
Block a user