[GPU] Stub out context update GPU opcode.

[Vulkan] Gracefully handle vertex upload failures.
This commit is contained in:
gibbed 2018-05-30 20:49:30 -05:00
parent bbebfd49c8
commit ec3ab0adbd
2 changed files with 19 additions and 1 deletions

View File

@ -700,6 +700,14 @@ bool CommandProcessor::ExecutePacketType3(RingBuffer* reader, uint32_t packet) {
bin_select_ = (val_hi << 32) | val_lo; bin_select_ = (val_hi << 32) | val_lo;
result = true; result = true;
} break; } break;
case PM4_CONTEXT_UPDATE: {
assert_true(count == 1);
uint64_t value = reader->ReadAndSwap<uint32_t>();
XELOGGPU("GPU context update = %.8X", value);
assert_true(value == 0);
result = true;
break;
}
default: default:
XELOGGPU("Unimplemented GPU OPCODE: 0x%.2X\t\tCOUNT: %d\n", opcode, XELOGGPU("Unimplemented GPU OPCODE: 0x%.2X\t\tCOUNT: %d\n", opcode,

View File

@ -507,6 +507,10 @@ std::pair<VkBuffer, VkDeviceSize> BufferCache::UploadVertexBuffer(
offset = AllocateTransientData(upload_size, fence); offset = AllocateTransientData(upload_size, fence);
if (offset == VK_WHOLE_SIZE) { if (offset == VK_WHOLE_SIZE) {
// OOM. // OOM.
XELOGW(
"Failed to allocate transient data for vertex buffer! Wanted to "
"allocate %u bytes.",
upload_size);
return {nullptr, VK_WHOLE_SIZE}; return {nullptr, VK_WHOLE_SIZE};
} }
@ -655,6 +659,7 @@ VkDescriptorSet BufferCache::PrepareVertexSet(
static_cast<Endian>(fetch->endian), fence); static_cast<Endian>(fetch->endian), fence);
if (buffer_ref.second == VK_WHOLE_SIZE) { if (buffer_ref.second == VK_WHOLE_SIZE) {
// Failed to upload buffer. // Failed to upload buffer.
XELOGW("Failed to upload vertex buffer!");
return nullptr; return nullptr;
} }
@ -759,7 +764,12 @@ void BufferCache::Flush(VkCommandBuffer command_buffer) {
vkFlushMappedMemoryRanges(*device_, 1, &dirty_range); 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::ClearCache() { transient_cache_.clear(); }
void BufferCache::Scavenge() { void BufferCache::Scavenge() {