mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Separated buffer renaming from allocation
This commit is contained in:
parent
70e5314cc6
commit
f68655feff
@ -47,13 +47,20 @@ namespace dxvk {
|
|||||||
VkMemoryPropertyFlags memoryType)
|
VkMemoryPropertyFlags memoryType)
|
||||||
: m_device (device),
|
: m_device (device),
|
||||||
m_info (createInfo),
|
m_info (createInfo),
|
||||||
m_memFlags(memoryType) {
|
m_memFlags(memoryType),
|
||||||
this->allocateResource();
|
m_resource(allocateResource()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkBuffer::allocateResource() {
|
void DxvkBuffer::renameResource(
|
||||||
m_resource = m_device->allocBufferResource(m_info, m_memFlags);
|
const Rc<DxvkBufferResource>& resource) {
|
||||||
|
m_resource = resource;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Rc<DxvkBufferResource> DxvkBuffer::allocateResource() {
|
||||||
|
return m_device->allocBufferResource(m_info, m_memFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,14 +149,22 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Allocates new backing resource
|
* \brief Replaces backing resource
|
||||||
*
|
*
|
||||||
* Replaces the underlying buffer and implicitly marks
|
* Replaces the underlying buffer and implicitly marks
|
||||||
* any buffer views using this resource as dirty. Do
|
* any buffer views using this resource as dirty. Do
|
||||||
* not call this directly as this is called implicitly
|
* not call this directly as this is called implicitly
|
||||||
* by the context's \c invalidateBuffer method.
|
* by the context's \c invalidateBuffer method.
|
||||||
|
* \param [in] resource The new backing resource
|
||||||
*/
|
*/
|
||||||
void allocateResource();
|
void renameResource(
|
||||||
|
const Rc<DxvkBufferResource>& resource);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Allocates new backing resource
|
||||||
|
* \returns The new buffer
|
||||||
|
*/
|
||||||
|
Rc<DxvkBufferResource> allocateResource();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -354,7 +354,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkContext::invalidateBuffer(const Rc<DxvkBuffer>& buffer) {
|
void DxvkContext::invalidateBuffer(const Rc<DxvkBuffer>& buffer) {
|
||||||
// Allocate new backing resource
|
// Allocate new backing resource
|
||||||
buffer->allocateResource();
|
buffer->renameResource(
|
||||||
|
buffer->allocateResource());
|
||||||
|
|
||||||
// We also need to update all bindings that the buffer
|
// We also need to update all bindings that the buffer
|
||||||
// may be bound to either directly or through views.
|
// may be bound to either directly or through views.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user