[vlc-commits] vout:d3d11: rename d3d_quad_t to d3d11_quad_t

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 22 11:38:09 2021 +0100| [37142b620aee14efbe7c909039d1b9abcb559da7] | committer: Steve Lhomme

vout:d3d11: rename d3d_quad_t to d3d11_quad_t

It contains d3d11 specific parts.

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

 modules/video_output/win32/d3d11_quad.c    | 28 ++++++++++++++--------------
 modules/video_output/win32/d3d11_quad.h    | 18 +++++++++---------
 modules/video_output/win32/d3d11_shaders.c |  4 ++--
 modules/video_output/win32/d3d11_shaders.h |  6 +++---
 modules/video_output/win32/direct3d11.c    | 22 +++++++++++-----------
 5 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index 90b8736b01..58db842095 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -42,7 +42,7 @@
 #define nbLatBands SPHERE_SLICES
 #define nbLonBands SPHERE_SLICES
 
-void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d_quad_t *quad, d3d_vertex_shader_t *vsshader,
+void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d11_quad_t *quad, d3d_vertex_shader_t *vsshader,
                       ID3D11ShaderResourceView *resourceView[DXGI_MAX_SHADER_VIEW],
                       d3d11_select_plane_t selectPlane, void *selectOpaque)
 {
@@ -90,7 +90,7 @@ void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d_quad_t *quad, d3d_vertex_shad
     }
 }
 
-static bool AllocQuadVertices(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, video_projection_mode_t projection)
+static bool AllocQuadVertices(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad, video_projection_mode_t projection)
 {
     HRESULT hr;
 
@@ -157,7 +157,7 @@ fail:
     return false;
 }
 
