MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / isCompatible

Method isCompatible

RenderSystems/GLES2/src/OgreGLES2DepthBuffer.cpp:161–202  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

159 }
160 //---------------------------------------------------------------------
161 bool GLES2DepthBuffer::isCompatible( RenderTarget *renderTarget, bool exactFormatMatch ) const
162 {
163 bool retVal = false;
164
165 //Check standard stuff first.
166 if( mRenderSystem->getCapabilities()->hasCapability( RSC_RTT_DEPTHBUFFER_RESOLUTION_LESSEQUAL ) )
167 {
168 retVal = DepthBuffer::isCompatible( renderTarget, exactFormatMatch );
169 }
170 else
171 {
172 if( this->getWidth() != renderTarget->getWidth() ||
173 this->getHeight() != renderTarget->getHeight() ||
174 this->getFsaa() != renderTarget->getFSAA() ||
175 (exactFormatMatch && mDepthTexture != renderTarget->prefersDepthTexture()) ||
176 (!exactFormatMatch && (mFormat != PF_D24_UNORM_S8_UINT || mFormat != PF_D24_UNORM) ) )
177 {
178 retVal = false;
179 }
180 else
181 {
182 retVal = true;
183 }
184 }
185
186 //Now check this is the appropriate format
187 GLES2FrameBufferObject *fbo = 0;
188 renderTarget->getCustomAttribute("FBO", &fbo);
189
190 if( !fbo && !renderTarget->getForceDisableColourWrites() )
191 {
192 GLES2Context *windowContext = 0;
193 renderTarget->getCustomAttribute( "GLCONTEXT", &windowContext );
194
195 //Non-FBO targets and FBO depth surfaces don't play along,
196 // only dummies which match the same context
197 if( !mDepthBufferName && !mStencilBufferName && mCreatorContext == windowContext )
198 retVal = true;
199 }
200
201 return retVal;
202 }
203 //---------------------------------------------------------------------
204 void GLES2DepthBuffer::bindToFramebuffer( GLenum target )
205 {

Callers

nothing calls this directly

Calls 4

getFSAAMethod · 0.80
getWidthMethod · 0.45
getHeightMethod · 0.45
getCustomAttributeMethod · 0.45

Tested by

no test coverage detected