diff --git a/src/backend/d3d12/BufferD3D12.cpp b/src/backend/d3d12/BufferD3D12.cpp index 6222516219..1836660233 100644 --- a/src/backend/d3d12/BufferD3D12.cpp +++ b/src/backend/d3d12/BufferD3D12.cpp @@ -100,7 +100,7 @@ namespace d3d12 { } void Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) { - device->GetResourceUploader()->UploadToBuffer(resource, start * sizeof(uint32_t), count * sizeof(uint32_t), reinterpret_cast(data)); + device->GetResourceUploader()->BufferSubData(resource, start * sizeof(uint32_t), count * sizeof(uint32_t), data); } void Buffer::MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) { diff --git a/src/backend/d3d12/ResourceUploader.cpp b/src/backend/d3d12/ResourceUploader.cpp index fde5ac4ae7..80f113749f 100644 --- a/src/backend/d3d12/ResourceUploader.cpp +++ b/src/backend/d3d12/ResourceUploader.cpp @@ -23,7 +23,7 @@ namespace d3d12 { ResourceUploader::ResourceUploader(Device* device) : device(device) { } - void ResourceUploader::UploadToBuffer(ComPtr resource, uint32_t start, uint32_t count, const uint8_t* data) { + void ResourceUploader::BufferSubData(ComPtr resource, uint32_t start, uint32_t count, const void* data) { // TODO(enga@google.com): Use a handle to a subset of a large ring buffer. On Release, decrease reference count on the ring buffer and free when 0. // Alternatively, the SerialQueue could be used to track which last point of the ringbuffer is in use, and start reusing chunks of it that aren't in flight. UploadHandle uploadHandle = GetUploadBuffer(count); diff --git a/src/backend/d3d12/ResourceUploader.h b/src/backend/d3d12/ResourceUploader.h index 12fe867149..470f0016bc 100644 --- a/src/backend/d3d12/ResourceUploader.h +++ b/src/backend/d3d12/ResourceUploader.h @@ -28,7 +28,7 @@ namespace d3d12 { public: ResourceUploader(Device* device); - void UploadToBuffer(ComPtr resource, uint32_t start, uint32_t count, const uint8_t* data); + void BufferSubData(ComPtr resource, uint32_t start, uint32_t count, const void* data); private: struct UploadHandle {