[vlc-commits] dxgi_fmt: rename D3D11_MAX_RENDER_TARGET to DXGI_MAX_RENDER_TARGET

Steve Lhomme git at videolan.org
Wed Feb 10 11:06:45 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Feb  9 15:39:10 2021 +0100| [84d1ab626d355087b1ebd7a87d91cc13a488efb5] | committer: Steve Lhomme

dxgi_fmt: rename D3D11_MAX_RENDER_TARGET to DXGI_MAX_RENDER_TARGET

It just depends on the DXGI_FORMAT being rendered.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=84d1ab626d355087b1ebd7a87d91cc13a488efb5
---

 modules/video_chroma/dxgi_fmt.h              | 3 ++-
 modules/video_output/win32/d3d11_shaders.c   | 6 +++---
 modules/video_output/win32/d3d11_shaders.h   | 6 ++----
 modules/video_output/win32/d3d11_swapchain.c | 2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/video_chroma/dxgi_fmt.h b/modules/video_chroma/dxgi_fmt.h
index 233eff5ffb..9cd0e9b3f4 100644
--- a/modules/video_chroma/dxgi_fmt.h
+++ b/modules/video_chroma/dxgi_fmt.h
@@ -36,7 +36,8 @@
 #define GPU_MANUFACTURER_S3            0x5333
 #define GPU_MANUFACTURER_QUALCOMM  0x4D4F4351
 
-#define DXGI_MAX_SHADER_VIEW  4
+#define DXGI_MAX_SHADER_VIEW     4
+#define DXGI_MAX_RENDER_TARGET   2 // for NV12/P010 we render Y and UV separately
 
 typedef struct
 {
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index bd052e39a8..9a05592394 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -713,7 +713,7 @@ float GetFormatLuminance(vlc_object_t *o, const video_format_t *fmt)
 }
 
 HRESULT D3D11_CreateRenderTargets( d3d11_device_t *d3d_dev, ID3D11Resource *texture,
-                                   const d3d_format_t *cfg, ID3D11RenderTargetView *output[D3D11_MAX_RENDER_TARGET] )
+                                   const d3d_format_t *cfg, ID3D11RenderTargetView *output[DXGI_MAX_RENDER_TARGET] )
 {
     D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc;
     renderTargetViewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
@@ -736,7 +736,7 @@ HRESULT D3D11_CreateRenderTargets( d3d11_device_t *d3d_dev, ID3D11Resource *text
 }
 
 void D3D11_ClearRenderTargets(d3d11_device_t *d3d_dev, const d3d_format_t *cfg,
-                              ID3D11RenderTargetView *targets[D3D11_MAX_RENDER_TARGET])
+                              ID3D11RenderTargetView *targets[DXGI_MAX_RENDER_TARGET])
 {
     static const FLOAT blackY[1] = {0.0f};
     static const FLOAT blackUV[2] = {0.5f, 0.5f};
@@ -745,7 +745,7 @@ void D3D11_ClearRenderTargets(d3d11_device_t *d3d_dev, const d3d_format_t *cfg,
     static const FLOAT blackVUYA[4] = {0.5f, 0.5f, 0.0f, 1.0f};
     static const FLOAT blackY210[4] = {0.0f, 0.5f, 0.5f, 0.0f};
 
-    static_assert(D3D11_MAX_RENDER_TARGET >= 2, "we need at least 2 RenderTargetView for NV12/P010");
+    static_assert(DXGI_MAX_RENDER_TARGET >= 2, "we need at least 2 RenderTargetView for NV12/P010");
 
     switch (cfg->formatTexture)
     {
diff --git a/modules/video_output/win32/d3d11_shaders.h b/modules/video_output/win32/d3d11_shaders.h
index b509e972c1..14e8407eb2 100644
--- a/modules/video_output/win32/d3d11_shaders.h
+++ b/modules/video_output/win32/d3d11_shaders.h
@@ -102,8 +102,6 @@ typedef struct
     VS_PROJECTION_CONST       vertexConstants;
 } d3d11_quad_t;
 
-#define D3D11_MAX_RENDER_TARGET    2
-
 int D3D11_InitShaders(vlc_object_t *, d3d11_shader_compiler_t *);
 void D3D11_ReleaseShaders(d3d11_shader_compiler_t *);
 
@@ -127,10 +125,10 @@ float GetFormatLuminance(vlc_object_t *, const video_format_t *);
 #define GetFormatLuminance(a,b)  GetFormatLuminance(VLC_OBJECT(a),b)
 
 HRESULT D3D11_CreateRenderTargets(d3d11_device_t *, ID3D11Resource *, const d3d_format_t *,
-                                  ID3D11RenderTargetView *output[D3D11_MAX_RENDER_TARGET]);
+                                  ID3D11RenderTargetView *output[DXGI_MAX_RENDER_TARGET]);
 
 void D3D11_ClearRenderTargets(d3d11_device_t *, const d3d_format_t *,
-                              ID3D11RenderTargetView *targets[D3D11_MAX_RENDER_TARGET]);
+                              ID3D11RenderTargetView *targets[DXGI_MAX_RENDER_TARGET]);
 
 void D3D11_ReleaseVertexShader(d3d11_vertex_shader_t *);
 
diff --git a/modules/video_output/win32/d3d11_swapchain.c b/modules/video_output/win32/d3d11_swapchain.c
index d891636504..21e042b254 100644
--- a/modules/video_output/win32/d3d11_swapchain.c
+++ b/modules/video_output/win32/d3d11_swapchain.c
@@ -59,7 +59,7 @@ struct d3d11_local_swapchain
     vlc_object_t           *obj;
     d3d11_device_t         *d3d_dev;
 
-    ID3D11RenderTargetView *swapchainTargetView[D3D11_MAX_RENDER_TARGET];
+    ID3D11RenderTargetView *swapchainTargetView[DXGI_MAX_RENDER_TARGET];
 };
 
 DEFINE_GUID(GUID_SWAPCHAIN_WIDTH,  0xf1b59347, 0x1643, 0x411a, 0xad, 0x6b, 0xc7, 0x80, 0x17, 0x7a, 0x06, 0xb6);



More information about the vlc-commits mailing list