mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-16 19:38:21 -05:00
hle_ipc: Add ReadBufferSpan function
Returns a std::span to the buffer address, rather than create a copy of the memory into a std::vector
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
@ -273,6 +274,8 @@ public:
|
||||
/// Helper function to read a buffer using the appropriate buffer descriptor
|
||||
[[nodiscard]] std::vector<u8> ReadBuffer(std::size_t buffer_index = 0) const;
|
||||
|
||||
[[nodiscard]] std::span<const u8> ReadBufferSpan(std::size_t buffer_index = 0) const;
|
||||
|
||||
/// Helper function to write a buffer using the appropriate buffer descriptor
|
||||
std::size_t WriteBuffer(const void* buffer, std::size_t size,
|
||||
std::size_t buffer_index = 0) const;
|
||||
|
Reference in New Issue
Block a user