1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxbc] Print shader signatures at debug loglevel

This commit is contained in:
Liam Middlebrook 2019-07-10 14:57:37 -07:00 committed by Philip Rebohle
parent ff4fa29304
commit 2e83aae472
3 changed files with 33 additions and 2 deletions

View File

@ -83,6 +83,20 @@ namespace dxvk {
return result; return result;
} }
void DxbcIsgn::printEntries() const {
for (auto entry = this->begin(); entry != this->end(); entry++) {
Logger::debug(str::format("SGN Entry:\n\t",
"semanticName: ", entry->semanticName, "\n\t",
"semanticIndex: ", entry->semanticIndex, "\n\t",
"registerId: ", entry->registerId, "\n\t",
"componentMask: ", entry->componentMask.maskString(), "\n\t",
"componentType: ", entry->componentType, "\n\t",
"systemValue: ", entry->systemValue, "\n\t",
"streamId: ", entry->streamId, "\n",
"\n"));
}
}
bool DxbcIsgn::compareSemanticNames( bool DxbcIsgn::compareSemanticNames(
const std::string& a, const std::string& b) const { const std::string& a, const std::string& b) const {
@ -97,4 +111,4 @@ namespace dxvk {
return true; return true;
} }
} }

View File

@ -53,6 +53,8 @@ namespace dxvk {
uint32_t registerId) const; uint32_t registerId) const;
uint32_t maxRegisterCount() const; uint32_t maxRegisterCount() const;
void printEntries() const;
private: private:
@ -64,4 +66,4 @@ namespace dxvk {
}; };
} }

View File

@ -32,6 +32,21 @@ namespace dxvk {
spv::SourceLanguageUnknown, 0, spv::SourceLanguageUnknown, 0,
m_module.addDebugString(fileName.c_str()), m_module.addDebugString(fileName.c_str()),
nullptr); nullptr);
if (Logger::logLevel() <= LogLevel::Debug) {
if (m_isgn != nullptr) {
Logger::debug(str::format("Input Signature for - ", fileName.c_str(), "\n"));
m_isgn->printEntries();
}
if (m_osgn != nullptr) {
Logger::debug(str::format("Output Signature for - ", fileName.c_str(), "\n"));
m_osgn->printEntries();
}
if (m_psgn != nullptr) {
Logger::debug(str::format("Patch Constant Signature for - ", fileName.c_str(), "\n"));
m_psgn->printEntries();
}
}
// Set the memory model. This is the same for all shaders. // Set the memory model. This is the same for all shaders.
m_module.setMemoryModel( m_module.setMemoryModel(