amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

Vortice.DXGI.FormatHelper.SizeOfInBytes has been incorrectly renamed to BitsPerPixel #334

Closed Gavin-Williams closed 2 years ago

Gavin-Williams commented 2 years ago

The function BitsPerPixel should be BytesPerPixel.

amerkoleci commented 2 years ago

Mm, I don't this so, its the same from here: https://github.com/microsoft/DirectXTK12/blob/main/Src/LoaderHelpers.h#L27

I'll change documentation of function

Gavin-Williams commented 2 years ago

It's an odd change, because how I've been using it is to get the bytesPerPixel to build a data stream...

  int bytesPerPixel = Vortice.DXGI.FormatHelper.BitsPerPixel(dxTexture.Description.Format);
  Vortice.DataStream dataStream = new(bytesPerPixel * w * h, true, true);

I'm not sure if I ever need the number of bits. I think it's an odd helper method.

amerkoleci commented 2 years ago

Well thats correct name, size is expressed in bits and not bytes, for example r32g32b32a32_float is 128bit format, similar like unity3d docs for example