slang icon indicating copy to clipboard operation
slang copied to clipboard

Bug on supporting bit_cast<uint64_t>(double)

Open kaizhangNV opened this issue 4 months ago • 5 comments

Following code will cause internal error:

RWStructuredBuffer<uint64_t> out;

uint64_t cast(double x)
{
    return bit_cast<uint64_t>(x);
}

[shader("compute")]
[numthreads(1,1,1)]
void computeMain()
{
    double x = 1.0;

    out[0] = cast(x);
}

note, there is no problem just doing

  out[0] = bit_cast<uint64_t>(1.0lf);

kaizhangNV avatar Oct 31 '24 17:10 kaizhangNV