mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[dxvk] Store DXVK device inside DxvkCsThread object
This commit is contained in:
parent
52666a33c6
commit
d96c5a1076
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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(); }) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -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 };
|
||||
|
Loading…
Reference in New Issue
Block a user