summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-18 02:11:41 +0200
committerbunnei <bunneidev@gmail.com>2018-07-18 02:13:17 +0200
commitc3dd456d513a989315d4e8a00ad8a1223bb8f9c4 (patch)
tree25e349c1885d70d9338841faaa16f31976e09994 /src/core/hle/service/nvflinger
parentMerge pull request #675 from Subv/stencil (diff)
downloadyuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar.gz
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar.bz2
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar.lz
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar.xz
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.tar.zst
yuzu-c3dd456d513a989315d4e8a00ad8a1223bb8f9c4.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp4
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.h5
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index a181cd2dc..7132b18ad 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -57,13 +57,15 @@ const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const {
return itr->igbp_buffer;
}
-void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform) {
+void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform,
+ const MathUtil::Rectangle<int>& crop_rect) {
auto itr = std::find_if(queue.begin(), queue.end(),
[&](const Buffer& buffer) { return buffer.slot == slot; });
ASSERT(itr != queue.end());
ASSERT(itr->status == Buffer::Status::Dequeued);
itr->status = Buffer::Status::Queued;
itr->transform = transform;
+ itr->crop_rect = crop_rect;
}
boost::optional<const BufferQueue::Buffer&> BufferQueue::AcquireBuffer() {
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index 1e55b487e..004170538 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -6,6 +6,7 @@
#include <vector>
#include <boost/optional.hpp>
+#include "common/math_util.h"
#include "common/swap.h"
#include "core/hle/kernel/event.h"
@@ -68,12 +69,14 @@ public:
Status status = Status::Free;
IGBPBuffer igbp_buffer;
BufferTransformFlags transform;
+ MathUtil::Rectangle<int> crop_rect;
};
void SetPreallocatedBuffer(u32 slot, IGBPBuffer& buffer);
boost::optional<u32> DequeueBuffer(u32 width, u32 height);
const IGBPBuffer& RequestBuffer(u32 slot) const;
- void QueueBuffer(u32 slot, BufferTransformFlags transform);
+ void QueueBuffer(u32 slot, BufferTransformFlags transform,
+ const MathUtil::Rectangle<int>& crop_rect);
boost::optional<const Buffer&> AcquireBuffer();
void ReleaseBuffer(u32 slot);
u32 Query(QueryType type);
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 826646b7d..d580f779e 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -149,7 +149,8 @@ void NVFlinger::Compose() {
ASSERT(nvdisp);
nvdisp->flip(igbp_buffer.gpu_buffer_id, igbp_buffer.offset, igbp_buffer.format,
- igbp_buffer.width, igbp_buffer.height, igbp_buffer.stride, buffer->transform);
+ igbp_buffer.width, igbp_buffer.height, igbp_buffer.stride, buffer->transform,
+ buffer->crop_rect);
buffer_queue->ReleaseBuffer(buffer->slot);
}