diff options
Diffstat (limited to 'video/out/gpu/video_shaders.c')
-rw-r--r-- | video/out/gpu/video_shaders.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index df379778fc..d7774a61e5 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -692,7 +692,8 @@ static void pass_tone_map(struct gl_shader_cache *sc, // This function always operates on an absolute scale, so ignore the // dst_peak normalization for it float dst_scale = dst_peak; - if (opts->curve == TONE_MAPPING_BT_2390) + enum tone_mapping curve = opts->curve ? opts->curve : TONE_MAPPING_BT_2390; + if (curve == TONE_MAPPING_BT_2390) dst_scale = 1.0; // Rescale the variables in order to bring it into a representation where @@ -709,7 +710,7 @@ static void pass_tone_map(struct gl_shader_cache *sc, GLSL(sig_peak *= slope;) float param = opts->curve_param; - switch (opts->curve) { + switch (curve) { case TONE_MAPPING_CLIP: GLSLF("sig = min(%f * sig, 1.0);\n", isnan(param) ? 1.0 : param); break; |