Vulkan: Fix register constants on AMD

This commit is contained in:
Dr. Chat
2017-03-13 23:43:34 -05:00
parent 5f5dc61428
commit 855ebb9cfe
5 changed files with 83 additions and 16 deletions

View File

@@ -232,6 +232,16 @@ void CircularBuffer::Flush(Allocation* allocation) {
vkFlushMappedMemoryRanges(*device_, 1, &range);
}
void CircularBuffer::Flush(VkDeviceSize offset, VkDeviceSize length) {
VkMappedMemoryRange range;
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
range.pNext = nullptr;
range.memory = gpu_memory_;
range.offset = gpu_base_ + offset;
range.size = length;
vkFlushMappedMemoryRanges(*device_, 1, &range);
}
void CircularBuffer::Clear() {
for (auto alloc : allocations_) {
delete alloc;

View File

@@ -61,6 +61,7 @@ class CircularBuffer {
// reaches the signaled state.
Allocation* Acquire(VkDeviceSize length, VkFence fence);
void Flush(Allocation* allocation);
void Flush(VkDeviceSize offset, VkDeviceSize length);
// Clears all allocations, regardless of whether they've been consumed or not.
void Clear();