mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
nvidia/cuda/context: Don't try to destroy device contexts
This commit is contained in:
parent
6ba51efceb
commit
0f56f822c3
1 changed files with 4 additions and 1 deletions
|
@ -55,8 +55,9 @@ streamfx::nvidia::cuda::context::~context()
|
|||
|
||||
if (_has_device) {
|
||||
_cuda->cuDevicePrimaryCtxRelease(_device);
|
||||
} else {
|
||||
_cuda->cuCtxDestroy(_ctx);
|
||||
}
|
||||
_cuda->cuCtxDestroy(_ctx);
|
||||
}
|
||||
|
||||
streamfx::nvidia::cuda::context::context()
|
||||
|
@ -85,6 +86,8 @@ streamfx::nvidia::cuda::context::context(ID3D11Device* device) : context()
|
|||
throw std::runtime_error("Failed to get device index for device.");
|
||||
}
|
||||
|
||||
_cuda->cuDevicePrimaryCtxSetFlags(_device, context_flags::SCHEDULER_BLOCKING_SYNC);
|
||||
|
||||
// Acquire Context
|
||||
if (result res = _cuda->cuDevicePrimaryCtxRetain(&_ctx, _device); res != result::SUCCESS) {
|
||||
throw std::runtime_error("Failed to acquire primary device context.");
|
||||
|
|
Loading…
Reference in a new issue