mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-01 08:52:11 +01:00
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#include "dxbc_chunk_isgn.h"
|
|
|
|
namespace dxvk {
|
|
|
|
DxbcIsgn::DxbcIsgn(DxbcReader reader) {
|
|
uint32_t elementCount = reader.readu32();
|
|
reader.skip(sizeof(uint32_t));
|
|
|
|
std::array<DxbcScalarType, 4> componentTypes = {
|
|
DxbcScalarType::Uint32, DxbcScalarType::Uint32,
|
|
DxbcScalarType::Sint32, DxbcScalarType::Float32,
|
|
};
|
|
|
|
for (uint32_t i = 0; i < elementCount; i++) {
|
|
DxbcSgnEntry entry;
|
|
entry.semanticName = reader.clone(reader.readu32()).readString();
|
|
entry.semanticIndex = reader.readu32();
|
|
entry.systemValue = static_cast<DxbcSystemValue>(reader.readu32());
|
|
entry.componentType = componentTypes.at(reader.readu32());
|
|
entry.registerId = reader.readu32();
|
|
entry.componentMask = bit::extract(reader.readu32(), 0, 3);
|
|
|
|
m_entries.push_back(entry);
|
|
}
|
|
}
|
|
|
|
|
|
DxbcIsgn::~DxbcIsgn() {
|
|
|
|
}
|
|
|
|
|
|
const DxbcSgnEntry* DxbcIsgn::find(
|
|
const std::string& semanticName,
|
|
uint32_t semanticIndex) const {
|
|
for (auto e = this->begin(); e != this->end(); e++) {
|
|
if (e->semanticName == semanticName
|
|
&& e->semanticIndex == semanticIndex)
|
|
return &(*e);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
} |