1
$\begingroup$

The D3D12 programming guide suggests specific allocation strategies for command queues and allocators, but the creation methods for those objects operate directly on queue/allocator pointers without taking a heap and an offset as an argument. How do I explicitly mark the memory I want to use for command processing?

$\endgroup$

1 Answer 1

2
$\begingroup$

You don't.

These objects typically work with CPU memory, not device memory. And to the extent that they involve device memory, such allocations tend to be rare and/or fixed in size (a queue may have a small spot of device memory that the hardware queue reads commands from or something, but even that is implementation-dependent).

Vulkan allows you to give objects which may allocate non-device memory allocation parameters to allow you to allocate said memory for them. But even then, there is no guarantee that they will always allocate memory through your functions. Such systems can bypass your allocation routines, and only tell you allocator that it is allocating X bytes of memory (this is typically done for memory pages that have to be allocated in a special way). It doesn't let you actually provide it.

That documentation does not seem to be talking about controlling how those objects allocate memory, but when and how you create those objects. Command allocators and queues are critical, so you create X allocators and Y queues at the start and keep them around forever.

$\endgroup$
1
  • $\begingroup$ Ah, that makes more sense. Thanks for the quick answer :) $\endgroup$ Commented Feb 18, 2019 at 0:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.