+static int getNumDepthBits (const tcu::TextureFormat& format)
+{
+ if (format.order == tcu::TextureFormat::DS)
+ {
+ const tcu::TextureFormat depthOnlyFormat = tcu::getEffectiveDepthStencilTextureFormat(format, tcu::Sampler::MODE_DEPTH);
+ return tcu::getTextureFormatBitDepth(depthOnlyFormat).x();
+ }
+ else if (format.order == tcu::TextureFormat::D)
+ return tcu::getTextureFormatBitDepth(format).x();
+ else
+ return 0;
+}
+
+static int getNumStencilBits (const tcu::TextureFormat& format)
+{
+ if (format.order == tcu::TextureFormat::DS)
+ {
+ const tcu::TextureFormat stencilOnlyFormat = tcu::getEffectiveDepthStencilTextureFormat(format, tcu::Sampler::MODE_STENCIL);
+ return tcu::getTextureFormatBitDepth(stencilOnlyFormat).x();
+ }
+ else if (format.order == tcu::TextureFormat::S)
+ return tcu::getTextureFormatBitDepth(format).x();
+ else
+ return 0;
+}
+