From: Sven Hesse shesse@codeweavers.com
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/d3d10core/tests/device.c | 10 ++++++++++ dlls/d3d11/tests/d3d11.c | 18 ++++++++++++++++++ dlls/d3d11/texture.c | 16 +++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 0a9c43c317d..8b0567696c9 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -1368,6 +1368,16 @@ static void test_create_texture1d(void) ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); 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); ID3D10Texture1D_Release(texture);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ca30a553521..2f47124a232 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -1992,6 +1992,7 @@ static void test_texture1d_interfaces(void) for (i = 0; i < ARRAY_SIZE(desc_conversion_tests); ++i) { const struct test *current = &desc_conversion_tests[i]; + D3D10_TEXTURE1D_DESC d3d10_desc; ID3D10Device *d3d10_device;
desc.Width = 512; @@ -2029,6 +2030,23 @@ static void test_texture1d_interfaces(void) 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; ID3D10Texture1D_GetDevice(d3d10_texture, &d3d10_device); todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device); diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index c6998ed29c4..58f822c7320 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -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) { - 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 =