DE_ASSERT(other.m_fd == -1);
DE_ASSERT(!other.m_win32Handle.internal);
m_androidHardwareBuffer = other.m_androidHardwareBuffer;
- AndroidHardwareBufferExternalApi::getInstance()->acquire(m_androidHardwareBuffer);
+
+ if (AndroidHardwareBufferExternalApi* ahbApi = AndroidHardwareBufferExternalApi::getInstance())
+ ahbApi->acquire(m_androidHardwareBuffer);
+ else
+ DE_FATAL("Platform doesn't support Android Hardware Buffer handles");
}
else
DE_FATAL("Native handle can't be duplicated");
{
DE_ASSERT(m_fd == -1);
DE_ASSERT(!m_win32Handle.internal);
- AndroidHardwareBufferExternalApi::getInstance()->release(m_androidHardwareBuffer);
+
+ if (AndroidHardwareBufferExternalApi* ahbApi = AndroidHardwareBufferExternalApi::getInstance())
+ ahbApi->release(m_androidHardwareBuffer);
+ else
+ DE_FATAL("Platform doesn't support Android Hardware Buffer handles");
}
m_fd = -1;
m_win32Handle = vk::pt::Win32Handle(DE_NULL);
TCU_CHECK(texture);
if (texture->getType() == Texture::TYPE_2D)
- return dynamic_cast<Texture2D*>(texture)->getLevel(attachment.level);
+ {
+ if (Texture2D* texture2D = dynamic_cast<Texture2D*>(texture))
+ return texture2D->getLevel(attachment.level);
+ else
+ return nullAccess();
+ }
else if (texture->getType() == Texture::TYPE_CUBE_MAP)
- return dynamic_cast<TextureCube*>(texture)->getFace(attachment.level, texTargetToFace(attachment.texTarget));
+ {
+ if (TextureCube* cubeMap = dynamic_cast<TextureCube*>(texture))
+ return cubeMap->getFace(attachment.level, texTargetToFace(attachment.texTarget));
+ else
+ return nullAccess();
+ }
else if (texture->getType() == Texture::TYPE_2D_ARRAY ||
texture->getType() == Texture::TYPE_3D ||
texture->getType() == Texture::TYPE_CUBE_MAP_ARRAY)
tcu::PixelBufferAccess level;
if (texture->getType() == Texture::TYPE_2D_ARRAY)
- level = dynamic_cast<Texture2DArray*>(texture)->getLevel(attachment.level);
+ {
+ if (Texture2DArray* texture2DArray = dynamic_cast<Texture2DArray*>(texture))
+ level = texture2DArray->getLevel(attachment.level);
+ }
else if (texture->getType() == Texture::TYPE_3D)
- level = dynamic_cast<Texture3D*>(texture)->getLevel(attachment.level);
+ {
+ if (Texture3D* texture3D = dynamic_cast<Texture3D*>(texture))
+ level = texture3D->getLevel(attachment.level);
+ }
else if (texture->getType() == Texture::TYPE_CUBE_MAP_ARRAY)
- level = dynamic_cast<TextureCubeArray*>(texture)->getLevel(attachment.level);
+ {
+ if (TextureCubeArray* cubeArray = dynamic_cast<TextureCubeArray*>(texture))
+ level = cubeArray->getLevel(attachment.level);
+ }
void* layerData = static_cast<deUint8*>(level.getDataPtr()) + level.getSlicePitch() * attachment.layer;
print("Skip: %s" % step.getName())
COMMON_CFLAGS = ["-Werror", "-Wno-error=unused-function"]
-COMMON_GCC_CFLAGS = COMMON_CFLAGS + ["-Wno-implicit-fallthrough", "-Wno-error=array-bounds"]
+COMMON_GCC_CFLAGS = COMMON_CFLAGS + ["-Wno-error=array-bounds"]
COMMON_CLANG_CFLAGS = COMMON_CFLAGS + ["-Wno-error=unused-command-line-argument"]
GCC_32BIT_CFLAGS = COMMON_GCC_CFLAGS + ["-m32"]
CLANG_32BIT_CFLAGS = COMMON_CLANG_CFLAGS + ["-m32"]