(EN) Methods and devices for lowering precision of computations used in shader programs may include receiving program code for a shader program to use with a graphics processing unit (GPU) that supports half precision storage and arithmetic in shader programs. The methods and devices may include performing at least one pass on the program code to select a set of operations within the program code to lower a precision of a plurality of computations used by the set of operations and evaluating a risk of precision loss for lowering the precision to a half precision for each computation of the plurality of computations. The methods and devices may include generating edited program code by rewriting the computation to the half precision in response to the risk of precision loss being a precision loss threshold.
(ZH) 用于降低着色器程序中使用的计算的精度的方法和设备可以包括接收用于着色器程序的程序代码以与图形处理单元(GPU)一起使用,该图形处理单元(GPU)支持半精度存储和着色器程序中的算术。该方法和设备可以包括在程序代码上执行至少一个通道以选择程序代码内的操作集,以降低由操作集使用的多个计算的精度,并且针对多个计算中的每个计算,评估针对将精度降低到半精度的精度损失风险。该方法和设备可以包括响应于精度损失风险低于精度损失阈值,通过将计算重写为半精度来生成经编辑的程序代码。