heya
i was doing my stuff when i got a weird error. i could not create a constant buffer, filling in the actual size of the structure (12B = 3 floats) in 'D3D11_BUFFER_DESC.ByteWidth'
i debugged fof hours just to discover that it works for 48B, but not 47B... then i thought.. is it multiples of 16 for some reason. after a few hours I found this, saying:
Remarks
This structure is used by ID3D11Device::CreateBuffer to create buffer resources.
In addition to this structure, you can also use the CD3D11_BUFFER_DESC derived structure, which is defined in D3D11.h and behaves like an inherited class, to help create a buffer description.
If the bind flag is D3D11_BIND_CONSTANT_BUFFER, you must set the ByteWidth value in multiples of 16, and less than or equal to D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT.
what the hell? why? what is this? how do i know what size do i need to set based on the size of my struct?
most importantly... is there another, better way?!