Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config flag for forced no-suballocation #2234

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
vkd3d: Validate against ID3D12Heap desc, not allocation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
HansKristian-Work committed Nov 27, 2024
commit 28876e09d95d95b2a827f1790739449fc020c2ec
8 changes: 4 additions & 4 deletions libs/vkd3d/resource.c
Original file line number Diff line number Diff line change
@@ -3955,10 +3955,10 @@ HRESULT d3d12_resource_create_placed(struct d3d12_device *device, const D3D12_RE

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

if (heap_offset + memory_requirements.size > heap->allocation.resource.size)
if (heap_offset + memory_requirements.size > heap->desc.SizeInBytes)
{
ERR("Heap too small for the texture (heap=%"PRIu64", res=%"PRIu64".\n",
heap->allocation.resource.size, heap_offset + memory_requirements.size);
heap->desc.SizeInBytes, heap_offset + memory_requirements.size);
hr = E_INVALIDARG;
goto fail;
}
@@ -3989,10 +3989,10 @@ HRESULT d3d12_resource_create_placed(struct d3d12_device *device, const D3D12_RE
}
else
{
if (heap_offset + desc->Width > heap->allocation.resource.size)
if (heap_offset + desc->Width > heap->desc.SizeInBytes)
{
ERR("Heap too small for the buffer (heap=%"PRIu64", res=%"PRIu64".\n",
heap->allocation.resource.size, heap_offset + desc->Width);
heap->desc.SizeInBytes, heap_offset + desc->Width);
hr = E_INVALIDARG;
goto fail;
}