mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[hud] Don't pass DXVK context around in HUD modules
This commit is contained in:
parent
8e587af0da
commit
4346f82209
@ -87,7 +87,7 @@ namespace dxvk::hud {
|
|||||||
HudPos position = { 8.0f, 24.0f };
|
HudPos position = { 8.0f, 24.0f };
|
||||||
|
|
||||||
if (m_config.elements.test(HudElement::DxvkVersion)) {
|
if (m_config.elements.test(HudElement::DxvkVersion)) {
|
||||||
m_renderer.drawText(ctx, 16.0f,
|
m_renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
"DXVK " DXVK_VERSION);
|
"DXVK " DXVK_VERSION);
|
||||||
@ -95,20 +95,18 @@ namespace dxvk::hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_config.elements.test(HudElement::DxvkClientApi)) {
|
if (m_config.elements.test(HudElement::DxvkClientApi)) {
|
||||||
m_renderer.drawText(ctx, 16.0f,
|
m_renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_device->clientApi());
|
m_device->clientApi());
|
||||||
position.y += 24.0f;
|
position.y += 24.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_config.elements.test(HudElement::DeviceInfo)) {
|
if (m_config.elements.test(HudElement::DeviceInfo))
|
||||||
position = m_hudDeviceInfo.render(
|
position = m_hudDeviceInfo.render(m_renderer, position);
|
||||||
ctx, m_renderer, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
position = m_hudFramerate.render(ctx, m_renderer, position);
|
position = m_hudFramerate.render(m_renderer, position);
|
||||||
position = m_hudStats .render(ctx, m_renderer, position);
|
position = m_hudStats .render(m_renderer, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,20 +22,19 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudDeviceInfo::render(
|
HudPos HudDeviceInfo::render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_deviceName);
|
m_deviceName);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 24 },
|
{ position.x, position.y + 24 },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_driverVer);
|
m_driverVer);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 44 },
|
{ position.x, position.y + 44 },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_vulkanVer);
|
m_vulkanVer);
|
||||||
|
@ -18,7 +18,6 @@ namespace dxvk::hud {
|
|||||||
~HudDeviceInfo();
|
~HudDeviceInfo();
|
||||||
|
|
||||||
HudPos render(
|
HudPos render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
|
@ -43,28 +43,22 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudFps::render(
|
HudPos HudFps::render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
if (m_elements.test(HudElement::Framerate)) {
|
if (m_elements.test(HudElement::Framerate))
|
||||||
position = this->renderFpsText(
|
position = this->renderFpsText(renderer, position);
|
||||||
context, renderer, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_elements.test(HudElement::Frametimes)) {
|
if (m_elements.test(HudElement::Frametimes))
|
||||||
position = this->renderFrametimeGraph(
|
position = this->renderFrametimeGraph(renderer, position);
|
||||||
context, renderer, position);
|
|
||||||
}
|
|
||||||
|
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HudPos HudFps::renderFpsText(
|
HudPos HudFps::renderFpsText(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_fpsString);
|
m_fpsString);
|
||||||
@ -74,7 +68,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudFps::renderFrametimeGraph(
|
HudPos HudFps::renderFrametimeGraph(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
std::array<HudLineVertex, NumDataPoints * 2> vData;
|
std::array<HudLineVertex, NumDataPoints * 2> vData;
|
||||||
@ -116,15 +109,15 @@ namespace dxvk::hud {
|
|||||||
vData[2 * i + 1] = HudLineVertex { { x, y - h }, color };
|
vData[2 * i + 1] = HudLineVertex { { x, y - h }, color };
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.drawLines(context, vData.size(), vData.data());
|
renderer.drawLines(vData.size(), vData.data());
|
||||||
|
|
||||||
// Paint min/max frame times in the entire window
|
// Paint min/max frame times in the entire window
|
||||||
renderer.drawText(context, 14.0f,
|
renderer.drawText(14.0f,
|
||||||
{ position.x, position.y + 44.0f },
|
{ position.x, position.y + 44.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
str::format("min: ", minMs / 10, ".", minMs % 10));
|
str::format("min: ", minMs / 10, ".", minMs % 10));
|
||||||
|
|
||||||
renderer.drawText(context, 14.0f,
|
renderer.drawText(14.0f,
|
||||||
{ position.x + 150.0f, position.y + 44.0f },
|
{ position.x + 150.0f, position.y + 44.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
str::format("max: ", maxMs / 10, ".", maxMs % 10));
|
str::format("max: ", maxMs / 10, ".", maxMs % 10));
|
||||||
|
@ -27,7 +27,6 @@ namespace dxvk::hud {
|
|||||||
void update();
|
void update();
|
||||||
|
|
||||||
HudPos render(
|
HudPos render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
@ -45,12 +44,10 @@ namespace dxvk::hud {
|
|||||||
uint32_t m_dataPointId = 0;
|
uint32_t m_dataPointId = 0;
|
||||||
|
|
||||||
HudPos renderFpsText(
|
HudPos renderFpsText(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos renderFrametimeGraph(
|
HudPos renderFrametimeGraph(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
|
@ -36,25 +36,23 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
m_mode = Mode::RenderNone;
|
m_mode = Mode::RenderNone;
|
||||||
m_surfaceSize = surfaceSize;
|
m_surfaceSize = surfaceSize;
|
||||||
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HudRenderer::drawText(
|
void HudRenderer::drawText(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
float size,
|
float size,
|
||||||
HudPos pos,
|
HudPos pos,
|
||||||
HudColor color,
|
HudColor color,
|
||||||
const std::string& text) {
|
const std::string& text) {
|
||||||
beginTextRendering(context);
|
beginTextRendering();
|
||||||
|
|
||||||
uint32_t vertexCount = 6 * text.size();
|
uint32_t vertexCount = 6 * text.size();
|
||||||
|
|
||||||
auto vertexSlice = allocVertexBuffer(context,
|
auto vertexSlice = allocVertexBuffer(vertexCount * sizeof(HudTextVertex));
|
||||||
vertexCount * sizeof(HudTextVertex));
|
m_context->bindVertexBuffer(0, vertexSlice, sizeof(HudTextVertex));
|
||||||
|
m_context->pushConstants(0, sizeof(color), &color);
|
||||||
context->bindVertexBuffer(0, vertexSlice, sizeof(HudTextVertex));
|
m_context->draw(vertexCount, 1, 0, 0);
|
||||||
context->pushConstants(0, sizeof(color), &color);
|
|
||||||
context->draw(vertexCount, 1, 0, 0);
|
|
||||||
|
|
||||||
auto vertexData = reinterpret_cast<HudTextVertex*>(
|
auto vertexData = reinterpret_cast<HudTextVertex*>(
|
||||||
vertexSlice.getSliceHandle().mapPtr);
|
vertexSlice.getSliceHandle().mapPtr);
|
||||||
@ -108,16 +106,13 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
void HudRenderer::drawLines(
|
void HudRenderer::drawLines(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
size_t vertexCount,
|
size_t vertexCount,
|
||||||
const HudLineVertex* vertexData) {
|
const HudLineVertex* vertexData) {
|
||||||
beginLineRendering(context);
|
beginLineRendering();
|
||||||
|
|
||||||
auto vertexSlice = allocVertexBuffer(context,
|
auto vertexSlice = allocVertexBuffer(vertexCount * sizeof(HudLineVertex));
|
||||||
vertexCount * sizeof(HudLineVertex));
|
m_context->bindVertexBuffer(0, vertexSlice, sizeof(HudLineVertex));
|
||||||
|
m_context->draw(vertexCount, 1, 0, 0);
|
||||||
context->bindVertexBuffer(0, vertexSlice, sizeof(HudLineVertex));
|
|
||||||
context->draw(vertexCount, 1, 0, 0);
|
|
||||||
|
|
||||||
auto dstVertexData = reinterpret_cast<HudLineVertex*>(
|
auto dstVertexData = reinterpret_cast<HudLineVertex*>(
|
||||||
vertexSlice.getSliceHandle().mapPtr);
|
vertexSlice.getSliceHandle().mapPtr);
|
||||||
@ -128,12 +123,11 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
DxvkBufferSlice HudRenderer::allocVertexBuffer(
|
DxvkBufferSlice HudRenderer::allocVertexBuffer(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
VkDeviceSize dataSize) {
|
VkDeviceSize dataSize) {
|
||||||
dataSize = align(dataSize, 64);
|
dataSize = align(dataSize, 64);
|
||||||
|
|
||||||
if (m_vertexOffset + dataSize > m_vertexBuffer->info().size) {
|
if (m_vertexOffset + dataSize > m_vertexBuffer->info().size) {
|
||||||
context->invalidateBuffer(m_vertexBuffer, m_vertexBuffer->allocSlice());
|
m_context->invalidateBuffer(m_vertexBuffer, m_vertexBuffer->allocSlice());
|
||||||
m_vertexOffset = 0;
|
m_vertexOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,13 +137,12 @@ namespace dxvk::hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HudRenderer::beginTextRendering(
|
void HudRenderer::beginTextRendering() {
|
||||||
const Rc<DxvkContext>& context) {
|
|
||||||
if (m_mode != Mode::RenderText) {
|
if (m_mode != Mode::RenderText) {
|
||||||
m_mode = Mode::RenderText;
|
m_mode = Mode::RenderText;
|
||||||
|
|
||||||
context->bindShader(VK_SHADER_STAGE_VERTEX_BIT, m_textShaders.vert);
|
m_context->bindShader(VK_SHADER_STAGE_VERTEX_BIT, m_textShaders.vert);
|
||||||
context->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, m_textShaders.frag);
|
m_context->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, m_textShaders.frag);
|
||||||
|
|
||||||
static const DxvkInputAssemblyState iaState = {
|
static const DxvkInputAssemblyState iaState = {
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
||||||
@ -164,8 +157,8 @@ namespace dxvk::hud {
|
|||||||
{ 0, VK_VERTEX_INPUT_RATE_VERTEX },
|
{ 0, VK_VERTEX_INPUT_RATE_VERTEX },
|
||||||
}};
|
}};
|
||||||
|
|
||||||
context->setInputAssemblyState(iaState);
|
m_context->setInputAssemblyState(iaState);
|
||||||
context->setInputLayout(
|
m_context->setInputLayout(
|
||||||
ilAttributes.size(),
|
ilAttributes.size(),
|
||||||
ilAttributes.data(),
|
ilAttributes.data(),
|
||||||
ilBindings.size(),
|
ilBindings.size(),
|
||||||
@ -174,13 +167,12 @@ namespace dxvk::hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HudRenderer::beginLineRendering(
|
void HudRenderer::beginLineRendering() {
|
||||||
const Rc<DxvkContext>& context) {
|
|
||||||
if (m_mode != Mode::RenderLines) {
|
if (m_mode != Mode::RenderLines) {
|
||||||
m_mode = Mode::RenderLines;
|
m_mode = Mode::RenderLines;
|
||||||
|
|
||||||
context->bindShader(VK_SHADER_STAGE_VERTEX_BIT, m_lineShaders.vert);
|
m_context->bindShader(VK_SHADER_STAGE_VERTEX_BIT, m_lineShaders.vert);
|
||||||
context->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, m_lineShaders.frag);
|
m_context->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, m_lineShaders.frag);
|
||||||
|
|
||||||
static const DxvkInputAssemblyState iaState = {
|
static const DxvkInputAssemblyState iaState = {
|
||||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
|
VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
|
||||||
@ -195,8 +187,8 @@ namespace dxvk::hud {
|
|||||||
{ 0, VK_VERTEX_INPUT_RATE_VERTEX },
|
{ 0, VK_VERTEX_INPUT_RATE_VERTEX },
|
||||||
}};
|
}};
|
||||||
|
|
||||||
context->setInputAssemblyState(iaState);
|
m_context->setInputAssemblyState(iaState);
|
||||||
context->setInputLayout(
|
m_context->setInputLayout(
|
||||||
ilAttributes.size(),
|
ilAttributes.size(),
|
||||||
ilAttributes.data(),
|
ilAttributes.data(),
|
||||||
ilBindings.size(),
|
ilBindings.size(),
|
||||||
|
@ -88,14 +88,12 @@ namespace dxvk::hud {
|
|||||||
VkExtent2D surfaceSize);
|
VkExtent2D surfaceSize);
|
||||||
|
|
||||||
void drawText(
|
void drawText(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
float size,
|
float size,
|
||||||
HudPos pos,
|
HudPos pos,
|
||||||
HudColor color,
|
HudColor color,
|
||||||
const std::string& text);
|
const std::string& text);
|
||||||
|
|
||||||
void drawLines(
|
void drawLines(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
size_t vertexCount,
|
size_t vertexCount,
|
||||||
const HudLineVertex* vertexData);
|
const HudLineVertex* vertexData);
|
||||||
|
|
||||||
@ -120,6 +118,7 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
Mode m_mode;
|
Mode m_mode;
|
||||||
VkExtent2D m_surfaceSize;
|
VkExtent2D m_surfaceSize;
|
||||||
|
Rc<DxvkContext> m_context;
|
||||||
|
|
||||||
ShaderPair m_textShaders;
|
ShaderPair m_textShaders;
|
||||||
ShaderPair m_lineShaders;
|
ShaderPair m_lineShaders;
|
||||||
@ -132,14 +131,11 @@ namespace dxvk::hud {
|
|||||||
VkDeviceSize m_vertexOffset = 0;
|
VkDeviceSize m_vertexOffset = 0;
|
||||||
|
|
||||||
DxvkBufferSlice allocVertexBuffer(
|
DxvkBufferSlice allocVertexBuffer(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
VkDeviceSize dataSize);
|
VkDeviceSize dataSize);
|
||||||
|
|
||||||
void beginTextRendering(
|
void beginTextRendering();
|
||||||
const Rc<DxvkContext>& context);
|
|
||||||
|
|
||||||
void beginLineRendering(
|
void beginLineRendering();
|
||||||
const Rc<DxvkContext>& context);
|
|
||||||
|
|
||||||
ShaderPair createTextShaders(
|
ShaderPair createTextShaders(
|
||||||
const Rc<DxvkDevice>& device);
|
const Rc<DxvkDevice>& device);
|
||||||
|
@ -30,26 +30,25 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::render(
|
HudPos HudStats::render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
if (m_elements.test(HudElement::StatSubmissions))
|
if (m_elements.test(HudElement::StatSubmissions))
|
||||||
position = this->printSubmissionStats(context, renderer, position);
|
position = this->printSubmissionStats(renderer, position);
|
||||||
|
|
||||||
if (m_elements.test(HudElement::StatDrawCalls))
|
if (m_elements.test(HudElement::StatDrawCalls))
|
||||||
position = this->printDrawCallStats(context, renderer, position);
|
position = this->printDrawCallStats(renderer, position);
|
||||||
|
|
||||||
if (m_elements.test(HudElement::StatPipelines))
|
if (m_elements.test(HudElement::StatPipelines))
|
||||||
position = this->printPipelineStats(context, renderer, position);
|
position = this->printPipelineStats(renderer, position);
|
||||||
|
|
||||||
if (m_elements.test(HudElement::StatMemory))
|
if (m_elements.test(HudElement::StatMemory))
|
||||||
position = this->printMemoryStats(context, renderer, position);
|
position = this->printMemoryStats(renderer, position);
|
||||||
|
|
||||||
if (m_elements.test(HudElement::StatGpuLoad))
|
if (m_elements.test(HudElement::StatGpuLoad))
|
||||||
position = this->printGpuLoad(context, renderer, position);
|
position = this->printGpuLoad(renderer, position);
|
||||||
|
|
||||||
if (m_elements.test(HudElement::CompilerActivity)) {
|
if (m_elements.test(HudElement::CompilerActivity)) {
|
||||||
this->printCompilerActivity(context, renderer,
|
this->printCompilerActivity(renderer,
|
||||||
{ position.x, float(renderer.surfaceSize().height) - 20.0f });
|
{ position.x, float(renderer.surfaceSize().height) - 20.0f });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +76,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printDrawCallStats(
|
HudPos HudStats::printDrawCallStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
const uint64_t frameCount = std::max<uint64_t>(m_diffCounters.getCtr(DxvkStatCounter::QueuePresentCount), 1);
|
const uint64_t frameCount = std::max<uint64_t>(m_diffCounters.getCtr(DxvkStatCounter::QueuePresentCount), 1);
|
||||||
@ -90,17 +88,17 @@ namespace dxvk::hud {
|
|||||||
const std::string strDispatchCalls = str::format("Dispatch calls: ", cpCalls);
|
const std::string strDispatchCalls = str::format("Dispatch calls: ", cpCalls);
|
||||||
const std::string strRenderPasses = str::format("Render passes: ", rpCalls);
|
const std::string strRenderPasses = str::format("Render passes: ", rpCalls);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strDrawCalls);
|
strDrawCalls);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 20.0f },
|
{ position.x, position.y + 20.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strDispatchCalls);
|
strDispatchCalls);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 40.0f },
|
{ position.x, position.y + 40.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strRenderPasses);
|
strRenderPasses);
|
||||||
@ -110,7 +108,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printSubmissionStats(
|
HudPos HudStats::printSubmissionStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
const uint64_t frameCount = std::max<uint64_t>(m_diffCounters.getCtr(DxvkStatCounter::QueuePresentCount), 1);
|
const uint64_t frameCount = std::max<uint64_t>(m_diffCounters.getCtr(DxvkStatCounter::QueuePresentCount), 1);
|
||||||
@ -118,7 +115,7 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
const std::string strSubmissions = str::format("Queue submissions: ", numSubmits);
|
const std::string strSubmissions = str::format("Queue submissions: ", numSubmits);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strSubmissions);
|
strSubmissions);
|
||||||
@ -128,7 +125,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printPipelineStats(
|
HudPos HudStats::printPipelineStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
const uint64_t gpCount = m_prevCounters.getCtr(DxvkStatCounter::PipeCountGraphics);
|
const uint64_t gpCount = m_prevCounters.getCtr(DxvkStatCounter::PipeCountGraphics);
|
||||||
@ -137,12 +133,12 @@ namespace dxvk::hud {
|
|||||||
const std::string strGpCount = str::format("Graphics pipelines: ", gpCount);
|
const std::string strGpCount = str::format("Graphics pipelines: ", gpCount);
|
||||||
const std::string strCpCount = str::format("Compute pipelines: ", cpCount);
|
const std::string strCpCount = str::format("Compute pipelines: ", cpCount);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strGpCount);
|
strGpCount);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 20.0f },
|
{ position.x, position.y + 20.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strCpCount);
|
strCpCount);
|
||||||
@ -152,7 +148,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printMemoryStats(
|
HudPos HudStats::printMemoryStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
constexpr uint64_t mib = 1024 * 1024;
|
constexpr uint64_t mib = 1024 * 1024;
|
||||||
@ -163,12 +158,12 @@ namespace dxvk::hud {
|
|||||||
const std::string strMemAllocated = str::format("Memory allocated: ", memAllocated / mib, " MB");
|
const std::string strMemAllocated = str::format("Memory allocated: ", memAllocated / mib, " MB");
|
||||||
const std::string strMemUsed = str::format("Memory used: ", memUsed / mib, " MB");
|
const std::string strMemUsed = str::format("Memory used: ", memUsed / mib, " MB");
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strMemAllocated);
|
strMemAllocated);
|
||||||
|
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y + 20.0f },
|
{ position.x, position.y + 20.0f },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
strMemUsed);
|
strMemUsed);
|
||||||
@ -178,10 +173,9 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printGpuLoad(
|
HudPos HudStats::printGpuLoad(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_gpuLoadString);
|
m_gpuLoadString);
|
||||||
@ -191,7 +185,6 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
|
|
||||||
HudPos HudStats::printCompilerActivity(
|
HudPos HudStats::printCompilerActivity(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
auto now = dxvk::high_resolution_clock::now();
|
auto now = dxvk::high_resolution_clock::now();
|
||||||
@ -207,7 +200,7 @@ namespace dxvk::hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (doShow) {
|
if (doShow) {
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
"Compiling shaders...");
|
"Compiling shaders...");
|
||||||
|
@ -27,7 +27,6 @@ namespace dxvk::hud {
|
|||||||
const Rc<DxvkDevice>& device);
|
const Rc<DxvkDevice>& device);
|
||||||
|
|
||||||
HudPos render(
|
HudPos render(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
@ -49,32 +48,26 @@ namespace dxvk::hud {
|
|||||||
void updateGpuLoad();
|
void updateGpuLoad();
|
||||||
|
|
||||||
HudPos printDrawCallStats(
|
HudPos printDrawCallStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos printSubmissionStats(
|
HudPos printSubmissionStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos printPipelineStats(
|
HudPos printPipelineStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos printMemoryStats(
|
HudPos printMemoryStats(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos printGpuLoad(
|
HudPos printGpuLoad(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
HudPos printCompilerActivity(
|
HudPos printCompilerActivity(
|
||||||
const Rc<DxvkContext>& context,
|
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position);
|
HudPos position);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user