Merge pull request #317 from mendsley/d3d11_cb_align16

D3D11 constant buffer must align ByteWidth to 16 bytes
This commit is contained in:
Branimir Karadžić 2015-04-02 12:02:14 -07:00
commit 46ad1aa51d

View file

@ -2650,7 +2650,7 @@ namespace bgfx { namespace d3d11
if (0 < size) if (0 < size)
{ {
D3D11_BUFFER_DESC desc; D3D11_BUFFER_DESC desc;
desc.ByteWidth = size; desc.ByteWidth = (size + 0xf) & ~0xf;
desc.Usage = D3D11_USAGE_DEFAULT; desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
desc.CPUAccessFlags = 0; desc.CPUAccessFlags = 0;