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:
authorJeroen Bakker <jbakker>2020-03-19 10:06:49 +0300
committerJeroen Bakker <jeroen@blender.org>2020-03-19 10:26:48 +0300
commitfd48ff1296f45b32bffeca2c60dca2a12bb84229 (patch)
tree250137802d4bed0628a7926df724227349320757 /source/blender/gpu/intern/gpu_state.c
parentfe045b2b77dc6d7f0b552619fe824b496d34db6c (diff)
Fix T73931: Stereo Viewport Color Management
Stereoscopic viewport didn't support Color Manangement due recent changes in the color management pipeline. In order to solve the issue we will migrate the strereo rendering into the GPUViewport. This will share some textures and reduce required GPU memory. Reviewed By: fclem, dfelinto Differential Revision: https://developer.blender.org/D6922
Diffstat (limited to 'source/blender/gpu/intern/gpu_state.c')
-rw-r--r--source/blender/gpu/intern/gpu_state.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c
index 9ff518aec1b..6fd9b167599 100644
--- a/source/blender/gpu/intern/gpu_state.c
+++ b/source/blender/gpu/intern/gpu_state.c
@@ -218,6 +218,7 @@ typedef struct {
uint is_sample_alpha_to_coverage : 1;
uint is_scissor_test : 1;
uint is_stencil_test : 1;
+ uint is_framebuffer_srgb : 1;
bool is_clip_plane[6];
@@ -294,6 +295,7 @@ void gpuPushAttr(eGPUAttrMask mask)
if ((mask & GPU_VIEWPORT_BIT) != 0) {
glGetDoublev(GL_DEPTH_RANGE, (GLdouble *)&Attr.near_far);
glGetIntegerv(GL_VIEWPORT, (GLint *)&Attr.viewport);
+ Attr.is_framebuffer_srgb = glIsEnabled(GL_FRAMEBUFFER_SRGB);
}
if ((mask & GPU_BLEND_BIT) != 0) {
@@ -352,6 +354,7 @@ void gpuPopAttr(void)
if ((mask & GPU_VIEWPORT_BIT) != 0) {
glViewport(Attr.viewport[0], Attr.viewport[1], Attr.viewport[2], Attr.viewport[3]);
glDepthRange(Attr.near_far[0], Attr.near_far[1]);
+ restore_mask(GL_FRAMEBUFFER_SRGB, Attr.is_framebuffer_srgb);
}
if ((mask & GPU_SCISSOR_BIT) != 0) {