[vlc-commits] direct3d11: simplify the tone mapping algo
Steve Lhomme
git at videolan.org
Wed Mar 14 11:52:15 CET 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | 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 <hugo at beauzee.fr>
> 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;\
More information about the vlc-commits
mailing list