SvenDH / gfx2cuda

MIT License
7 stars 1 forks source link

Wrong dxgi format? #1

Open Speido opened 2 years ago

Speido commented 2 years ago

First of all thank you for putting this together, it really speeds things up for me. I'm currently trying to display the texture, however the dxgi format doesn't seem to be correct:

tensor1 = torch.ones((4,4,4), dtype=torch.float32).contiguous().cuda() tex = gfx2cuda.texture(tensor1) print(tex.format) #TextureFormat.RGBA32FLOAT as expected print(tex.format.get_dxgi_format()) # 3

According to Microsoft docs enum 3 is DXGI_FORMAT_R32G32B32A32_UINT which isn't right for floating point.

SvenDH commented 2 years ago

Hi. It's good to know that I could help someone with this library.

You are correct, TextureFormat.RGBA32FLOAT should be 2. In the library code TextureFormat.RGBA32FLOAT also maps to 2 so I can't directly see what's going wrong.

I will look at when I have some time. Thanks for the post.