mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix error on older GPUs
This commit is contained in:
parent
b9deaf2eae
commit
993b3f63c3
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using DirectXTexNet;
|
||||
using Silk.NET.Core.Native;
|
||||
using Silk.NET.Direct3D11;
|
||||
@ -7,7 +8,7 @@ namespace Wabbajack.ImageHashing
|
||||
{
|
||||
public unsafe class DX11Device
|
||||
{
|
||||
private readonly ID3D11Device* _device;
|
||||
private ID3D11Device* _device;
|
||||
|
||||
public DX11Device()
|
||||
{
|
||||
@ -52,12 +53,17 @@ namespace Wabbajack.ImageHashing
|
||||
{
|
||||
if (_device != null)
|
||||
{
|
||||
return input.Compress((IntPtr)_device, format, compress, threshold);
|
||||
}
|
||||
else
|
||||
{
|
||||
return input.Compress(format, compress, threshold);
|
||||
try
|
||||
{
|
||||
return input.Compress((IntPtr)_device, format, compress, threshold);
|
||||
}
|
||||
catch (COMException _)
|
||||
{
|
||||
_device->Release();
|
||||
_device = null;
|
||||
}
|
||||
}
|
||||
return input.Compress(format, compress, threshold);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user