mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[spirv] Add method to allocate new ID from code buffer.
This commit is contained in:
parent
014798161c
commit
9f88249b91
@ -40,6 +40,16 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvCodeBuffer::allocId() {
|
||||
constexpr size_t BoundIdsOffset = 3;
|
||||
|
||||
if (m_code.size() <= BoundIdsOffset)
|
||||
return 0;
|
||||
|
||||
return m_code[BoundIdsOffset]++;
|
||||
}
|
||||
|
||||
|
||||
void SpirvCodeBuffer::append(const SpirvCodeBuffer& other) {
|
||||
if (other.size() != 0) {
|
||||
const size_t size = m_code.size();
|
||||
|
@ -76,6 +76,15 @@ namespace dxvk {
|
||||
return SpirvInstructionIterator(nullptr, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Allocates a new ID
|
||||
*
|
||||
* Returns a new valid ID and increments the
|
||||
* maximum ID count stored in the header.
|
||||
* \returns The new SPIR-V ID
|
||||
*/
|
||||
uint32_t allocId();
|
||||
|
||||
/**
|
||||
* \brief Merges two code buffers
|
||||
*
|
||||
@ -101,7 +110,7 @@ namespace dxvk {
|
||||
* \param [in] wordCount Number of words
|
||||
*/
|
||||
void putIns(spv::Op opCode, uint16_t wordCount);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Appends a 32-bit integer to the buffer
|
||||
* \param [in] value The number to add
|
||||
|
Loading…
x
Reference in New Issue
Block a user