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

2018-03-14 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Mar 13 
15:26:19 2018 +0100| [353b690882f7dc36e1d0c90bfb69e3f49540043b] | committer: 
Hugo Beauzée-Luyssen

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.

(cherry picked from commit cc0740437300c44bafd933f8ce20fc25ca6ea9a2)
Signed-off-by: Hugo Beauzée-Luyssen 

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

 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 b8a2162773..6126e2ec36 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;\

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


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

2018-03-13 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | 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;\

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits