1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 22:54:16 +01:00

[dxvk] Optimize retrieval of dynamic buffer offsets

This commit is contained in:
Philip Rebohle 2018-09-20 15:19:33 +02:00
parent f61ff5d345
commit 2eda95f61a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 31 additions and 1 deletions

View File

@ -79,6 +79,16 @@ namespace dxvk {
DxvkDescriptorInfo getDescriptor(VkDeviceSize offset, VkDeviceSize length, bool keepOffset) const {
return m_physSlice.getDescriptor(offset, length, keepOffset);
}
/**
* \brief Retrieves dynamic offset
*
* \param [in] offset Offset into the buffer
* \returns Physical buffer slice offset
*/
VkDeviceSize getDynamicOffset(VkDeviceSize offset) const {
return m_physSlice.getDynamicOffset(offset);
}
/**
* \brief Underlying buffer resource
@ -269,6 +279,16 @@ namespace dxvk {
DxvkDescriptorInfo getDescriptor(bool keepOffset) const {
return m_buffer->getDescriptor(m_offset, m_length, keepOffset);
}
/**
* \brief Retrieves dynamic offset
*
* Used for descriptor set binding.
* \returns Buffer slice offset
*/
VkDeviceSize getDynamicOffset() const {
return m_buffer->getDynamicOffset(m_offset);
}
/**
* \brief Pointer to mapped memory region

View File

@ -196,6 +196,16 @@ namespace dxvk {
offset = keepOffset ? m_offset + offset : 0;
return m_buffer->getDescriptor(offset, length);
}
/**
* \brief Retrieves dynamic offset
*
* \param [in] offset Offset into the slice
* \returns Physical buffer slice offset
*/
VkDeviceSize getDynamicOffset(VkDeviceSize offset) const {
return m_offset + offset;
}
/**
* \brief Map pointer

View File

@ -2305,7 +2305,7 @@ namespace dxvk {
const auto& res = m_rc[binding.slot];
m_descOffsets[i] = res.bufferSlice.defined()
? res.bufferSlice.physicalSlice().offset()
? res.bufferSlice.getDynamicOffset()
: 0;
}