mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
VideoCommon: Use std::span for BoundingBox::Write()
Crosses off a lingering TODO. Also amends a few nearby cases where a u32 cast was being repromoted to size_t.
This commit is contained in:
@ -56,9 +56,9 @@ std::vector<BBoxType> D3D12BoundingBox::Read(u32 index, u32 length)
|
||||
return values;
|
||||
}
|
||||
|
||||
void D3D12BoundingBox::Write(u32 index, const std::vector<BBoxType>& values)
|
||||
void D3D12BoundingBox::Write(u32 index, std::span<const BBoxType> values)
|
||||
{
|
||||
const u32 copy_size = static_cast<u32>(values.size()) * sizeof(BBoxType);
|
||||
const u32 copy_size = static_cast<u32>(values.size() * sizeof(BBoxType));
|
||||
if (!m_upload_buffer.ReserveMemory(copy_size, sizeof(BBoxType)))
|
||||
{
|
||||
WARN_LOG_FMT(VIDEO, "Executing command list while waiting for space in bbox stream buffer");
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
|
||||
protected:
|
||||
std::vector<BBoxType> Read(u32 index, u32 length) override;
|
||||
void Write(u32 index, const std::vector<BBoxType>& values) override;
|
||||
void Write(u32 index, std::span<const BBoxType> values) override;
|
||||
|
||||
private:
|
||||
static constexpr u32 BUFFER_SIZE = sizeof(BBoxType) * NUM_BBOX_VALUES;
|
||||
|
Reference in New Issue
Block a user