[spirv] Add method to erase data from code buffer

This commit is contained in:
Philip Rebohle 2019-11-19 12:17:11 +01:00
parent 9f88249b91
commit 8252d1ccd5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 0 deletions

View File

@ -132,6 +132,13 @@ namespace dxvk {
}
void SpirvCodeBuffer::erase(size_t size) {
m_code.erase(
m_code.begin() + m_ptr,
m_code.begin() + m_ptr + size);
}
uint32_t SpirvCodeBuffer::strLen(const char* str) {
// Null-termination plus padding
return (std::strlen(str) + 4) / 4;

View File

@ -148,6 +148,15 @@ namespace dxvk {
* \param [in] boundIds Number of bound IDs
*/
void putHeader(uint32_t boundIds);
/**
* \brief Erases given number of dwords
*
* Removes data from the code buffer, starting
* at the current insertion offset.
* \param [in] size Number of words to remove
*/
void erase(size_t size);
/**
* \brief Computes length of a literal string