From ec3ab0adbdaef69fddac6876e2995662c39a0a40 Mon Sep 17 00:00:00 2001 From: gibbed Date: Wed, 30 May 2018 20:49:30 -0500 Subject: [PATCH] [GPU] Stub out context update GPU opcode. [Vulkan] Gracefully handle vertex upload failures. --- src/xenia/gpu/command_processor.cc | 8 ++++++++ src/xenia/gpu/vulkan/buffer_cache.cc | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index 3acbe392e..bdb66deb5 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -700,6 +700,14 @@ bool CommandProcessor::ExecutePacketType3(RingBuffer* reader, uint32_t packet) { bin_select_ = (val_hi << 32) | val_lo; result = true; } break; + case PM4_CONTEXT_UPDATE: { + assert_true(count == 1); + uint64_t value = reader->ReadAndSwap(); + XELOGGPU("GPU context update = %.8X", value); + assert_true(value == 0); + result = true; + break; + } default: XELOGGPU("Unimplemented GPU OPCODE: 0x%.2X\t\tCOUNT: %d\n", opcode, diff --git a/src/xenia/gpu/vulkan/buffer_cache.cc b/src/xenia/gpu/vulkan/buffer_cache.cc index 1005fec01..cd1fb7ba8 100644 --- a/src/xenia/gpu/vulkan/buffer_cache.cc +++ b/src/xenia/gpu/vulkan/buffer_cache.cc @@ -507,6 +507,10 @@ std::pair BufferCache::UploadVertexBuffer( offset = AllocateTransientData(upload_size, fence); if (offset == VK_WHOLE_SIZE) { // OOM. + XELOGW( + "Failed to allocate transient data for vertex buffer! Wanted to " + "allocate %u bytes.", + upload_size); return {nullptr, VK_WHOLE_SIZE}; } @@ -655,6 +659,7 @@ VkDescriptorSet BufferCache::PrepareVertexSet( static_cast(fetch->endian), fence); if (buffer_ref.second == VK_WHOLE_SIZE) { // Failed to upload buffer. + XELOGW("Failed to upload vertex buffer!"); return nullptr; } @@ -759,7 +764,12 @@ void BufferCache::Flush(VkCommandBuffer command_buffer) { vkFlushMappedMemoryRanges(*device_, 1, &dirty_range); } -void BufferCache::InvalidateCache() { transient_cache_.clear(); } +void BufferCache::InvalidateCache() { + // Called by VulkanCommandProcessor::MakeCoherent() + // Discard everything? + transient_cache_.clear(); +} + void BufferCache::ClearCache() { transient_cache_.clear(); } void BufferCache::Scavenge() {