mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-02 07:08:19 +00:00
Skip tonemapping for render targets with unspecified HDR headroom
This commit is contained in:
@@ -917,7 +917,7 @@ static void CalculateAdvancedShaderConstants(SDL_Renderer *renderer, const SDL_R
|
||||
output_headroom = renderer->HDR_headroom;
|
||||
}
|
||||
|
||||
if (texture->HDR_headroom > output_headroom) {
|
||||
if (texture->HDR_headroom > output_headroom && output_headroom > 0.0f) {
|
||||
constants->tonemap_method = TONEMAP_CHROME;
|
||||
constants->tonemap_factor1 = (output_headroom / (texture->HDR_headroom * texture->HDR_headroom));
|
||||
constants->tonemap_factor2 = (1.0f / output_headroom);
|
||||
|
||||
Reference in New Issue
Block a user