D3D12: Optionally prevent StreamBuffer from executing command list

This applies to callers that do not have full knowledge of the command
list state, and thus, cannot restore it should allocations cause command
list execution. Instead we reallocate a new buffer. Should not happen
often enough for this to be a concern, as it's mainly for the utility
classes.
This commit is contained in:
Stenzek
2016-02-23 22:12:03 +10:00
parent 04257029e0
commit 13e143de38
2 changed files with 34 additions and 14 deletions

View File

@ -17,7 +17,7 @@ public:
D3DStreamBuffer(size_t initial_size, size_t max_size, bool* buffer_reallocation_notification);
~D3DStreamBuffer();
bool AllocateSpaceInBuffer(size_t allocation_size, size_t alignment);
bool AllocateSpaceInBuffer(size_t allocation_size, size_t alignment, bool allow_execute = true);
void OverrideSizeOfPreviousAllocation(size_t override_allocation_size);
void* GetBaseCPUAddress() const;
@ -32,7 +32,7 @@ public:
private:
void AllocateBuffer(size_t size);
bool AttemptBufferResizeOrElseStall(size_t new_size);
bool AttemptBufferResizeOrElseStall(size_t allocation_size, bool allow_execute);
bool AttemptToAllocateOutOfExistingUnusedSpaceInBuffer(size_t allocation_size);
@ -40,6 +40,7 @@ private:
void UpdateGPUProgress();
void ClearFences();
bool HasBufferOffsetChangedSinceLastFence() const;
void QueueFence(UINT64 fence_value);