From 16cf9883ca7bf5dd74ed3955d72bf54bc9b80357 Mon Sep 17 00:00:00 2001 From: DrChat Date: Mon, 19 Feb 2018 11:18:10 -0600 Subject: [PATCH] [Vulkan] Fix a couple validation errors --- src/xenia/gpu/vulkan/buffer_cache.cc | 6 ++++-- src/xenia/gpu/vulkan/vulkan_command_processor.cc | 7 ++++--- src/xenia/gpu/vulkan/vulkan_command_processor.h | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/xenia/gpu/vulkan/buffer_cache.cc b/src/xenia/gpu/vulkan/buffer_cache.cc index 3f1a093d3..46d6da8e8 100644 --- a/src/xenia/gpu/vulkan/buffer_cache.cc +++ b/src/xenia/gpu/vulkan/buffer_cache.cc @@ -147,10 +147,10 @@ VkResult xe::gpu::vulkan::BufferCache::CreateVertexDescriptorPool() { std::vector pool_sizes; pool_sizes.push_back({ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - 32768, + 65536, }); vertex_descriptor_pool_ = - std::make_unique(*device_, 32768, pool_sizes); + std::make_unique(*device_, 65536, pool_sizes); // 32 storage buffers available to vertex shader. // TODO(DrChat): In the future, this could hold memexport staging data. @@ -599,6 +599,8 @@ VkDescriptorSet BufferCache::PrepareVertexSet( // This may not be possible (with indexed vfetch). uint32_t source_length = fetch->size * 4; uint32_t physical_address = fetch->address << 2; + + // TODO(DrChat): This needs to be put in gpu::CommandProcessor // trace_writer_.WriteMemoryRead(physical_address, source_length); // Upload (or get a cached copy of) the buffer. diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 7f9503204..d1fbe58e5 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -689,7 +689,7 @@ bool VulkanCommandProcessor::IssueDraw(PrimitiveType primitive_type, } // Upload and bind all vertex buffer data. - if (!PopulateVertexBuffers(command_buffer, vertex_shader)) { + if (!PopulateVertexBuffers(command_buffer, setup_buffer, vertex_shader)) { return false; } @@ -810,7 +810,8 @@ bool VulkanCommandProcessor::PopulateIndexBuffer( } bool VulkanCommandProcessor::PopulateVertexBuffers( - VkCommandBuffer command_buffer, VulkanShader* vertex_shader) { + VkCommandBuffer command_buffer, VkCommandBuffer setup_buffer, + VulkanShader* vertex_shader) { auto& regs = *register_file_; #if FINE_GRAINED_DRAW_SCOPES @@ -825,7 +826,7 @@ bool VulkanCommandProcessor::PopulateVertexBuffers( assert_true(vertex_bindings.size() <= 32); auto descriptor_set = buffer_cache_->PrepareVertexSet( - command_buffer, current_batch_fence_, vertex_bindings); + setup_buffer, current_batch_fence_, vertex_bindings); vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_cache_->pipeline_layout(), 2, 1, diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.h b/src/xenia/gpu/vulkan/vulkan_command_processor.h index 0f5100152..3a1add0fe 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.h +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.h @@ -86,6 +86,7 @@ class VulkanCommandProcessor : public CommandProcessor { bool PopulateIndexBuffer(VkCommandBuffer command_buffer, IndexBufferInfo* index_buffer_info); bool PopulateVertexBuffers(VkCommandBuffer command_buffer, + VkCommandBuffer setup_buffer, VulkanShader* vertex_shader); bool PopulateSamplers(VkCommandBuffer command_buffer, VkCommandBuffer setup_buffer,