[vlc-commits] d3d11: simplify D3D11_SetupQuad()
Steve Lhomme
git at videolan.org
Wed Oct 17 16:07:28 CEST 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Feb 21 11:14:23 2018 +0100| [7b807ac85c9c6ea2553f533f91f0cc102c761916] | committer: Steve Lhomme
d3d11: simplify D3D11_SetupQuad()
Remove parameters that are passed via the Quad
(cherry picked from commit 577ea9c2d37ed34c4b3d96b4393a73e9add13d59)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7b807ac85c9c6ea2553f533f91f0cc102c761916
---
modules/video_output/win32/d3d11_quad.c | 9 ++++-----
modules/video_output/win32/d3d11_quad.h | 6 +++---
modules/video_output/win32/direct3d11.c | 5 ++---
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index c4277d3b38..f05badb667 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -611,11 +611,11 @@ void D3D11_UpdateQuadLuminanceScale(vlc_object_t *o, d3d11_device_t *d3d_dev, d3
#undef D3D11_SetupQuad
int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format_t *fmt, d3d_quad_t *quad,
const display_info_t *displayFormat, const RECT *output,
- const d3d_format_t *cfg, ID3D11PixelShader *d3dpixelShader, ID3D11VertexShader *d3dvertexShader,
+ ID3D11VertexShader *d3dvertexShader,
video_projection_mode_t projection, video_orientation_t orientation)
{
HRESULT hr;
- const bool RGB_shader = IsRGBShader(cfg);
+ const bool RGB_shader = IsRGBShader(quad->formatInfo);
quad->shaderConstants.LuminanceScale = GetFormatLuminance(o, fmt) / (float)displayFormat->luminance_peak;
@@ -648,7 +648,7 @@ int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format
FLOAT itu_achromacy = 0.f;
if (!RGB_shader)
{
- switch (cfg->bitsPerChannel)
+ switch (quad->formatInfo->bitsPerChannel)
{
case 8:
/* Rec. ITU-R BT.709-6 ยง4.6 */
@@ -762,7 +762,7 @@ int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format
}
}
- quad->picSys.formatTexture = cfg->formatTexture;
+ quad->picSys.formatTexture = quad->formatInfo->formatTexture;
quad->picSys.context = d3d_dev->d3dcontext;
ID3D11DeviceContext_AddRef(quad->picSys.context);
@@ -771,7 +771,6 @@ int D3D11_SetupQuad(vlc_object_t *o, d3d11_device_t *d3d_dev, const video_format
if (!D3D11_UpdateQuadPosition(o, d3d_dev, quad, output, orientation))
goto error;
- quad->d3dpixelShader = d3dpixelShader;
quad->d3dvertexShader = d3dvertexShader;
quad->resourceCount = DxgiResourceCount(quad->formatInfo);
diff --git a/modules/video_output/win32/d3d11_quad.h b/modules/video_output/win32/d3d11_quad.h
index 27f19e993e..788b7a1c13 100644
--- a/modules/video_output/win32/d3d11_quad.h
+++ b/modules/video_output/win32/d3d11_quad.h
@@ -72,10 +72,10 @@ void D3D11_RenderQuad(d3d11_device_t *, d3d_quad_t *,
void D3D11_ReleaseQuad(d3d_quad_t *);
int D3D11_SetupQuad(vlc_object_t *, d3d11_device_t *, const video_format_t *, d3d_quad_t *,
- const display_info_t *, const RECT *, const d3d_format_t *,
- ID3D11PixelShader *, ID3D11VertexShader *, video_projection_mode_t,
+ const display_info_t *, const RECT *,
+ ID3D11VertexShader *, video_projection_mode_t,
video_orientation_t);
-#define D3D11_SetupQuad(a,b,c,d,e,f,g,h,i,j,k) D3D11_SetupQuad(VLC_OBJECT(a),b,c,d,e,f,g,h,i,j,k)
+#define D3D11_SetupQuad(a,b,c,d,e,f,g,h,i) D3D11_SetupQuad(VLC_OBJECT(a),b,c,d,e,f,g,h,i)
bool D3D11_UpdateQuadPosition( vlc_object_t *, d3d11_device_t *, d3d_quad_t *,
const RECT *output, video_orientation_t );
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c4f6acb129..68f630c5d6 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -357,7 +357,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
surface_fmt.i_height = sys->picQuad.i_height;
if (D3D11_SetupQuad( vd, &sys->d3d_dev, &surface_fmt, &sys->picQuad, &sys->display, &sys->sys.rect_src_clipped,
- sys->picQuad.formatInfo, sys->picQuad.d3dpixelShader,
vd->fmt.projection_mode == PROJECTION_MODE_RECTANGULAR ? sys->flatVSShader : sys->projectionVSShader,
surface_fmt.projection_mode, vd->fmt.orientation ) != VLC_SUCCESS) {
msg_Err(vd, "Could not Create the main quad picture.");
@@ -1809,14 +1808,14 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
d3dquad->formatInfo = sys->d3dregion_format;
err = D3D11_SetupQuad( vd, &sys->d3d_dev, &r->fmt, d3dquad, &sys->display, &output,
- sys->d3dregion_format, sys->pSPUPixelShader, sys->flatVSShader,
- PROJECTION_MODE_RECTANGULAR, ORIENT_NORMAL );
+ sys->flatVSShader, PROJECTION_MODE_RECTANGULAR, ORIENT_NORMAL );
if (err != VLC_SUCCESS) {
msg_Err(vd, "Failed to create %dx%d quad for OSD",
r->fmt.i_visible_width, r->fmt.i_visible_height);
free(d3dquad);
continue;
}
+ d3dquad->d3dpixelShader = sys->pSPUPixelShader;
picture_resource_t picres = {
.p_sys = (picture_sys_t *) d3dquad,
.pf_destroy = DestroyPictureQuad,
More information about the vlc-commits
mailing list