mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -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:
@ -88,12 +88,12 @@ std::vector<BBoxType> D3DBoundingBox::Read(u32 index, u32 length)
|
||||
return values;
|
||||
}
|
||||
|
||||
void D3DBoundingBox::Write(u32 index, const std::vector<BBoxType>& values)
|
||||
void D3DBoundingBox::Write(u32 index, std::span<const BBoxType> values)
|
||||
{
|
||||
D3D11_BOX box{index * sizeof(BBoxType),
|
||||
0,
|
||||
0,
|
||||
static_cast<u32>(index + values.size()) * sizeof(BBoxType),
|
||||
static_cast<u32>((index + values.size()) * sizeof(BBoxType)),
|
||||
1,
|
||||
1};
|
||||
D3D::context->UpdateSubresource(m_buffer.Get(), 0, &box, values.data(), 0, 0);
|
||||
|
@ -19,7 +19,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:
|
||||
ComPtr<ID3D11Buffer> m_buffer;
|
||||
|
Reference in New Issue
Block a user