libs/vkd3d: Validate "optimized_clear_value" for buffer resources.

This commit is contained in:
Józef Kucia
2016-10-19 13:10:12 +02:00
parent 60959ecf3c
commit f601cbc04a
2 changed files with 19 additions and 4 deletions

View File

@ -621,9 +621,6 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st
resource->desc = *desc;
if (optimized_clear_value)
FIXME("Ignoring optimized clear value.\n");
if (desc->Dimension != D3D12_RESOURCE_DIMENSION_BUFFER
&& (heap_properties->Type == D3D12_HEAP_TYPE_UPLOAD || heap_properties->Type == D3D12_HEAP_TYPE_READBACK))
{
@ -642,6 +639,15 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st
return E_INVALIDARG;
}
if (optimized_clear_value && desc->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
{
WARN("Optimized clear value must be NULL for buffers.\n");
return E_INVALIDARG;
}
if (optimized_clear_value)
FIXME("Ignoring optimized clear value.\n");
switch (desc->Dimension)
{
case D3D12_RESOURCE_DIMENSION_BUFFER: