summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrChat <arkolbed@gmail.com>2018-02-16 16:51:32 -0600
committerDrChat <arkolbed@gmail.com>2018-02-16 16:51:32 -0600
commit776b5eff36ea797fbebbcf8b82e3668180187dec (patch)
tree03139f124ef8c9158b89cc785a8f4a820e8d2118
parentdb53559611ccf5fe1b2cf034217352f33a0d3567 (diff)
[Vulkan] BufferCache: Add VertexBuffer struct
-rw-r--r--src/xenia/gpu/vulkan/buffer_cache.cc8
-rw-r--r--src/xenia/gpu/vulkan/buffer_cache.h9
2 files changed, 9 insertions, 8 deletions
diff --git a/src/xenia/gpu/vulkan/buffer_cache.cc b/src/xenia/gpu/vulkan/buffer_cache.cc
index ef5491cfd..b9a0292ea 100644
--- a/src/xenia/gpu/vulkan/buffer_cache.cc
+++ b/src/xenia/gpu/vulkan/buffer_cache.cc
@@ -284,13 +284,6 @@ std::pair<VkDeviceSize, VkDeviceSize> BufferCache::UploadConstantRegisters(
std::pair<VkBuffer, VkDeviceSize> BufferCache::UploadIndexBuffer(
VkCommandBuffer command_buffer, uint32_t source_addr,
uint32_t source_length, IndexFormat format, VkFence fence) {
- /*
- auto offset = FindCachedTransientData(source_addr, source_length);
- if (offset != VK_WHOLE_SIZE) {
- return {transient_buffer_->gpu_buffer(), offset};
- }
- */
-
// Allocate space in the buffer for our data.
auto offset = AllocateTransientData(source_length, fence);
if (offset == VK_WHOLE_SIZE) {
@@ -331,7 +324,6 @@ std::pair<VkBuffer, VkDeviceSize> BufferCache::UploadIndexBuffer(
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, 0, nullptr, 1,
&barrier, 0, nullptr);
- // CacheTransientData(source_addr, source_length, offset);
return {transient_buffer_->gpu_buffer(), offset};
}
diff --git a/src/xenia/gpu/vulkan/buffer_cache.h b/src/xenia/gpu/vulkan/buffer_cache.h
index 513aa4f65..2f321f26f 100644
--- a/src/xenia/gpu/vulkan/buffer_cache.h
+++ b/src/xenia/gpu/vulkan/buffer_cache.h
@@ -97,6 +97,15 @@ class BufferCache {
void Scavenge();
private:
+ // This represents an uploaded vertex buffer.
+ struct VertexBuffer {
+ uint32_t guest_address;
+ uint32_t size;
+
+ VmaAllocation alloc;
+ VmaAllocationInfo alloc_info;
+ };
+
// Allocates a block of memory in the transient buffer.
// When memory is not available fences are checked and space is reclaimed.
// Returns VK_WHOLE_SIZE if requested amount of memory is not available.