From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/resource.c | 5 +++++ tests/d3d12.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index b83a45d06..32f23ca23 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1893,6 +1893,11 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3 WARN("Invalid sample count 0.\n"); return E_INVALIDARG; } + if (desc->SampleDesc.Count > 1 && !(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET)) + { + WARN("Sample count %u invalid without ALLOW_RENDER_TARGET.\n", desc->SampleDesc.Count); + return E_INVALIDARG; + }
if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) { diff --git a/tests/d3d12.c b/tests/d3d12.c index 6a449762f..318325697 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1607,10 +1607,7 @@ static void test_create_committed_resource(void) resource_desc.Flags = 0; hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, NULL, &IID_ID3D12Resource, (void **)&resource); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D12Resource_Release(resource); resource_desc.SampleDesc.Count = 1; resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;