[vlc-commits] d3d11_fmt: rename DeviceSupportsFormat to D3D11_DeviceSupportsFormat
Steve Lhomme
git at videolan.org
Wed Feb 10 11:06:59 UTC 2021
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 25 09:16:56 2021 +0100| [f85a14ce9af1d7ee441053c1e91b8f9ef621d5ee] | committer: Steve Lhomme
d3d11_fmt: rename DeviceSupportsFormat to D3D11_DeviceSupportsFormat
And pass a d3d11_device_t, no need for the caller to know the actual
ID3D11Device in use.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f85a14ce9af1d7ee441053c1e91b8f9ef621d5ee
---
modules/codec/avcodec/d3d11va.c | 6 +++---
modules/video_chroma/d3d11_fmt.c | 6 +++---
modules/video_chroma/d3d11_fmt.h | 2 +-
modules/video_output/win32/direct3d11.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index aca1443984..87c80ed1e2 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -441,14 +441,14 @@ static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const vide
// check if we can create render texture of that format
// check the decoder can output to that format
- if ( !DeviceSupportsFormat(sys->d3d_dev->d3ddevice, processorInput[idx]->formatTexture,
+ if ( !D3D11_DeviceSupportsFormat(sys->d3d_dev, processorInput[idx]->formatTexture,
D3D11_FORMAT_SUPPORT_SHADER_LOAD) )
{
#ifndef ID3D11VideoContext_VideoProcessorBlt
msg_Dbg(va, "Format %s needs a processor but is not supported",
DxgiFormatToStr(processorInput[idx]->formatTexture));
#else
- if ( !DeviceSupportsFormat(sys->d3d_dev->d3ddevice, processorInput[idx]->formatTexture,
+ if ( !D3D11_DeviceSupportsFormat(sys->d3d_dev, processorInput[idx]->formatTexture,
D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT) )
{
msg_Dbg(va, "Format %s needs a processor but is not available",
@@ -541,7 +541,7 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id,
texDesc.BindFlags = D3D11_BIND_DECODER;
texDesc.CPUAccessFlags = 0;
- if (DeviceSupportsFormat(sys->d3d_dev->d3ddevice, texDesc.Format, D3D11_FORMAT_SUPPORT_SHADER_LOAD))
+ if (D3D11_DeviceSupportsFormat(sys->d3d_dev, texDesc.Format, D3D11_FORMAT_SUPPORT_SHADER_LOAD))
texDesc.BindFlags |= D3D11_BIND_SHADER_RESOURCE;
ID3D11Texture2D *p_texture;
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index f8a04a4a89..7a3efaa567 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -683,10 +683,10 @@ done:
return result;
}
-bool DeviceSupportsFormat(ID3D11Device *d3ddevice, DXGI_FORMAT format, UINT supportFlags)
+bool D3D11_DeviceSupportsFormat(d3d11_device_t *d3d_dev, DXGI_FORMAT format, UINT supportFlags)
{
UINT i_formatSupport;
- return SUCCEEDED( ID3D11Device_CheckFormatSupport(d3ddevice, format,
+ return SUCCEEDED( ID3D11Device_CheckFormatSupport(d3d_dev->d3ddevice, format,
&i_formatSupport) )
&& ( i_formatSupport & supportFlags ) == supportFlags;
}
@@ -727,7 +727,7 @@ const d3d_format_t *(FindD3D11Format)(vlc_object_t *o,
else
textureFormat = output_format->formatTexture;
- if( DeviceSupportsFormat( d3d_dev->d3ddevice, textureFormat, supportFlags ) &&
+ if( D3D11_DeviceSupportsFormat( d3d_dev, textureFormat, supportFlags ) &&
CanReallyUseFormat(o, d3d_dev, output_format->fourcc, output_format->formatTexture) )
return output_format;
}
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 0e1ba14f92..71d94bd683 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -149,7 +149,7 @@ IDXGIAdapter *D3D11DeviceAdapter(ID3D11Device *d3ddev);
int D3D11CheckDriverVersion(const d3d11_device_t *, UINT vendorId,
const struct wddm_version *min_ver);
-bool DeviceSupportsFormat(ID3D11Device *d3ddevice, DXGI_FORMAT format, UINT supportFlags);
+bool D3D11_DeviceSupportsFormat(d3d11_device_t*, DXGI_FORMAT, UINT supportFlags);
const d3d_format_t *FindD3D11Format(vlc_object_t *,
d3d11_device_t*,
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 09ea0c860e..0418e49e62 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -837,7 +837,7 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt, vlc_video_
d3d11_video_context_t *vtcx_sys = GetD3D11ContextPrivate(vctx);
if (vtcx_sys != NULL &&
- DeviceSupportsFormat( vd->sys->d3d_dev->d3ddevice, vtcx_sys->format, D3D11_FORMAT_SUPPORT_SHADER_LOAD ))
+ D3D11_DeviceSupportsFormat( sys->d3d_dev, vtcx_sys->format, D3D11_FORMAT_SUPPORT_SHADER_LOAD ))
{
for (const d3d_format_t *output_format = DxgiGetRenderFormatList();
output_format->name != NULL; ++output_format)
More information about the vlc-commits
mailing list