Commit ec248a9e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core/tests: Add a test for constant buffer alignment.

parent 5d4b5d73
......@@ -1699,12 +1699,12 @@ static void test_create_texture3d(void)
static void test_create_buffer(void)
{
ID3D11Buffer *d3d11_buffer;
HRESULT expected_hr, hr;
D3D10_BUFFER_DESC desc;
ID3D10Buffer *buffer;
ID3D10Device *device;
unsigned int i;
ULONG refcount;
HRESULT hr;
static const struct test
{
......@@ -1820,6 +1820,18 @@ static void test_create_buffer(void)
if (SUCCEEDED(hr))
ID3D10Buffer_Release(buffer);
memset(&desc, 0, sizeof(desc));
desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER;
for (i = 0; i <= 32; ++i)
{
desc.ByteWidth = i;
expected_hr = !i || i % 16 ? E_INVALIDARG : S_OK;
hr = ID3D10Device_CreateBuffer(device, &desc, NULL, &buffer);
ok(hr == expected_hr, "Got unexpected hr %#x for constant buffer size %u.\n", hr, i);
if (SUCCEEDED(hr))
ID3D10Buffer_Release(buffer);
}
refcount = ID3D10Device_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment