...
 
Commits (2)
......@@ -5147,15 +5147,13 @@ namespace dxvk {
samplerInfo.first, DxsoBindingType::DepthImage,
samplerInfo.second);
EmitCs([
&cDevice = m_dxvkDevice,
&cSamplers = m_samplers,
EmitCs([this,
cColorSlot = colorSlot,
cDepthSlot = depthSlot,
cKey = key
] (DxvkContext* ctx) {
auto pair = cSamplers.find(cKey);
if (pair != cSamplers.end()) {
auto pair = m_samplers.find(cKey);
if (pair != m_samplers.end()) {
ctx->bindResourceSampler(cColorSlot, pair->second.color);
ctx->bindResourceSampler(cDepthSlot, pair->second.depth);
return;
......@@ -5200,10 +5198,12 @@ namespace dxvk {
try {
D3D9SamplerPair pair;
pair.color = cDevice->createSampler(colorInfo);
pair.depth = cDevice->createSampler(depthInfo);
pair.color = m_dxvkDevice->createSampler(colorInfo);
pair.depth = m_dxvkDevice->createSampler(depthInfo);
m_samplerCount++;
cSamplers.insert(std::make_pair(cKey, pair));
m_samplers.insert(std::make_pair(cKey, pair));
ctx->bindResourceSampler(cColorSlot, pair.color);
ctx->bindResourceSampler(cDepthSlot, pair.depth);
}
......
......@@ -867,6 +867,10 @@ namespace dxvk {
HRESULT InitialReset(D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode);
UINT GetSamplerCount() const {
return m_samplerCount.load();
}
private:
D3D9DeviceFlags m_flags;
......@@ -995,6 +999,7 @@ namespace dxvk {
D3D9ViewportInfo m_viewportInfo;
std::atomic<int64_t> m_availableMemory = 0;
std::atomic<int32_t> m_samplerCount = 0;
bool m_amdATOC = false;
bool m_nvATOC = false;
......
#include "d3d9_hud.h"
namespace dxvk::hud {
HudSamplerCount::HudSamplerCount(D3D9DeviceEx* device)
: m_device (device)
, m_samplerCount ("0"){
}
void HudSamplerCount::update(dxvk::high_resolution_clock::time_point time) {
m_samplerCount = str::format(m_device->GetSamplerCount());
}
HudPos HudSamplerCount::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 },
"Samplers:");
renderer.drawText(16.0f,
{ position.x + 120.0f, position.y },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_samplerCount);
position.y += 8.0f;
return position;
}
}
\ No newline at end of file
#pragma once
#include "d3d9_device.h"
#include "../dxvk/hud/dxvk_hud_item.h"
namespace dxvk::hud {
/**
* \brief HUD item to display DXVK version
*/
class HudSamplerCount : public HudItem {
public:
HudSamplerCount(D3D9DeviceEx* device);
void update(dxvk::high_resolution_clock::time_point time);
HudPos render(
HudRenderer& renderer,
HudPos position);
private:
D3D9DeviceEx* m_device;
std::string m_samplerCount;
};
}
\ No newline at end of file
......@@ -2,6 +2,8 @@
#include "d3d9_surface.h"
#include "d3d9_monitor.h"
#include "d3d9_hud.h"
#include <d3d9_presenter_frag.h>
#include <d3d9_presenter_vert.h>
......@@ -846,6 +848,9 @@ namespace dxvk {
void D3D9SwapChainEx::CreateHud() {
m_hud = hud::Hud::createHud(m_device);
if (m_hud != nullptr)
m_hud->addItem<hud::HudSamplerCount>("samplers", m_parent);
}
......
......@@ -33,7 +33,8 @@ d3d9_src = [
'd3d9_fixed_function.cpp',
'd3d9_names.cpp',
'd3d9_swvp_emu.cpp',
'd3d9_format_helpers.cpp'
'd3d9_format_helpers.cpp',
'd3d9_hud.cpp'
]
d3d9_dll = shared_library('d3d9'+dll_ext, d3d9_src, glsl_generator.process(d3d9_shaders), d3d9_res,
......