Commit 372ca933 authored by Sven Hesse's avatar Sven Hesse Committed by Alexandre Julliard

d3d11: Implement d3d10_texture1d_GetDesc().

parent d7d0deab
...@@ -1368,6 +1368,16 @@ static void test_create_texture1d(void) ...@@ -1368,6 +1368,16 @@ static void test_create_texture1d(void)
ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount);
ID3D10Device_Release(tmp); ID3D10Device_Release(tmp);
ID3D10Texture1D_GetDesc(texture, &desc);
ok(desc.Width == 512, "Got unexpected Width %u.\n", desc.Width);
ok(desc.MipLevels == 10, "Got unexpected MipLevels %u.\n", desc.MipLevels);
ok(desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", desc.ArraySize);
ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format);
ok(desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected Usage %u.\n", desc.Usage);
ok(desc.BindFlags == D3D10_BIND_SHADER_RESOURCE, "Got unexpected BindFlags %#x.\n", desc.BindFlags);
ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %#x.\n", desc.CPUAccessFlags);
ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %#x.\n", desc.MiscFlags);
check_interface(texture, &IID_IDXGISurface, FALSE, FALSE); check_interface(texture, &IID_IDXGISurface, FALSE, FALSE);
ID3D10Texture1D_Release(texture); ID3D10Texture1D_Release(texture);
......
...@@ -1992,6 +1992,7 @@ static void test_texture1d_interfaces(void) ...@@ -1992,6 +1992,7 @@ static void test_texture1d_interfaces(void)
for (i = 0; i < ARRAY_SIZE(desc_conversion_tests); ++i) for (i = 0; i < ARRAY_SIZE(desc_conversion_tests); ++i)
{ {
const struct test *current = &desc_conversion_tests[i]; const struct test *current = &desc_conversion_tests[i];
D3D10_TEXTURE1D_DESC d3d10_desc;
ID3D10Device *d3d10_device; ID3D10Device *d3d10_device;
desc.Width = 512; desc.Width = 512;
...@@ -2029,6 +2030,23 @@ static void test_texture1d_interfaces(void) ...@@ -2029,6 +2030,23 @@ static void test_texture1d_interfaces(void)
continue; continue;
} }
ID3D10Texture1D_GetDesc(d3d10_texture, &d3d10_desc);
ok(d3d10_desc.Width == desc.Width,
"Test %u: Got unexpected Width %u.\n", i, d3d10_desc.Width);
ok(d3d10_desc.MipLevels == desc.MipLevels,
"Test %u: Got unexpected MipLevels %u.\n", i, d3d10_desc.MipLevels);
ok(d3d10_desc.ArraySize == desc.ArraySize,
"Test %u: Got unexpected ArraySize %u.\n", i, d3d10_desc.ArraySize);
ok(d3d10_desc.Format == desc.Format,
"Test %u: Got unexpected Format %u.\n", i, d3d10_desc.Format);
ok(d3d10_desc.BindFlags == current->expected_bind_flags,
"Test %u: Got unexpected BindFlags %#x.\n", i, d3d10_desc.BindFlags);
ok(d3d10_desc.CPUAccessFlags == desc.CPUAccessFlags,
"Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d10_desc.CPUAccessFlags);
ok(d3d10_desc.MiscFlags == current->expected_misc_flags,
"Test %u: Got unexpected MiscFlags %#x.\n", i, d3d10_desc.MiscFlags);
d3d10_device = (ID3D10Device *)0xdeadbeef; d3d10_device = (ID3D10Device *)0xdeadbeef;
ID3D10Texture1D_GetDevice(d3d10_texture, &d3d10_device); ID3D10Texture1D_GetDevice(d3d10_texture, &d3d10_device);
todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device); todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device);
...@@ -360,7 +360,21 @@ static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT ...@@ -360,7 +360,21 @@ static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc) static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
{ {
FIXME("iface %p, desc %p stub!\n", iface, desc); struct d3d_texture1d *texture = impl_from_ID3D10Texture1D(iface);
D3D11_TEXTURE1D_DESC d3d11_desc;
TRACE("iface %p, desc %p.\n", iface, desc);
d3d11_texture1d_GetDesc(&texture->ID3D11Texture1D_iface, &d3d11_desc);
desc->Width = d3d11_desc.Width;
desc->MipLevels = d3d11_desc.MipLevels;
desc->ArraySize = d3d11_desc.ArraySize;
desc->Format = d3d11_desc.Format;
desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc.Usage);
desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc.BindFlags);
desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc.CPUAccessFlags);
desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc.MiscFlags);
} }
static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl = static const struct ID3D10Texture1DVtbl d3d10_texture1d_vtbl =
......
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