mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[Vulkan] Fix a couple validation errors
This commit is contained in:
parent
103ecbab7e
commit
16cf9883ca
|
|
@ -147,10 +147,10 @@ VkResult xe::gpu::vulkan::BufferCache::CreateVertexDescriptorPool() {
|
||||||
std::vector<VkDescriptorPoolSize> pool_sizes;
|
std::vector<VkDescriptorPoolSize> pool_sizes;
|
||||||
pool_sizes.push_back({
|
pool_sizes.push_back({
|
||||||
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
||||||
32768,
|
65536,
|
||||||
});
|
});
|
||||||
vertex_descriptor_pool_ =
|
vertex_descriptor_pool_ =
|
||||||
std::make_unique<ui::vulkan::DescriptorPool>(*device_, 32768, pool_sizes);
|
std::make_unique<ui::vulkan::DescriptorPool>(*device_, 65536, pool_sizes);
|
||||||
|
|
||||||
// 32 storage buffers available to vertex shader.
|
// 32 storage buffers available to vertex shader.
|
||||||
// TODO(DrChat): In the future, this could hold memexport staging data.
|
// 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).
|
// This may not be possible (with indexed vfetch).
|
||||||
uint32_t source_length = fetch->size * 4;
|
uint32_t source_length = fetch->size * 4;
|
||||||
uint32_t physical_address = fetch->address << 2;
|
uint32_t physical_address = fetch->address << 2;
|
||||||
|
|
||||||
|
// TODO(DrChat): This needs to be put in gpu::CommandProcessor
|
||||||
// trace_writer_.WriteMemoryRead(physical_address, source_length);
|
// trace_writer_.WriteMemoryRead(physical_address, source_length);
|
||||||
|
|
||||||
// Upload (or get a cached copy of) the buffer.
|
// Upload (or get a cached copy of) the buffer.
|
||||||
|
|
|
||||||
|
|
@ -689,7 +689,7 @@ bool VulkanCommandProcessor::IssueDraw(PrimitiveType primitive_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload and bind all vertex buffer data.
|
// Upload and bind all vertex buffer data.
|
||||||
if (!PopulateVertexBuffers(command_buffer, vertex_shader)) {
|
if (!PopulateVertexBuffers(command_buffer, setup_buffer, vertex_shader)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -810,7 +810,8 @@ bool VulkanCommandProcessor::PopulateIndexBuffer(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VulkanCommandProcessor::PopulateVertexBuffers(
|
bool VulkanCommandProcessor::PopulateVertexBuffers(
|
||||||
VkCommandBuffer command_buffer, VulkanShader* vertex_shader) {
|
VkCommandBuffer command_buffer, VkCommandBuffer setup_buffer,
|
||||||
|
VulkanShader* vertex_shader) {
|
||||||
auto& regs = *register_file_;
|
auto& regs = *register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
@ -825,7 +826,7 @@ bool VulkanCommandProcessor::PopulateVertexBuffers(
|
||||||
|
|
||||||
assert_true(vertex_bindings.size() <= 32);
|
assert_true(vertex_bindings.size() <= 32);
|
||||||
auto descriptor_set = buffer_cache_->PrepareVertexSet(
|
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,
|
vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
pipeline_cache_->pipeline_layout(), 2, 1,
|
pipeline_cache_->pipeline_layout(), 2, 1,
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ class VulkanCommandProcessor : public CommandProcessor {
|
||||||
bool PopulateIndexBuffer(VkCommandBuffer command_buffer,
|
bool PopulateIndexBuffer(VkCommandBuffer command_buffer,
|
||||||
IndexBufferInfo* index_buffer_info);
|
IndexBufferInfo* index_buffer_info);
|
||||||
bool PopulateVertexBuffers(VkCommandBuffer command_buffer,
|
bool PopulateVertexBuffers(VkCommandBuffer command_buffer,
|
||||||
|
VkCommandBuffer setup_buffer,
|
||||||
VulkanShader* vertex_shader);
|
VulkanShader* vertex_shader);
|
||||||
bool PopulateSamplers(VkCommandBuffer command_buffer,
|
bool PopulateSamplers(VkCommandBuffer command_buffer,
|
||||||
VkCommandBuffer setup_buffer,
|
VkCommandBuffer setup_buffer,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue