summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicscontext.cpp
diff options
context:
space:
mode:
authorAndy Maloney <asmaloney@gmail.com>2017-03-14 10:50:21 -0400
committerAntti Määttä <antti.maatta@qt.io>2017-03-14 14:55:05 +0000
commit842703a863817e02d50c245213bc49eea2e24c08 (patch)
treeaf8fece10b8210ea3539a4a01f093017c82fd801 /src/render/graphicshelpers/graphicscontext.cpp
parent67a36ed82d5d1c3b414f7dd41d8de93cb68be55f (diff)
Fix resolving of render target format in GraphicsContext
The GraphicsContext render target format was not being resolved properly when the alphaBufferSize was -1. Also initialize the member var storing the render buffer format. Change-Id: I939ccf29f6cf9ef66befe5deee7ce94e2dc19a26 Task-number: QTBUG-59456 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext.cpp')
-rw-r--r--src/render/graphicshelpers/graphicscontext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp
index 875f619b8..6fa081552 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -162,6 +162,7 @@ GraphicsContext::GraphicsContext()
, m_ownCurrent(true)
, m_activeShader(nullptr)
, m_activeShaderDNA(0)
+ , m_renderTargetFormat(QAbstractTexture::NoFormat)
, m_currClearStencilValue(0)
, m_currClearDepthValue(1.f)
, m_currClearColorValue(0,0,0,0)
@@ -215,7 +216,7 @@ void GraphicsContext::initialize()
void GraphicsContext::resolveRenderTargetFormat()
{
const QSurfaceFormat format = m_gl->format();
- const uint a = format.alphaBufferSize();
+ const uint a = (format.alphaBufferSize() == -1) ? 0 : format.alphaBufferSize();
const uint r = format.redBufferSize();
const uint g = format.greenBufferSize();
const uint b = format.blueBufferSize();