diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index d68ea5b1e..e252b5f4b 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -313,6 +313,18 @@ public: | |||
| 313 | /// Helper function to get the size of the output buffer | 313 | /// Helper function to get the size of the output buffer |
| 314 | [[nodiscard]] std::size_t GetWriteBufferSize(std::size_t buffer_index = 0) const; | 314 | [[nodiscard]] std::size_t GetWriteBufferSize(std::size_t buffer_index = 0) const; |
| 315 | 315 | ||
| 316 | /// Helper function to derive the number of elements able to be contained in the read buffer | ||
| 317 | template <typename T> | ||
| 318 | [[nodiscard]] std::size_t GetReadBufferNumElements(std::size_t buffer_index = 0) const { | ||
| 319 | return GetReadBufferSize(buffer_index) / sizeof(T); | ||
| 320 | } | ||
| 321 | |||
| 322 | /// Helper function to derive the number of elements able to be contained in the write buffer | ||
| 323 | template <typename T> | ||
| 324 | [[nodiscard]] std::size_t GetWriteBufferNumElements(std::size_t buffer_index = 0) const { | ||
| 325 | return GetWriteBufferSize(buffer_index) / sizeof(T); | ||
| 326 | } | ||
| 327 | |||
| 316 | /// Helper function to test whether the input buffer at buffer_index can be read | 328 | /// Helper function to test whether the input buffer at buffer_index can be read |
| 317 | [[nodiscard]] bool CanReadBuffer(std::size_t buffer_index = 0) const; | 329 | [[nodiscard]] bool CanReadBuffer(std::size_t buffer_index = 0) const; |
| 318 | 330 | ||