[vlc-commits] [Git][videolan/vlc][master] 2 commits: d3d_dynamic_shader: ignore the X component of BGRX
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Feb 23 10:06:20 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
00bfcae4 by Steve Lhomme at 2024-02-23T09:39:18+00:00
d3d_dynamic_shader: ignore the X component of BGRX
- - - - -
88208c99 by Steve Lhomme at 2024-02-23T09:39:18+00:00
d3d_shaders: fix black level of limited range RGB
This can happen during VideoProcessor upscaling.
- - - - -
2 changed files:
- modules/video_output/win32/d3d_dynamic_shader.c
- modules/video_output/win32/d3d_shaders.c
Changes:
=====================================
modules/video_output/win32/d3d_dynamic_shader.c
=====================================
@@ -83,6 +83,7 @@ struct PS_INPUT\n\
#define SAMPLE_TRIPLANAR_TO_YUVA 7\n\
#define SAMPLE_TRIPLANAR10_TO_YUVA 8\n\
#define SAMPLE_PLANAR_YUVA_TO_YUVA 9\n\
+#define SAMPLE_BGRX_TO_RGBA 17\n\
\n\
#define SAMPLE_NV12_TO_NV_Y 10\n\
#define SAMPLE_NV12_TO_NV_UV 11\n\
@@ -204,6 +205,9 @@ inline float4 sampleTexture(SamplerState samplerState, float2 coords) {\n\
sample.a = 1;\n\
#elif (SAMPLE_TEXTURES==SAMPLE_RGBA_TO_RGBA)\n\
sample = shaderTexture[0].Sample(samplerState, coords);\n\
+#elif (SAMPLE_TEXTURES==SAMPLE_BGRX_TO_RGBA)\n\
+ sample = shaderTexture[0].Sample(samplerState, coords);\n\
+ sample.a = 1;\n\
#elif (SAMPLE_TEXTURES==SAMPLE_TRIPLANAR_TO_YUVA)\n\
sample.x = shaderTexture[0].Sample(samplerState, coords).x;\n\
sample.y = shaderTexture[1].Sample(samplerState, coords).x;\n\
@@ -518,13 +522,16 @@ HRESULT (D3D_CompilePixelShader)(vlc_object_t *o, const d3d_shader_compiler_t *c
break;
case DXGI_FORMAT_R8G8B8A8_UNORM:
case DXGI_FORMAT_B8G8R8A8_UNORM:
- case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_R10G10B10A2_UNORM:
case DXGI_FORMAT_R16G16B16A16_UNORM:
case DXGI_FORMAT_B5G6R5_UNORM:
psz_sampler[0] = "SAMPLE_RGBA_TO_RGBA";
psz_shader_resource_views[0] = "1"; shader_views[0] = 1;
break;
+ case DXGI_FORMAT_B8G8R8X8_UNORM:
+ psz_sampler[0] = "SAMPLE_BGRX_TO_RGBA";
+ psz_shader_resource_views[0] = "1"; shader_views[0] = 1;
+ break;
case DXGI_FORMAT_UNKNOWN:
switch (dxgi_fmt->fourcc)
{
=====================================
modules/video_output/win32/d3d_shaders.c
=====================================
@@ -419,7 +419,7 @@ void D3D_SetupQuad(vlc_object_t *o, const video_format_t *fmt, d3d_quad_t *quad,
FLOAT itu_black_level = 0.f;
FLOAT itu_achromacy = 0.f;
- if (!RGB_src_shader)
+ if (!RGB_src_shader || fmt->color_range == COLOR_RANGE_LIMITED)
{
switch (quad->textureFormat->bitsPerChannel)
{
@@ -486,6 +486,9 @@ void D3D_SetupQuad(vlc_object_t *o, const video_format_t *fmt, d3d_quad_t *quad,
if (RGB_src_shader == DxgiIsRGBFormat(displayFormat->pixelFormat))
{
ppColorspace = IDENTITY_4X3;
+ WhitePoint[0*4 + 3] = -itu_black_level;
+ WhitePoint[1*4 + 3] = -itu_black_level;
+ WhitePoint[2*4 + 3] = -itu_black_level;
}
else if (RGB_src_shader)
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f38e13cad4cb20a1ef1d35164043307b1ac059e5...88208c99875afbca91d864fb995b82315ff3b923
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f38e13cad4cb20a1ef1d35164043307b1ac059e5...88208c99875afbca91d864fb995b82315ff3b923
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list