summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-11-13 08:54:18 +0100
committerbunnei <bunneidev@gmail.com>2022-03-25 02:13:33 +0100
commit5849c9a4cdcb3cb18c2b63c390365d2a00ddb916 (patch)
treea7e52d64a463d65f1a448c7f6c5364514be00488 /src/core/hle/service/nvflinger
parenthle: vi: Integrate new NVFlinger and HosBinderDriverServer service. (diff)
downloadyuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar.gz
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar.bz2
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar.lz
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar.xz
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.tar.zst
yuzu-5849c9a4cdcb3cb18c2b63c390365d2a00ddb916.zip
Diffstat (limited to 'src/core/hle/service/nvflinger')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_producer.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
index d48e96b14..a347f8b3b 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue_producer.cpp
@@ -793,8 +793,6 @@ Status BufferQueueProducer::SetPreallocatedBuffer(s32 slot,
const std::shared_ptr<GraphicBuffer>& buffer) {
LOG_DEBUG(Service_NVFlinger, "slot {}", slot);
- UNIMPLEMENTED_IF_MSG(!buffer, "buffer must be valid!");
-
if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
return Status::BadValue;
}
@@ -802,13 +800,18 @@ Status BufferQueueProducer::SetPreallocatedBuffer(s32 slot,
BufferQueueCore::AutoLock lock(core);
slots[slot] = {};
- slots[slot].is_preallocated = true;
slots[slot].graphic_buffer = buffer;
- core->override_max_buffer_count = core->GetPreallocatedBufferCountLocked();
- core->default_width = buffer->Width();
- core->default_height = buffer->Height();
- core->default_buffer_format = buffer->Format();
+ // Most games preallocate a buffer and pass a valid buffer here. However, it is possible for
+ // this to be called with an empty buffer, Naruto Ultimate Ninja Storm is a game that does this.
+ if (buffer) {
+ slots[slot].is_preallocated = true;
+
+ core->override_max_buffer_count = core->GetPreallocatedBufferCountLocked();
+ core->default_width = buffer->Width();
+ core->default_height = buffer->Height();
+ core->default_buffer_format = buffer->Format();
+ }
core->SignalDequeueCondition();
buffer_wait_event->GetWritableEvent().Signal();