From de9c19e0c809f036e32a65d7d76701953efb3b74 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Fri, 10 Jul 2026 06:32:29 +0530 Subject: [PATCH] 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 27da3bce626d95ef27479d5e709a98d51baf95cb) Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zg6CoUY Service-Version: 1.25 --- src/renderer/atlas/BackendD3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/atlas/BackendD3D.cpp b/src/renderer/atlas/BackendD3D.cpp index 5602fdd750..ef9e035323 100644 --- a/src/renderer/atlas/BackendD3D.cpp +++ b/src/renderer/atlas/BackendD3D.cpp @@ -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(now % _customShaderPerfTickMod) * _customShaderSecsPerPerfTick; + const auto time = (now % _customShaderPerfTickMod) * _customShaderSecsPerPerfTick; const CustomConstBuffer data{ .time = time,