diff --git a/src/d3d11/d3d11_buffer.h b/src/d3d11/d3d11_buffer.h index 1782469d..82a3df51 100644 --- a/src/d3d11/d3d11_buffer.h +++ b/src/d3d11/d3d11_buffer.h @@ -64,11 +64,11 @@ namespace dxvk { } DxvkBufferSlice GetBufferSlice() const { - return DxvkBufferSlice(m_buffer, 0, m_buffer->info().size); + return GetBufferSlice(0, m_desc.ByteWidth); } DxvkBufferSlice GetBufferSlice(VkDeviceSize offset) const { - return DxvkBufferSlice(m_buffer, offset, m_buffer->info().size - offset); + return GetBufferSlice(offset, m_desc.ByteWidth - offset); } DxvkBufferSlice GetBufferSlice(VkDeviceSize offset, VkDeviceSize length) const { @@ -79,10 +79,6 @@ namespace dxvk { return m_soCounter; } - VkDeviceSize GetSize() const { - return m_desc.ByteWidth; - } - DxvkPhysicalBufferSlice DiscardSlice() { m_mapped = m_buffer->allocPhysicalSlice(); return m_mapped; diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 3fa841e8..c79d22df 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -3041,7 +3041,7 @@ namespace dxvk { UINT constantOffset = 0; UINT constantCount = newBuffer != nullptr - ? newBuffer->GetSize() / 16 + ? newBuffer->Desc()->ByteWidth / 16 : 0; if (newBuffer != nullptr && pFirstConstant != nullptr && pNumConstants != nullptr) { diff --git a/src/d3d11/d3d11_context_def.cpp b/src/d3d11/d3d11_context_def.cpp index 08923858..a4048ca3 100644 --- a/src/d3d11/d3d11_context_def.cpp +++ b/src/d3d11/d3d11_context_def.cpp @@ -167,8 +167,8 @@ namespace dxvk { pMapEntry->pResource = pResource; pMapEntry->Subresource = 0; pMapEntry->MapType = D3D11_MAP_WRITE_DISCARD; - pMapEntry->RowPitch = pBuffer->GetSize(); - pMapEntry->DepthPitch = pBuffer->GetSize(); + pMapEntry->RowPitch = pBuffer->Desc()->ByteWidth; + pMapEntry->DepthPitch = pBuffer->Desc()->ByteWidth; if (pBuffer->Desc()->Usage == D3D11_USAGE_DYNAMIC && m_parent->GetOptions()->dcMapSpeedHack) { // For resources that cannot be written by the GPU, @@ -179,7 +179,7 @@ namespace dxvk { } else { // For GPU-writable resources, we need a data slice // to perform the update operation at execution time. - pMapEntry->DataSlice = AllocUpdateBufferSlice(pBuffer->GetSize()); + pMapEntry->DataSlice = AllocUpdateBufferSlice(pBuffer->Desc()->ByteWidth); pMapEntry->MapPointer = pMapEntry->DataSlice.ptr(); } diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 9bfded2e..85035273 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -345,8 +345,8 @@ namespace dxvk { // only way to invalidate a buffer is by mapping it. auto physicalSlice = pResource->DiscardSlice(); pMappedResource->pData = physicalSlice.mapPtr(0); - pMappedResource->RowPitch = pResource->GetSize(); - pMappedResource->DepthPitch = pResource->GetSize(); + pMappedResource->RowPitch = pResource->Desc()->ByteWidth; + pMappedResource->DepthPitch = pResource->Desc()->ByteWidth; EmitCs([ cBuffer = std::move(buffer), @@ -369,8 +369,8 @@ namespace dxvk { DxvkPhysicalBufferSlice physicalSlice = pResource->GetMappedSlice(); pMappedResource->pData = physicalSlice.mapPtr(0); - pMappedResource->RowPitch = pResource->GetSize(); - pMappedResource->DepthPitch = pResource->GetSize(); + pMappedResource->RowPitch = pResource->Desc()->ByteWidth; + pMappedResource->DepthPitch = pResource->Desc()->ByteWidth; return S_OK; } }