1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxvk] Introduce bindVertexBufferRange and bindIndexBufferRange

This commit is contained in:
Philip Rebohle 2022-08-07 15:37:35 +02:00
parent 26d46e7f80
commit 08b9b0eb44
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -149,6 +149,24 @@ namespace dxvk {
m_flags.set(DxvkContextFlag::GpDirtyIndexBuffer);
}
/**
* \brief Binds index buffer range
*
* Canges the offset and size of the bound index buffer.
* \param [in] offset Index buffer offset
* \param [in] length Index buffer size
* \param [in] indexType Index type
*/
void bindIndexBufferRange(
VkDeviceSize offset,
VkDeviceSize length,
VkIndexType indexType) {
m_state.vi.indexBuffer.setRange(offset, length);
m_state.vi.indexType = indexType;
m_flags.set(DxvkContextFlag::GpDirtyIndexBuffer);
}
/**
* \brief Binds buffer as a shader resource
*
@ -322,6 +340,25 @@ namespace dxvk {
m_flags.set(DxvkContextFlag::GpDirtyVertexBuffers);
}
/**
* \brief Binds vertex buffer range
*
* Only changes offsets of a bound vertex buffer.
* \param [in] binding Vertex buffer binding
* \param [in] offset Vertex buffer offset
* \param [in] length Vertex buffer size
* \param [in] stride Stride between vertices
*/
void bindVertexBufferRange(
uint32_t binding,
VkDeviceSize offset,
VkDeviceSize length,
uint32_t stride) {
m_state.vi.vertexBuffers[binding].setRange(offset, length);
m_state.vi.vertexStrides[binding] = stride;
m_flags.set(DxvkContextFlag::GpDirtyVertexBuffers);
}
/**
* \brief Binds transform feedback buffer
*