MCPcopy Create free account
hub / github.com/carbonengine/trinity / IsValid

Function IsValid

trinity/Tr2GpuResourcePool.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34bool IsValid( const Tr2BitmapDimensions& desc )
35{
36 if( desc.GetFormat() == ImageIO::PIXEL_FORMAT_UNKNOWN )
37 {
38 return false;
39 }
40 switch( desc.GetType() )
41 {
42 case ImageIO::TEX_TYPE_1D:
43 return desc.GetWidth() > 0;
44 case ImageIO::TEX_TYPE_2D:
45 return desc.GetWidth() > 0 && desc.GetHeight() > 0;
46 case ImageIO::TEX_TYPE_3D:
47 return desc.GetWidth() > 0 && desc.GetHeight() > 0 && desc.GetDepth() > 0;
48 case ImageIO::TEX_TYPE_CUBE:
49 return desc.GetWidth() > 0 && desc.GetHeight() == desc.GetWidth();
50 default:
51 return false;
52 }
53}
54
55std::string ToString( const Tr2BitmapDimensions& desc )
56{

Callers 15

Tr2GpuBuffer.hFile · 0.70
TriValueBinding.hFile · 0.70
Tr2DepthStencil.hFile · 0.70
PopulateMarginMethod · 0.70
SaveMethod · 0.70
CompressMethod · 0.70
CountPixelsOfValueMethod · 0.70
IsMonochromeMethod · 0.70
SetPixelMethod · 0.70

Calls 5

GetFormatMethod · 0.45
GetTypeMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetDepthMethod · 0.45

Tested by

no test coverage detected