[vlc-commits] d3d_dynamic_shader: do the 16 bits to 10 bits conversion in one call

Steve Lhomme git at videolan.org
Thu Feb 18 06:46:12 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Feb 17 14:03:56 2021 +0100| [2d0168331e8bee5fc076c050cd2a42f1f3be1bca] | committer: Steve Lhomme

d3d_dynamic_shader: do the 16 bits to 10 bits conversion in one call

In older shader models it reduces the amount of operations needed.

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

 modules/video_output/win32/d3d_dynamic_shader.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/d3d_dynamic_shader.c b/modules/video_output/win32/d3d_dynamic_shader.c
index 4b12e5f0bf..132160e8be 100644
--- a/modules/video_output/win32/d3d_dynamic_shader.c
+++ b/modules/video_output/win32/d3d_dynamic_shader.c
@@ -218,9 +218,10 @@ inline float4 sampleTexture(SamplerState samplerState, float2 coords) {\n\
     sample.z  = shaderTexture[2].Sample(samplerState, coords).x;\n\
     sample.a  = 1;\n\
 #elif (SAMPLE_TEXTURES==SAMPLE_TRIPLANAR10_TO_YUVA)\n\
-    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.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 = sample * 64;\n\
     sample.a  = 1;\n\
 #elif (SAMPLE_TEXTURES==SAMPLE_PLANAR_YUVA_TO_YUVA)\n\
     sample.x  = shaderTexture[0].Sample(samplerState, coords).x;\n\



More information about the vlc-commits mailing list