DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

sqrt fp64

Open baixiaohub opened this issue 3 years ago • 0 comments

got "warning GFC12D1D9: conversion from larger type 'double' to smaller type 'float', possible loss of data.", when calling sqrt(double).

It seems dxc hasn’t support sqrt fp64, which is commonly used in some math-lib implementations. https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/DXIL/DxilOperations.cpp#L73

glsl has supported this op from 4.0. https://docs.gl/sl4/sqrt. (see genDType in Version Support table.) I think most PC gpu vendors have the native-instructions supported.

baixiaohub avatar Aug 12 '22 01:08 baixiaohub