Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-03-29 00:38:55 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-29 00:38:55 +0300
commit4d71b655ec05d4fcee72d4606e97a3e146804054 (patch)
tree32e2e3d20c499882a559c166d11195e2f9974174 /source/blender/draw
parent42dd888b98b598c240f78302b857fa60add08ca5 (diff)
GPU: Fix color difference when rendering to gpu_py_offscreen
Now we do the color management inside the Draw manager and output CM byte buffer.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/DRW_engine.h1
-rw-r--r--source/blender/draw/intern/draw_manager.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index 49d17e39de2..f5e679a4e73 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -111,6 +111,7 @@ void DRW_draw_render_loop_offscreen(
struct RenderEngineType *engine_type,
struct ARegion *ar, struct View3D *v3d,
const bool draw_background,
+ const bool do_color_management,
struct GPUOffScreen *ofs,
struct GPUViewport *viewport);
void DRW_draw_select_loop(
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 8a532ecdb7d..44ec9926d59 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1673,7 +1673,9 @@ void DRW_draw_render_loop(
void DRW_draw_render_loop_offscreen(
struct Depsgraph *depsgraph, RenderEngineType *engine_type,
ARegion *ar, View3D *v3d,
- const bool draw_background, GPUOffScreen *ofs,
+ const bool draw_background,
+ const bool do_color_management,
+ GPUOffScreen *ofs,
GPUViewport *viewport)
{
/* Create temporary viewport if needed. */
@@ -1686,7 +1688,9 @@ void DRW_draw_render_loop_offscreen(
/* Reset before using it. */
drw_state_prepare_clean_for_draw(&DST);
- DST.options.is_image_render = true;
+ /* WATCH: Force color management to output CManaged byte buffer by
+ * forcing is_image_render to false. */
+ DST.options.is_image_render = !do_color_management;
DST.options.draw_background = draw_background;
DRW_draw_render_loop_ex(depsgraph, engine_type, ar, v3d, render_viewport, NULL);