mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 02:00:21 +01:00
mesa: move assertions in test_attachment_completeness()
Put the assertions after the error checks.
This commit is contained in:
parent
1e0f621b50
commit
3ffaa11f88
1 changed files with 7 additions and 5 deletions
|
|
@ -417,21 +417,22 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
|
|||
if (format == GL_COLOR) {
|
||||
if (att->Renderbuffer->_BaseFormat != GL_RGB &&
|
||||
att->Renderbuffer->_BaseFormat != GL_RGBA) {
|
||||
ASSERT(att->Renderbuffer->RedBits);
|
||||
ASSERT(att->Renderbuffer->GreenBits);
|
||||
ASSERT(att->Renderbuffer->BlueBits);
|
||||
att_incomplete("bad renderbuffer color format");
|
||||
att->Complete = GL_FALSE;
|
||||
return;
|
||||
}
|
||||
ASSERT(att->Renderbuffer->RedBits);
|
||||
ASSERT(att->Renderbuffer->GreenBits);
|
||||
ASSERT(att->Renderbuffer->BlueBits);
|
||||
}
|
||||
else if (format == GL_DEPTH) {
|
||||
ASSERT(att->Renderbuffer->DepthBits);
|
||||
if (att->Renderbuffer->_BaseFormat == GL_DEPTH_COMPONENT) {
|
||||
ASSERT(att->Renderbuffer->DepthBits);
|
||||
/* OK */
|
||||
}
|
||||
else if (ctx->Extensions.EXT_packed_depth_stencil &&
|
||||
att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
|
||||
ASSERT(att->Renderbuffer->DepthBits);
|
||||
/* OK */
|
||||
}
|
||||
else {
|
||||
|
|
@ -442,12 +443,13 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
|
|||
}
|
||||
else {
|
||||
assert(format == GL_STENCIL);
|
||||
ASSERT(att->Renderbuffer->StencilBits);
|
||||
if (att->Renderbuffer->_BaseFormat == GL_STENCIL_INDEX) {
|
||||
ASSERT(att->Renderbuffer->StencilBits);
|
||||
/* OK */
|
||||
}
|
||||
else if (ctx->Extensions.EXT_packed_depth_stencil &&
|
||||
att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
|
||||
ASSERT(att->Renderbuffer->StencilBits);
|
||||
/* OK */
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue