2017-10-16 17:50:09 +02:00
|
|
|
#include "dxbc_chunk_shex.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
DxbcShex::DxbcShex(DxbcReader reader) {
|
|
|
|
// The shader version and type are stored in a 32-bit unit,
|
|
|
|
// where the first byte contains the major and minor version
|
|
|
|
// numbers, and the high word contains the program type.
|
2018-10-08 09:22:58 +02:00
|
|
|
reader.skip(2);
|
2017-10-16 17:50:09 +02:00
|
|
|
auto pType = reader.readEnum<DxbcProgramType>();
|
2018-10-08 09:34:56 +02:00
|
|
|
m_programInfo = DxbcProgramInfo(pType);
|
2017-10-16 17:50:09 +02:00
|
|
|
|
|
|
|
// Read the actual shader code as an array of DWORDs.
|
|
|
|
auto codeLength = reader.readu32() - 2;
|
|
|
|
m_code.resize(codeLength);
|
|
|
|
reader.read(m_code.data(), codeLength * sizeof(uint32_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DxbcShex::~DxbcShex() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-08 09:22:58 +02:00
|
|
|
}
|