mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-14 09:23:53 +01:00
736f743ae4
Seems to be anything up to 3x as fast to decode than the previous code, with the compression ratio being slightly worse. Encoding seems faster as well.
38 lines
600 B
C++
38 lines
600 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "spirv_code_buffer.h"
|
|
|
|
namespace dxvk {
|
|
|
|
/**
|
|
* \brief Compressed SPIR-V code buffer
|
|
*
|
|
* Implements a fast in-memory compression
|
|
* to keep memory footprint low.
|
|
*/
|
|
class SpirvCompressedBuffer {
|
|
|
|
public:
|
|
|
|
SpirvCompressedBuffer();
|
|
|
|
SpirvCompressedBuffer(SpirvCodeBuffer& code);
|
|
|
|
~SpirvCompressedBuffer();
|
|
|
|
SpirvCodeBuffer decompress() const;
|
|
|
|
private:
|
|
|
|
size_t m_size;
|
|
std::vector<uint32_t> m_code;
|
|
|
|
void encodeDword(uint32_t dw);
|
|
|
|
uint32_t decodeDword(size_t& offset) const;
|
|
|
|
};
|
|
|
|
} |