MCPcopy Create free account
hub / github.com/comaps/comaps / UnpackFormat

Function UnpackFormat

libs/drape/hw_texture.cpp:37–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void UnpackFormat(ref_ptr<dp::GraphicsContext> context, TextureFormat format, glConst & layout, glConst & pixelType)
38{
39 auto const apiVersion = context->GetApiVersion();
40 CHECK(apiVersion == dp::ApiVersion::OpenGLES3, ());
41
42 switch (format)
43 {
44 case TextureFormat::RGBA8:
45 layout = gl_const::GLRGBA;
46 pixelType = gl_const::GL8BitOnChannel;
47 return;
48
49 case TextureFormat::Red:
50 layout = gl_const::GLRed;
51 pixelType = gl_const::GL8BitOnChannel;
52 return;
53
54 case TextureFormat::RedGreen:
55 layout = gl_const::GLRedGreen;
56 pixelType = gl_const::GL8BitOnChannel;
57 return;
58
59 case TextureFormat::DepthStencil:
60 layout = gl_const::GLDepthStencil;
61 pixelType = gl_const::GLUnsignedInt24_8Type;
62 return;
63
64 case TextureFormat::Depth:
65 layout = gl_const::GLDepthComponent;
66 pixelType = gl_const::GLUnsignedIntType;
67 return;
68
69 case TextureFormat::Unspecified: CHECK(false, ()); return;
70 }
71 UNREACHABLE();
72}
73
74glConst DecodeTextureFilter(TextureFilter filter)
75{

Callers 1

CreateMethod · 0.85

Calls 1

GetApiVersionMethod · 0.45

Tested by

no test coverage detected