[vlc-commits] direct3d11: simplify the tone mapping algo

Steve Lhomme git at videolan.org
Tue Mar 13 15:26:44 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 13 15:26:19 2018 +0100| [cc0740437300c44bafd933f8ce20fc25ca6ea9a2] | committer: Steve Lhomme

direct3d11: simplify the tone mapping algo

Do the 3 values in one pass. This allow doing tone mapping even on 9.1
compatible GPUs which have a restricted number of instructions/slots.

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

 modules/video_output/win32/direct3d11.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index bdb4612f8a..d5457b7110 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -329,18 +329,11 @@ static const char* globPixelShaderDefault = "\
   };\
   \
   /* see http://filmicworlds.com/blog/filmic-tonemapping-operators/ */\
-  inline float hable(float x) {\
+  inline float3 hable(float3 x) {\
       const float A = 0.15, B = 0.50, C = 0.10, D = 0.20, E = 0.02, F = 0.30;\
       return ((x * (A*x + (C*B))+(D*E))/(x * (A*x + B) + (D*F))) - E/F;\
   }\
   \
-  inline float3 hable(float3 x) {\
-      x.r = hable(x.r);\
-      x.g = hable(x.g);\
-      x.b = hable(x.b);\
-      return x;\
-  }\
-  \
   /* https://en.wikipedia.org/wiki/Hybrid_Log-Gamma#Technical_details */\
   inline float inverse_HLG(float x){\
       const float B67_a = 0.17883277;\



More information about the vlc-commits mailing list