revert(scene3d): PI 还原为 define - app 侧 workaround 撤销,float 字面量折叠由 ViperC 侧修复

This commit is contained in:
TermiNexus committed 2026-10-15 18:22:48 +08:00
1 parent aec563e33a
commit cceefa4e2e
1 file changed
+1 -7
+1 -7
View File
@@ -4,13 +4,7 @@ import string
import t, c
# [修复] 原为 `define PI = float(3.14159265358979323846)`:常量折叠后 IR 里是 **double** 常量
# (`-PI` 生成 0xC00921FB54442D18),于是 `x0 = -PI + i*step` 整段被提升成 double 运算
# (fpext → fadd(double) → fptrunc),与 _DrawSphere 的纯 float 路径不一致 ——
# 现场表现为 SIN 波形高度塌平(球体只用 i*step,不含 -PI,因此不受影响)。
# 改成运行期全局变量:PI 参与的所有运算都在运行时按 float 进行,绕开该折叠路径。
# 根因是编译器的 float 字面量折叠(已单独记录),编译器修好后可改回 define。
PI: float = float(3.14159265358979323846)
define PI = float(3.14159265358979323846)
define SPHERE_SLICES = (24 * 1)
define SPHERE_STACKS = (16 * 1)