mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d: Validate heap type for render target and unordered access buffers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
d539adaff8
commit
b8a665e229
@@ -1051,12 +1051,20 @@ static HRESULT d3d12_resource_init(struct d3d12_resource *resource, struct d3d12
|
||||
|
||||
resource->desc = *desc;
|
||||
|
||||
if (d3d12_resource_is_texture(resource)
|
||||
&& (heap_properties->Type == D3D12_HEAP_TYPE_UPLOAD
|
||||
|| heap_properties->Type == D3D12_HEAP_TYPE_READBACK))
|
||||
if (heap_properties->Type == D3D12_HEAP_TYPE_UPLOAD
|
||||
|| heap_properties->Type == D3D12_HEAP_TYPE_READBACK)
|
||||
{
|
||||
WARN("Texture cannot be created on a UPLOAD/READBACK heap.\n");
|
||||
return E_INVALIDARG;
|
||||
if (d3d12_resource_is_texture(resource))
|
||||
{
|
||||
WARN("Textures cannot be created on upload/readback heaps.\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (desc->Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))
|
||||
{
|
||||
WARN("Render target and unordered access buffers cannot be created on upload/readback heaps.\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
}
|
||||
|
||||
if (heap_properties->Type == D3D12_HEAP_TYPE_UPLOAD && initial_state != D3D12_RESOURCE_STATE_GENERIC_READ)
|
||||
|
Reference in New Issue
Block a user