[vlc-commits] d3d11_shaders: log the whole pixel shader with -vvvv
Steve Lhomme
git at videolan.org
Wed Oct 17 16:07:48 CEST 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 12 14:53:20 2018 +0200| [af8799845807bc58338f0d3b9624608d97289bcf] | committer: Steve Lhomme
d3d11_shaders: log the whole pixel shader with -vvvv
(cherry picked from commit a1b3465c6265b850108714ad2306342c18f69907)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=af8799845807bc58338f0d3b9624608d97289bcf
---
modules/video_output/win32/d3d11_shaders.c | 72 +++++++++++++++---------------
1 file changed, 37 insertions(+), 35 deletions(-)
diff --git a/modules/video_output/win32/d3d11_shaders.c b/modules/video_output/win32/d3d11_shaders.c
index ccb52352c9..8767e39b33 100644
--- a/modules/video_output/win32/d3d11_shaders.c
+++ b/modules/video_output/win32/d3d11_shaders.c
@@ -222,23 +222,23 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
psz_sampler =
- "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\
- sample.yz = shaderTexture[1].Sample(samplerState, coords).xy;\
- sample.a = 1;";
+ "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\n"
+ "sample.yz = shaderTexture[1].Sample(samplerState, coords).xy;\n"
+ "sample.a = 1;";
break;
case DXGI_FORMAT_YUY2:
psz_sampler =
- "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\
- sample.y = shaderTexture[0].Sample(samplerState, coords).y;\
- sample.z = shaderTexture[0].Sample(samplerState, coords).a;\
- sample.a = 1;";
+ "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\n"
+ "sample.y = shaderTexture[0].Sample(samplerState, coords).y;\n"
+ "sample.z = shaderTexture[0].Sample(samplerState, coords).a;\n"
+ "sample.a = 1;";
break;
case DXGI_FORMAT_AYUV:
psz_sampler =
- "sample.x = shaderTexture[0].Sample(SampleType, In.Texture).z;\
- sample.y = shaderTexture[0].Sample(SampleType, In.Texture).y;\
- sample.z = shaderTexture[0].Sample(SampleType, In.Texture).x;\
- sample.a = shaderTexture[0].Sample(SampleType, In.Texture).a;";
+ "sample.x = shaderTexture[0].Sample(SampleType, In.Texture).z;\n"
+ "sample.y = shaderTexture[0].Sample(SampleType, In.Texture).y;\n"
+ "sample.z = shaderTexture[0].Sample(SampleType, In.Texture).x;\n"
+ "sample.a = shaderTexture[0].Sample(SampleType, In.Texture).a;";
break;
case DXGI_FORMAT_R8G8B8A8_UNORM:
case DXGI_FORMAT_B8G8R8A8_UNORM:
@@ -251,16 +251,16 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
case DXGI_FORMAT_UNKNOWN:
if (format->fourcc == VLC_CODEC_I420_10L)
psz_sampler =
- "sample.x = shaderTexture[0].Sample(samplerState, coords).x * 64;\
- sample.y = shaderTexture[1].Sample(samplerState, coords).x * 64;\
- sample.z = shaderTexture[2].Sample(samplerState, coords).x * 64;\
- sample.a = 1;";
+ "sample.x = shaderTexture[0].Sample(samplerState, coords).x * 64;\n"
+ "sample.y = shaderTexture[1].Sample(samplerState, coords).x * 64;\n"
+ "sample.z = shaderTexture[2].Sample(samplerState, coords).x * 64;\n"
+ "sample.a = 1;";
else
psz_sampler =
- "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\
- sample.y = shaderTexture[1].Sample(samplerState, coords).x;\
- sample.z = shaderTexture[2].Sample(samplerState, coords).x;\
- sample.a = 1;";
+ "sample.x = shaderTexture[0].Sample(samplerState, coords).x;\n"
+ "sample.y = shaderTexture[1].Sample(samplerState, coords).x;\n"
+ "sample.z = shaderTexture[2].Sample(samplerState, coords).x;\n"
+ "sample.a = 1;";
break;
default:
vlc_assert_unreachable();
@@ -277,19 +277,19 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
/* ST2084 to Linear */
psz_src_transform =
ST2084_PQ_CONSTANTS
- "rgb = pow(rgb, 1.0/ST2084_m2);\
- rgb = max(rgb - ST2084_c1, 0.0) / (ST2084_c2 - ST2084_c3 * rgb);\
- rgb = pow(rgb, 1.0/ST2084_m1);\
- return rgb";
+ "rgb = pow(rgb, 1.0/ST2084_m2);\n"
+ "rgb = max(rgb - ST2084_c1, 0.0) / (ST2084_c2 - ST2084_c3 * rgb);\n"
+ "rgb = pow(rgb, 1.0/ST2084_m1);\n"
+ "return rgb";
src_transfer = TRANSFER_FUNC_LINEAR;
break;
case TRANSFER_FUNC_HLG:
/* HLG to Linear */
psz_src_transform =
- "rgb.r = inverse_HLG(rgb.r);\
- rgb.g = inverse_HLG(rgb.g);\
- rgb.b = inverse_HLG(rgb.b);\
- return rgb / 20.0";
+ "rgb.r = inverse_HLG(rgb.r);\n"
+ "rgb.g = inverse_HLG(rgb.g);\n"
+ "rgb.b = inverse_HLG(rgb.b);\n"
+ "return rgb / 20.0";
src_transfer = TRANSFER_FUNC_LINEAR;
break;
case TRANSFER_FUNC_BT709:
@@ -323,9 +323,9 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
{
/* HDR tone mapping */
psz_tone_mapping =
- "static const float3 HABLE_DIV = hable(11.2);\
- rgb = hable(rgb * LuminanceScale) / HABLE_DIV;\
- return rgb";
+ "static const float3 HABLE_DIV = hable(11.2);\n"
+ "rgb = hable(rgb * LuminanceScale) / HABLE_DIV;\n"
+ "return rgb";
}
}
else
@@ -338,10 +338,10 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
/* Linear to ST2084 */
psz_display_transform =
ST2084_PQ_CONSTANTS
- "rgb = pow(rgb, ST2084_m1);\
- rgb = (ST2084_c1 + ST2084_c2 * rgb) / (1 + ST2084_c3 * rgb);\
- rgb = pow(rgb, ST2084_m2);\
- return rgb";
+ "rgb = pow(rgb, ST2084_m1);\n"
+ "rgb = (ST2084_c1 + ST2084_c2 * rgb) / (1 + ST2084_c3 * rgb);\n"
+ "rgb = pow(rgb, ST2084_m2);\n"
+ "return rgb";
}
else
msg_Warn(o, "don't know how to transfer from %d to SMPTE ST 2084", src_transfer);
@@ -438,8 +438,10 @@ HRESULT D3D11_CompilePixelShader(vlc_object_t *o, d3d11_handle_t *hd3d, bool leg
}
sprintf(shader, globPixelShaderDefault, legacy_shader ? "" : "Array", psz_src_transform,
psz_display_transform, psz_primaries_transform, psz_tone_mapping, psz_adjust_range, psz_sampler);
+ if (var_InheritInteger(o, "verbose") >= 4)
+ msg_Dbg(o, "shader %s", shader);
#ifndef NDEBUG
- if (!IsRGBShader(format)) {
+ else if (!IsRGBShader(format)) {
msg_Dbg(o,"psz_src_transform %s", psz_src_transform);
msg_Dbg(o,"psz_primaries_transform %s", psz_primaries_transform);
msg_Dbg(o,"psz_tone_mapping %s", psz_tone_mapping);
More information about the vlc-commits
mailing list