mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-28 07:54:14 +01:00
[dxvk] Optimize retrieval of dynamic buffer offsets
This commit is contained in:
parent
f61ff5d345
commit
2eda95f61a
@ -80,6 +80,16 @@ namespace dxvk {
|
|||||||
return m_physSlice.getDescriptor(offset, length, keepOffset);
|
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
|
* \brief Underlying buffer resource
|
||||||
*
|
*
|
||||||
@ -270,6 +280,16 @@ namespace dxvk {
|
|||||||
return m_buffer->getDescriptor(m_offset, m_length, keepOffset);
|
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
|
* \brief Pointer to mapped memory region
|
||||||
*
|
*
|
||||||
|
@ -197,6 +197,16 @@ namespace dxvk {
|
|||||||
return m_buffer->getDescriptor(offset, length);
|
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
|
* \brief Map pointer
|
||||||
*
|
*
|
||||||
|
@ -2305,7 +2305,7 @@ namespace dxvk {
|
|||||||
const auto& res = m_rc[binding.slot];
|
const auto& res = m_rc[binding.slot];
|
||||||
|
|
||||||
m_descOffsets[i] = res.bufferSlice.defined()
|
m_descOffsets[i] = res.bufferSlice.defined()
|
||||||
? res.bufferSlice.physicalSlice().offset()
|
? res.bufferSlice.getDynamicOffset()
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user