mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-07 07:46:19 +01:00
[dxvk] Get rid of some old debug code for compute pipelines
This commit is contained in:
parent
c392308e6f
commit
0ad7a08c49
@ -1,4 +1,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "../util/util_time.h"
|
#include "../util/util_time.h"
|
||||||
|
|
||||||
@ -101,11 +103,6 @@ namespace dxvk {
|
|||||||
const DxvkComputePipelineStateInfo& state) const {
|
const DxvkComputePipelineStateInfo& state) const {
|
||||||
auto vk = m_device->vkd();
|
auto vk = m_device->vkd();
|
||||||
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
|
||||||
Logger::debug("Compiling compute pipeline...");
|
|
||||||
Logger::debug(str::format(" cs : ", m_shaders.cs->debugName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
DxvkPipelineSpecConstantState scState(m_shaders.cs->getSpecConstantMask(), state.sc);
|
DxvkPipelineSpecConstantState scState(m_shaders.cs->getSpecConstantMask(), state.sc);
|
||||||
|
|
||||||
DxvkShaderStageInfo stageInfo(m_device);
|
DxvkShaderStageInfo stageInfo(m_device);
|
||||||
@ -118,24 +115,14 @@ namespace dxvk {
|
|||||||
info.layout = m_bindings->getPipelineLayout(false);
|
info.layout = m_bindings->getPipelineLayout(false);
|
||||||
info.basePipelineIndex = -1;
|
info.basePipelineIndex = -1;
|
||||||
|
|
||||||
// Time pipeline compilation for debugging purposes
|
|
||||||
dxvk::high_resolution_clock::time_point t0, t1;
|
|
||||||
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug)
|
|
||||||
t0 = dxvk::high_resolution_clock::now();
|
|
||||||
|
|
||||||
VkPipeline pipeline = VK_NULL_HANDLE;
|
VkPipeline pipeline = VK_NULL_HANDLE;
|
||||||
if (vk->vkCreateComputePipelines(vk->device(),
|
VkResult vr = vk->vkCreateComputePipelines(vk->device(),
|
||||||
VK_NULL_HANDLE, 1, &info, nullptr, &pipeline) != VK_SUCCESS) {
|
VK_NULL_HANDLE, 1, &info, nullptr, &pipeline);
|
||||||
Logger::err("DxvkComputePipeline: Failed to compile pipeline");
|
|
||||||
Logger::err(str::format(" cs : ", m_shaders.cs->debugName()));
|
|
||||||
return VK_NULL_HANDLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
if (vr != VK_SUCCESS) {
|
||||||
t1 = dxvk::high_resolution_clock::now();
|
Logger::err(str::format("DxvkComputePipeline: Failed to compile pipeline: ", vr));
|
||||||
auto td = std::chrono::duration_cast<std::chrono::milliseconds>(t1 - t0);
|
this->logPipelineState(LogLevel::Error, state);
|
||||||
Logger::debug(str::format("DxvkComputePipeline: Finished in ", td.count(), " ms"));
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pipeline;
|
return pipeline;
|
||||||
@ -159,4 +146,27 @@ namespace dxvk {
|
|||||||
m_stateCache->addComputePipeline(key, state);
|
m_stateCache->addComputePipeline(key, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkComputePipeline::logPipelineState(
|
||||||
|
LogLevel level,
|
||||||
|
const DxvkComputePipelineStateInfo& state) const {
|
||||||
|
std::stringstream sstr;
|
||||||
|
sstr << " cs : " << m_shaders.cs->debugName() << std::endl;
|
||||||
|
|
||||||
|
bool hasSpecConstants = false;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < MaxNumSpecConstants; i++) {
|
||||||
|
if (state.sc.specConstants[i]) {
|
||||||
|
if (!hasSpecConstants) {
|
||||||
|
sstr << "Specialization constants:" << std::endl;
|
||||||
|
hasSpecConstants = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
sstr << " " << i << ": 0x" << std::hex << std::setw(8) << std::setfill('0') << state.sc.specConstants[i] << std::dec << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger::log(level, sstr.str());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -152,6 +152,10 @@ namespace dxvk {
|
|||||||
void writePipelineStateToCache(
|
void writePipelineStateToCache(
|
||||||
const DxvkComputePipelineStateInfo& state) const;
|
const DxvkComputePipelineStateInfo& state) const;
|
||||||
|
|
||||||
|
void logPipelineState(
|
||||||
|
LogLevel level,
|
||||||
|
const DxvkComputePipelineStateInfo& state) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user