Skip to content

Commit 28876e0

Browse files
vkd3d: Validate against ID3D12Heap desc, not allocation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
1 parent 4fd7d3a commit 28876e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/vkd3d/resource.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,10 +3955,10 @@ HRESULT d3d12_resource_create_placed(struct d3d12_device *device, const D3D12_RE
39553955

39563956
heap_offset = align(heap->allocation.offset + heap_offset, memory_requirements.alignment) - heap->allocation.offset;
39573957

3958-
if (heap_offset + memory_requirements.size > heap->allocation.resource.size)
3958+
if (heap_offset + memory_requirements.size > heap->desc.SizeInBytes)
39593959
{
39603960
ERR("Heap too small for the texture (heap=%"PRIu64", res=%"PRIu64".\n",
3961-
heap->allocation.resource.size, heap_offset + memory_requirements.size);
3961+
heap->desc.SizeInBytes, heap_offset + memory_requirements.size);
39623962
hr = E_INVALIDARG;
39633963
goto fail;
39643964
}
@@ -3989,10 +3989,10 @@ HRESULT d3d12_resource_create_placed(struct d3d12_device *device, const D3D12_RE
39893989
}
39903990
else
39913991
{
3992-
if (heap_offset + desc->Width > heap->allocation.resource.size)
3992+
if (heap_offset + desc->Width > heap->desc.SizeInBytes)
39933993
{
39943994
ERR("Heap too small for the buffer (heap=%"PRIu64", res=%"PRIu64".\n",
3995-
heap->allocation.resource.size, heap_offset + desc->Width);
3995+
heap->desc.SizeInBytes, heap_offset + desc->Width);
39963996
hr = E_INVALIDARG;
39973997
goto fail;
39983998
}

0 commit comments

Comments
 (0)