From: Mika Isojärvi Date: Fri, 7 Aug 2015 22:08:28 +0000 (-0700) Subject: Add has{Depth/Stencil)Component() utilities for TextureFormat. X-Git-Tag: upstream/0.1.0~812^2~604^2~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0644e3c835273f5c26836ef94f6fed8811d37944;p=platform%2Fupstream%2FVK-GL-CTS.git Add has{Depth/Stencil)Component() utilities for TextureFormat. Change-Id: Idbe5636ee882eb4917b740d9b8ff8e2e77b8ddb9 --- diff --git a/framework/common/tcuTextureUtil.cpp b/framework/common/tcuTextureUtil.cpp index 2591f10..778bc70 100644 --- a/framework/common/tcuTextureUtil.cpp +++ b/framework/common/tcuTextureUtil.cpp @@ -87,6 +87,36 @@ bool isCombinedDepthStencilType (TextureFormat::ChannelType type) type == TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV; } +bool hasStencilComponent (TextureFormat::ChannelOrder order) +{ + DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 18); + + switch (order) + { + case TextureFormat::S: + case TextureFormat::DS: + return true; + + default: + return false; + } +} + +bool hasDepthComponent (TextureFormat::ChannelOrder order) +{ + DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 18); + + switch (order) + { + case TextureFormat::D: + case TextureFormat::DS: + return true; + + default: + return false; + } +} + //! Get texture channel class for format TextureChannelClass getTextureChannelClass (TextureFormat::ChannelType channelType) { diff --git a/framework/common/tcuTextureUtil.hpp b/framework/common/tcuTextureUtil.hpp index c51e303..35bb122 100644 --- a/framework/common/tcuTextureUtil.hpp +++ b/framework/common/tcuTextureUtil.hpp @@ -40,6 +40,8 @@ PixelBufferAccess flipYAccess (const PixelBufferAccess& access); ConstPixelBufferAccess flipYAccess (const ConstPixelBufferAccess& access); bool isCombinedDepthStencilType (TextureFormat::ChannelType type); +bool hasStencilComponent (TextureFormat::ChannelOrder order); +bool hasDepthComponent (TextureFormat::ChannelOrder order); // sRGB - linear conversion. Vec4 sRGBToLinear (const Vec4& cs);