[dxvk] Store DXVK device inside DxvkCsThread object

This commit is contained in:
Philip Rebohle 2022-02-12 19:53:11 +01:00
parent 52666a33c6
commit d96c5a1076
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 14 additions and 6 deletions

View File

@ -15,7 +15,7 @@ namespace dxvk {
D3D11Device* pParent,
const Rc<DxvkDevice>& Device)
: D3D11DeviceContext(pParent, Device, DxvkCsChunkFlag::SingleUse),
m_csThread(Device->createContext()),
m_csThread(Device, Device->createContext()),
m_videoContext(this, Device) {
EmitCs([
cDevice = m_device,

View File

@ -48,7 +48,7 @@ namespace dxvk {
, m_d3d9Options ( dxvkDevice, pParent->GetInstance()->config() )
, m_multithread ( BehaviorFlags & D3DCREATE_MULTITHREADED )
, m_isSWVP ( (BehaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING) ? true : false )
, m_csThread ( dxvkDevice->createContext() )
, m_csThread ( dxvkDevice, dxvkDevice->createContext() )
, m_csChunk ( AllocCsChunk() ) {
// If we can SWVP, then we use an extended constant set
// as SWVP has many more slots available than HWVP.

View File

@ -95,8 +95,11 @@ namespace dxvk {
}
DxvkCsThread::DxvkCsThread(const Rc<DxvkContext>& context)
: m_context(context), m_thread([this] { threadFunc(); }) {
DxvkCsThread::DxvkCsThread(
const Rc<DxvkDevice>& device,
const Rc<DxvkContext>& context)
: m_device(device), m_context(context),
m_thread([this] { threadFunc(); }) {
}

View File

@ -6,6 +6,8 @@
#include <queue>
#include "../util/thread.h"
#include "dxvk_device.h"
#include "dxvk_context.h"
namespace dxvk {
@ -382,7 +384,9 @@ namespace dxvk {
constexpr static uint64_t SynchronizeAll = ~0ull;
DxvkCsThread(const Rc<DxvkContext>& context);
DxvkCsThread(
const Rc<DxvkDevice>& device,
const Rc<DxvkContext>& context);
~DxvkCsThread();
/**
@ -418,7 +422,8 @@ namespace dxvk {
private:
const Rc<DxvkContext> m_context;
Rc<DxvkDevice> m_device;
Rc<DxvkContext> m_context;
std::atomic<uint64_t> m_chunksDispatched = { 0ull };
std::atomic<uint64_t> m_chunksExecuted = { 0ull };