summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-04-05 04:29:56 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-04-10 06:00:50 +0200
commit8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b (patch)
treee9044c8e123298d98a608d1835ace1f41a07c9a0 /src/core/hle/service/vi
parentMerge pull request #3623 from ReinUsesLisp/renderdoc-bind-spam (diff)
downloadyuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar.gz
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar.bz2
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar.lz
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar.xz
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.tar.zst
yuzu-8c0ba9c6fe3e311e3acc476f4925eae0b1aaa09b.zip
Diffstat (limited to 'src/core/hle/service/vi')
-rw-r--r--src/core/hle/service/vi/vi.cpp46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 519da74e0..fdc62d05b 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -513,7 +513,8 @@ private:
auto& buffer_queue = nv_flinger->FindBufferQueue(id);
- if (transaction == TransactionId::Connect) {
+ switch (transaction) {
+ case TransactionId::Connect: {
IGBPConnectRequestParcel request{ctx.ReadBuffer()};
IGBPConnectResponseParcel response{
static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedWidth) *
@@ -521,14 +522,18 @@ private:
static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) *
Settings::values.resolution_factor)};
ctx.WriteBuffer(response.Serialize());
- } else if (transaction == TransactionId::SetPreallocatedBuffer) {
+ break;
+ }
+ case TransactionId::SetPreallocatedBuffer: {
IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()};
buffer_queue.SetPreallocatedBuffer(request.data.slot, request.buffer);
IGBPSetPreallocatedBufferResponseParcel response{};
ctx.WriteBuffer(response.Serialize());
- } else if (transaction == TransactionId::DequeueBuffer) {
+ break;
+ }
+ case TransactionId::DequeueBuffer: {
IGBPDequeueBufferRequestParcel request{ctx.ReadBuffer()};
const u32 width{request.data.width};
const u32 height{request.data.height};
@@ -556,14 +561,18 @@ private:
},
buffer_queue.GetWritableBufferWaitEvent());
}
- } else if (transaction == TransactionId::RequestBuffer) {
+ break;
+ }
+ case TransactionId::RequestBuffer: {
IGBPRequestBufferRequestParcel request{ctx.ReadBuffer()};
auto& buffer = buffer_queue.RequestBuffer(request.slot);
IGBPRequestBufferResponseParcel response{buffer};
ctx.WriteBuffer(response.Serialize());
- } else if (transaction == TransactionId::QueueBuffer) {
+ break;
+ }
+ case TransactionId::QueueBuffer: {
IGBPQueueBufferRequestParcel request{ctx.ReadBuffer()};
buffer_queue.QueueBuffer(request.data.slot, request.data.transform,
@@ -572,7 +581,9 @@ private:
IGBPQueueBufferResponseParcel response{1280, 720};
ctx.WriteBuffer(response.Serialize());
- } else if (transaction == TransactionId::Query) {
+ break;
+ }
+ case TransactionId::Query: {
IGBPQueryRequestParcel request{ctx.ReadBuffer()};
const u32 value =
@@ -580,15 +591,30 @@ private:
IGBPQueryResponseParcel response{value};
ctx.WriteBuffer(response.Serialize());
- } else if (transaction == TransactionId::CancelBuffer) {
+ break;
+ }
+ case TransactionId::CancelBuffer: {
LOG_CRITICAL(Service_VI, "(STUBBED) called, transaction=CancelBuffer");
- } else if (transaction == TransactionId::Disconnect ||
- transaction == TransactionId::DetachBuffer) {
+ break;
+ }
+ case TransactionId::Disconnect: {
+ LOG_WARNING(Service_VI, "(STUBBED) called, transaction=Disconnect");
+ const auto buffer = ctx.ReadBuffer();
+
+ buffer_queue.Disconnect();
+
+ IGBPEmptyResponseParcel response{};
+ ctx.WriteBuffer(response.Serialize());
+ break;
+ }
+ case TransactionId::DetachBuffer: {
const auto buffer = ctx.ReadBuffer();
IGBPEmptyResponseParcel response{};
ctx.WriteBuffer(response.Serialize());
- } else {
+ break;
+ }
+ default:
ASSERT_MSG(false, "Unimplemented");
}