-void D3D11_ReleaseQuad(d3d_quad_t *quad)
+void D3D11_ReleaseQuad(d3d11_quad_t *quad)
 {
     if (quad->pPixelShaderConstants[PS_CONST_LUMI_BOUNDS])
     {
@@ -267,7 +267,7 @@ static void orientationVertexOrder(video_orientation_t orientation, int vertex_o
 }
 
 static void SetupQuadFlat(d3d_vertex_t *dst_data, const RECT *output,
-                          const d3d_quad_t *quad,
+                          const d3d11_quad_t *quad,
                           WORD *triangle_pos, video_orientation_t orientation)
 {
     unsigned int src_width = quad->i_width;
@@ -411,7 +411,7 @@ static void SetupQuadFlat(d3d_vertex_t *dst_data, const RECT *output,
 }
 
 static void SetupQuadSphere(d3d_vertex_t *dst_data, const RECT *output,
-                            const d3d_quad_t *quad, WORD *triangle_pos)
+                            const d3d11_quad_t *quad, WORD *triangle_pos)
 {
     const float scaleX = (float)(RECTWidth(*output))  / quad->i_width;
     const float scaleY = (float)(RECTHeight(*output)) / quad->i_height;
@@ -461,7 +461,7 @@ static void SetupQuadSphere(d3d_vertex_t *dst_data, const RECT *output,
 
 
 static void SetupQuadCube(d3d_vertex_t *dst_data, const RECT *output,
-                          const d3d_quad_t *quad, WORD *triangle_pos)
+                          const d3d11_quad_t *quad, WORD *triangle_pos)
 {
 #define CUBEFACE(swap, value) \
     swap(value, -1.f,  1.f), \
@@ -550,7 +550,7 @@ static void SetupQuadCube(d3d_vertex_t *dst_data, const RECT *output,
 }
 
 #undef D3D11_UpdateQuadPosition
-bool D3D11_UpdateQuadPosition( vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad,
+bool D3D11_UpdateQuadPosition( vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad,
                                 const RECT *output, video_orientation_t orientation )
 {
     bool result = true;
@@ -599,7 +599,7 @@ bool D3D11_UpdateQuadPosition( vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_qua
     return result;
 }
 
-static bool ShaderUpdateConstants(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, int type, void *new_buf)
+static bool ShaderUpdateConstants(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad, int type, void *new_buf)
 {
     ID3D11Resource *res;
     switch (type)
@@ -640,7 +640,7 @@ static bool ShaderUpdateConstants(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_
 }
 
 #undef D3D11_UpdateQuadOpacity
-void D3D11_UpdateQuadOpacity(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, float opacity)
+void D3D11_UpdateQuadOpacity(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad, float opacity)
 {
     if (quad->shaderConstants.Opacity == opacity)
         return;
@@ -652,7 +652,7 @@ void D3D11_UpdateQuadOpacity(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_
 }
 
 #undef D3D11_UpdateQuadLuminanceScale
-void D3D11_UpdateQuadLuminanceScale(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, float luminanceScale)
+void D3D11_UpdateQuadLuminanceScale(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad, float luminanceScale)
 {
     if (quad->shaderConstants.LuminanceScale == luminanceScale)
         return;
@@ -725,7 +725,7 @@ static float UpdateZ(float f_fovx, float f_fovy)
     return f_z;
 }
 
-void (D3D11_UpdateViewpoint)(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad,
+void (D3D11_UpdateViewpoint)(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d11_quad_t *quad,
                              const vlc_viewpoint_t *viewpoint, float f_sar)
 {
     if (!quad->viewpointShaderConstant)
@@ -749,7 +749,7 @@ void (D3D11_UpdateViewpoint)(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_
 
 #undef D3D11_AllocateQuad
 int D3D11_AllocateQuad(vlc_object_t *o, d3d11_device_t *d3d_dev,
-                       video_projection_mode_t projection, d3d_quad_t *quad)
+                       video_projection_mode_t projection, d3d11_quad_t *quad)
 {
     HRESULT hr;
     static_assert((sizeof(PS_CONSTANT_BUFFER)%16)==0,"Constant buffers require 16-byte alignment");
@@ -1001,7 +1001,7 @@ static void GetPrimariesTransform(FLOAT Primaries[4*4], video_color_primaries_t
 }
 
 #undef D3D11_SetupQuad
-int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format_t *fmt, d3d_quad_t *quad,
+int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format_t *fmt, d3d11_quad_t *quad,
                     const display_info_t *displayFormat)
 {
     const bool RGB_src_shader = DxgiIsRGBFormat(quad->textureFormat);
@@ -1154,7 +1154,7 @@ int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format
     return VLC_SUCCESS;
 }
 
-void D3D11_UpdateViewport(d3d_quad_t *quad, const RECT *rect, const d3d_format_t *display)
+void D3D11_UpdateViewport(d3d11_quad_t *quad, const RECT *rect, const d3d_format_t *display)
 {
     LONG srcAreaWidth, srcAreaHeight;
 
diff --git a/modules/video_output/win32/d3d11_quad.h b/modules/video_output/win32/d3d11_quad.h
index 83d6101634..67c52abb6b 100644
--- a/modules/video_output/win32/d3d11_quad.h
+++ b/modules/video_output/win32/d3d11_quad.h
@@ -47,32 +47,32 @@ typedef struct d3d_vertex_t {
 
 typedef bool (*d3d11_select_plane_t)(void *opaque, size_t plane_index);
 
-void D3D11_RenderQuad(d3d11_device_t *, d3d_quad_t *, d3d_vertex_shader_t *,
+void D3D11_RenderQuad(d3d11_device_t *, d3d11_quad_t *, d3d_vertex_shader_t *,
                       ID3D11ShaderResourceView *resourceViews[DXGI_MAX_SHADER_VIEW],
                       d3d11_select_plane_t selectPlane, void *selectOpaque);
 
-int D3D11_AllocateQuad(vlc_object_t *, d3d11_device_t *, video_projection_mode_t, d3d_quad_t *);
+int D3D11_AllocateQuad(vlc_object_t *, d3d11_device_t *, video_projection_mode_t, d3d11_quad_t *);
 #define D3D11_AllocateQuad(a,b,c,d)  D3D11_AllocateQuad(VLC_OBJECT(a),b,c,d)
 
-void D3D11_ReleaseQuad(d3d_quad_t *);
+void D3D11_ReleaseQuad(d3d11_quad_t *);
 
-int D3D11_SetupQuad(vlc_object_t *, d3d11_device_t *, const video_format_t *, d3d_quad_t *,
+int D3D11_SetupQuad(vlc_object_t *, d3d11_device_t *, const video_format_t *, d3d11_quad_t *,
                     const display_info_t *);
 #define D3D11_SetupQuad(a,b,c,d,e)  D3D11_SetupQuad(VLC_OBJECT(a),b,c,d,e)
 
-bool D3D11_UpdateQuadPosition( vlc_object_t *, d3d11_device_t *, d3d_quad_t *,
+bool D3D11_UpdateQuadPosition( vlc_object_t *, d3d11_device_t *, d3d11_quad_t *,
                                const RECT *output, video_orientation_t );
 #define D3D11_UpdateQuadPosition(a,b,c,d,e)  D3D11_UpdateQuadPosition(VLC_OBJECT(a),b,c,d,e)
 
-void D3D11_UpdateViewport(d3d_quad_t *, const RECT *, const d3d_format_t *display);
+void D3D11_UpdateViewport(d3d11_quad_t *, const RECT *, const d3d_format_t *display);
 
-void D3D11_UpdateQuadOpacity(vlc_object_t *, d3d11_device_t *, d3d_quad_t *, float opacity);
+void D3D11_UpdateQuadOpacity(vlc_object_t *, d3d11_device_t *, d3d11_quad_t *, float opacity);
 #define D3D11_UpdateQuadOpacity(a,b,c,d)  D3D11_UpdateQuadOpacity(VLC_OBJECT(a),b,c,d)
 
-void D3D11_UpdateQuadLuminanceScale(vlc_object_t *, d3d11_device_t *, d3d_quad_t *, float luminanceScale);
+void D3D11_UpdateQuadLuminanceScale(vlc_object_t *, d3d11_device_t *, d3d11_quad_t *, float luminanceScale);
 #define D3D11_UpdateQuadLuminanceScale(a,b,c,d)  D3D11_UpdateQuadLuminanceScale(VLC_OBJECT(a),b,c,d)
 
-void D3D11_UpdateViewpoint(vlc_object_t *, d3d11_device_t *, d3d_quad_t *, const vlc_viewpoint_t*, float sar);
+void D3D11_UpdateViewpoint(vlc_object_t *, d3d11_device_t *, d3d11_quad_t *, const vlc_viewpoint_t*, float sar);
 #define D3D11_UpdateViewpoint(a,b,c,d,e)  D3D11_UpdateViewpoint(VLC_OBJECT(a),b,c,d,e)
 
 #endif /* VLC_D3D11_QUAD_H */
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index 28ea77a4dc..2328342434 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -249,7 +249,7 @@ HRESULT (D3D11_CompilePixelShader)(vlc_object_t *o, const d3d11_shader_compiler_
                                  const display_info_t *display, bool sharp,
                                  video_transfer_func_t transfer,
                                  video_color_primaries_t primaries, bool src_full_range,
-                                 d3d_quad_t *quad)
+                                 d3d11_quad_t *quad)
 {
     static const char *DEFAULT_NOOP = "return rgb";
     const char *psz_sampler[2] = {NULL, NULL};
@@ -635,7 +635,7 @@ HRESULT (D3D11_CompilePixelShader)(vlc_object_t *o, const d3d11_shader_compiler_
     return hr;
 }
 
-void D3D11_ReleasePixelShader(d3d_quad_t *quad)
+void D3D11_ReleasePixelShader(d3d11_quad_t *quad)
 {
     for (size_t i=0; i<DXGI_MAX_SHADER_VIEW; i++)
     {
diff --git a/modules/video_output/win32/d3d11_shaders.h b/modules/video_output/win32/d3d11_shaders.h
index 767bba87f9..1a945942c2 100644
--- a/modules/video_output/win32/d3d11_shaders.h
+++ b/modules/video_output/win32/d3d11_shaders.h
@@ -100,7 +100,7 @@ typedef struct
 
     PS_CONSTANT_BUFFER        shaderConstants;
     VS_PROJECTION_CONST       vertexConstants;
-} d3d_quad_t;
+} d3d11_quad_t;
 
 #define D3D11_MAX_RENDER_TARGET    2
 
@@ -112,10 +112,10 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *, const d3d11_shader_compiler_t *
                                  const display_info_t *, bool sharp,
                                  video_transfer_func_t, video_color_primaries_t,
                                  bool src_full_range,
-                                 d3d_quad_t *);
+                                 d3d11_quad_t *);
 #define D3D11_CompilePixelShader(a,b,c,d,e,f,g,h,i,j,k) \
     D3D11_CompilePixelShader(VLC_OBJECT(a),b,c,d,e,f,g,h,i,j,k)
-void D3D11_ReleasePixelShader(d3d_quad_t *);
+void D3D11_ReleasePixelShader(d3d11_quad_t *);
 
 HRESULT D3D11_CompileFlatVertexShader(vlc_object_t *, const d3d11_shader_compiler_t *, d3d11_device_t *, d3d_vertex_shader_t *);
 #define D3D11_CompileFlatVertexShader(a,b,c,d) D3D11_CompileFlatVertexShader(VLC_OBJECT(a),b,c,d)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c1f5ddabf7..256a2eda25 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -101,7 +101,7 @@ struct vout_display_sys_t
     d3d11_device_t           *d3d_dev;
     d3d11_decoder_device_t   *local_d3d_dev; // when opened without a video context
     d3d11_shader_compiler_t  shaders;
-    d3d_quad_t               picQuad;
+    d3d11_quad_t               picQuad;
 
     ID3D11Asynchronous       *prepareWait;
 #ifdef HAVE_D3D11_4_H
@@ -123,7 +123,7 @@ struct vout_display_sys_t
 
     // SPU
     vlc_fourcc_t             pSubpictureChromas[2];
-    d3d_quad_t               regionQuad;
+    d3d11_quad_t               regionQuad;
     int                      d3dregion_count;
     picture_t                **d3dregions;
 
@@ -613,7 +613,7 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
         for (int i = 0; i < sys->d3dregion_count; ++i) {
             if (sys->d3dregions[i])
             {
-                d3d_quad_t *quad = (d3d_quad_t *) sys->d3dregions[i]->p_sys;
+                d3d11_quad_t *quad = (d3d11_quad_t *) sys->d3dregions[i]->p_sys;
                 D3D11_RenderQuad(sys->d3d_dev, quad, &sys->flatVShader,
                                  quad->picSys.renderSrc, SelectRenderPlane, sys);
             }
@@ -1268,7 +1268,7 @@ static void Direct3D11DeleteRegions(int count, picture_t **region)
 
 static void DestroyPictureQuad(picture_t *p_picture)
 {
-    D3D11_ReleaseQuad( (d3d_quad_t *) p_picture->p_sys );
+    D3D11_ReleaseQuad( (d3d11_quad_t *) p_picture->p_sys );
 }
 
 static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_count,
@@ -1299,8 +1299,8 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
 
         for (int j = 0; j < sys->d3dregion_count; j++) {
             picture_t *cache = sys->d3dregions[j];
-            if (cache != NULL && ((d3d_quad_t *) cache->p_sys)->picSys.texture[KNOWN_DXGI_INDEX]) {
-                ID3D11Texture2D_GetDesc( ((d3d_quad_t *) cache->p_sys)->picSys.texture[KNOWN_DXGI_INDEX], &texDesc );
+            if (cache != NULL && ((d3d11_quad_t *) cache->p_sys)->picSys.texture[KNOWN_DXGI_INDEX]) {
+                ID3D11Texture2D_GetDesc( ((d3d11_quad_t *) cache->p_sys)->picSys.texture[KNOWN_DXGI_INDEX], &texDesc );
                 if (texDesc.Format == sys->regionQuad.textureFormat->formatTexture &&
                     texDesc.Width  == r->p_picture->format.i_width &&
                     texDesc.Height == r->p_picture->format.i_height) {
@@ -1312,12 +1312,12 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
         }
 
         picture_t *quad_picture = (*region)[i];
-        d3d_quad_t *quad;
+        d3d11_quad_t *quad;
         if (quad_picture != NULL)
             quad = quad_picture->p_sys;
         else
         {
-            d3d_quad_t *d3dquad = calloc(1, sizeof(*d3dquad));
+            d3d11_quad_t *d3dquad = calloc(1, sizeof(*d3dquad));
             if (unlikely(d3dquad==NULL)) {
                 continue;
             }
@@ -1383,12 +1383,12 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
             }
         }
 
-        hr = ID3D11DeviceContext_Map(sys->d3d_dev->d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
+        hr = ID3D11DeviceContext_Map(sys->d3d_dev->d3dcontext, ((d3d11_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
         if( SUCCEEDED(hr) ) {
             err = picture_UpdatePlanes(quad_picture, mappedResource.pData, mappedResource.RowPitch);
             if (err != VLC_SUCCESS) {
                 msg_Err(vd, "Failed to set the buffer on the SPU picture" );
-                ID3D11DeviceContext_Unmap(sys->d3d_dev->d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0);
+                ID3D11DeviceContext_Unmap(sys->d3d_dev->d3dcontext, ((d3d11_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0);
                 picture_Release(quad_picture);
                 if ((*region)[i] == quad_picture)
                     (*region)[i] = NULL;
@@ -1397,7 +1397,7 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
 
             picture_CopyPixels(quad_picture, r->p_picture);
 
-            ID3D11DeviceContext_Unmap(sys->d3d_dev->d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0);
+            ID3D11DeviceContext_Unmap(sys->d3d_dev->d3dcontext, ((d3d11_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0);
         } else {
             msg_Err(vd, "Failed to map the SPU texture (hr=0x%lX)", hr );
             picture_Release(quad_picture);



More information about the vlc-commits mailing list