Image Engine: Add assert to check for correct float colorspace.
Float images loaded in Blender are converted to scene linear and don't require additional conversion. Image engine can reuse the rect_float of those images. An assert statement is added tp make this more clear and to test on missing code paths or future developments.
This commit is contained in:
parent
9785f84dd2
commit
6fb4ca1eec
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "BLI_vector.hh"
|
||||
|
||||
#include "IMB_colormanagement.h"
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
|
@ -68,6 +69,11 @@ struct FloatBufferCache {
|
|||
{
|
||||
/* Check if we can use the float buffer of the given image_buffer. */
|
||||
if (image_buffer->rect_float != nullptr) {
|
||||
BLI_assert_msg(
|
||||
IMB_colormanagement_space_name_is_scene_linear(
|
||||
IMB_colormanagement_get_float_colorspace(image_buffer)),
|
||||
"Expected rect_float to be scene_linear - if there are code paths where this "
|
||||
"isn't the case we should convert those and add to the FloatBufferCache as well.");
|
||||
return image_buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue