mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-28 11:29:18 +01:00
fixes
This commit is contained in:
parent
1ae11440aa
commit
54ebe8c02a
2 changed files with 20 additions and 4 deletions
|
|
@ -35,10 +35,24 @@ internal sealed partial class TextureManager
|
|||
scene = this.interfaceManager.Scene ?? throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
switch (dxgiFormat)
|
||||
{
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format
|
||||
// Video formats requiring use of another DXGI_FORMAT when using with CreateRenderTarget
|
||||
case DXGI_FORMAT.DXGI_FORMAT_AYUV:
|
||||
case DXGI_FORMAT.DXGI_FORMAT_NV12:
|
||||
case DXGI_FORMAT.DXGI_FORMAT_P010:
|
||||
case DXGI_FORMAT.DXGI_FORMAT_P016:
|
||||
case DXGI_FORMAT.DXGI_FORMAT_NV11:
|
||||
return false;
|
||||
}
|
||||
|
||||
var format = (Format)dxgiFormat;
|
||||
var support = scene.Device.CheckFormatSupport(format);
|
||||
return (support & FormatSupport.RenderTarget) != 0
|
||||
&& (support & FormatSupport.Texture2D) != 0;
|
||||
const FormatSupport required =
|
||||
FormatSupport.RenderTarget |
|
||||
FormatSupport.Texture2D;
|
||||
return (support & required) == required;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -72,7 +86,8 @@ internal sealed partial class TextureManager
|
|||
ct.ThrowIfCancellationRequested();
|
||||
unsafe
|
||||
{
|
||||
using var tex = new ComPtr<ID3D11Texture2D>(
|
||||
using var tex = default(ComPtr<ID3D11Texture2D>);
|
||||
tex.Attach(
|
||||
this.NoThrottleCreateFromExistingTextureCore(
|
||||
wrapCopy,
|
||||
uv0,
|
||||
|
|
|
|||
|
|
@ -321,7 +321,8 @@ internal sealed partial class TextureManager : IServiceType, IDisposable, ITextu
|
|||
|
||||
var format = (Format)dxgiFormat;
|
||||
var support = scene.Device.CheckFormatSupport(format);
|
||||
return (support & FormatSupport.Texture2D) != 0;
|
||||
const FormatSupport required = FormatSupport.Texture2D;
|
||||
return (support & required) == required;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue