mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 13:54:18 +01:00
[d3d9] Add HUD item for FF shaders
This commit is contained in:
parent
89e190b771
commit
010738c107
@ -1022,6 +1022,18 @@ namespace dxvk {
|
|||||||
return m_behaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
return m_behaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT GetFixedFunctionVSCount() const {
|
||||||
|
return m_ffModules.GetVSCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT GetFixedFunctionFSCount() const {
|
||||||
|
return m_ffModules.GetFSCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT GetSWVPShaderCount() const {
|
||||||
|
return m_swvpEmulator.GetShaderCount();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DxvkCsChunkRef AllocCsChunk() {
|
DxvkCsChunkRef AllocCsChunk() {
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "../dxso/dxso_isgn.h"
|
#include "../dxso/dxso_isgn.h"
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <bitset>
|
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
@ -253,6 +252,14 @@ namespace dxvk {
|
|||||||
D3D9DeviceEx* pDevice,
|
D3D9DeviceEx* pDevice,
|
||||||
const D3D9FFShaderKeyFS& ShaderKey);
|
const D3D9FFShaderKeyFS& ShaderKey);
|
||||||
|
|
||||||
|
UINT GetVSCount() const {
|
||||||
|
return m_vsModules.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT GetFSCount() const {
|
||||||
|
return m_fsModules.size();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::unordered_map<
|
std::unordered_map<
|
||||||
|
@ -92,4 +92,37 @@ namespace dxvk::hud {
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
HudFixedFunctionShaders::HudFixedFunctionShaders(D3D9DeviceEx* device)
|
||||||
|
: m_device (device)
|
||||||
|
, m_ffShaderCount ("") {}
|
||||||
|
|
||||||
|
|
||||||
|
void HudFixedFunctionShaders::update(dxvk::high_resolution_clock::time_point time) {
|
||||||
|
m_ffShaderCount = str::format(
|
||||||
|
"VS: ", m_device->GetFixedFunctionVSCount(),
|
||||||
|
" FS: ", m_device->GetFixedFunctionFSCount(),
|
||||||
|
" SWVP: ", m_device->GetSWVPShaderCount()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HudPos HudFixedFunctionShaders::render(
|
||||||
|
HudRenderer& renderer,
|
||||||
|
HudPos position) {
|
||||||
|
position.y += 16.0f;
|
||||||
|
|
||||||
|
renderer.drawText(16.0f,
|
||||||
|
{ position.x, position.y },
|
||||||
|
{ 0.0f, 1.0f, 0.75f, 1.0f },
|
||||||
|
"FF Shaders:");
|
||||||
|
|
||||||
|
renderer.drawText(16.0f,
|
||||||
|
{ position.x + 155.0f, position.y },
|
||||||
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
|
m_ffShaderCount);
|
||||||
|
|
||||||
|
position.y += 8.0f;
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -60,4 +60,29 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief HUD item to display amount of generated fixed function shaders
|
||||||
|
*/
|
||||||
|
class HudFixedFunctionShaders : public HudItem {
|
||||||
|
public:
|
||||||
|
|
||||||
|
HudFixedFunctionShaders(D3D9DeviceEx* device);
|
||||||
|
|
||||||
|
void update(dxvk::high_resolution_clock::time_point time);
|
||||||
|
|
||||||
|
HudPos render(
|
||||||
|
HudRenderer& renderer,
|
||||||
|
HudPos position);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
D3D9DeviceEx* m_device;
|
||||||
|
|
||||||
|
dxvk::high_resolution_clock::time_point m_lastUpdate
|
||||||
|
= dxvk::high_resolution_clock::now();
|
||||||
|
|
||||||
|
std::string m_ffShaderCount;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -1098,6 +1098,7 @@ namespace dxvk {
|
|||||||
if (m_hud != nullptr) {
|
if (m_hud != nullptr) {
|
||||||
m_hud->addItem<hud::HudClientApiItem>("api", 1, GetApiName());
|
m_hud->addItem<hud::HudClientApiItem>("api", 1, GetApiName());
|
||||||
m_hud->addItem<hud::HudSamplerCount>("samplers", -1, m_parent);
|
m_hud->addItem<hud::HudSamplerCount>("samplers", -1, m_parent);
|
||||||
|
m_hud->addItem<hud::HudFixedFunctionShaders>("ffshaders", -1, m_parent);
|
||||||
|
|
||||||
#ifdef D3D9_ALLOW_UNMAPPING
|
#ifdef D3D9_ALLOW_UNMAPPING
|
||||||
m_hud->addItem<hud::HudTextureMemory>("memory", -1, m_parent);
|
m_hud->addItem<hud::HudTextureMemory>("memory", -1, m_parent);
|
||||||
|
@ -40,6 +40,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
Rc<DxvkShader> GetShaderModule(D3D9DeviceEx* pDevice, D3D9CompactVertexElements&& elements);
|
Rc<DxvkShader> GetShaderModule(D3D9DeviceEx* pDevice, D3D9CompactVertexElements&& elements);
|
||||||
|
|
||||||
|
UINT GetShaderCount() const {
|
||||||
|
return m_modules.size();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
dxvk::mutex m_mutex;
|
dxvk::mutex m_mutex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user