| 35 | } |
| 36 | |
| 37 | void 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 | |
| 74 | glConst DecodeTextureFilter(TextureFilter filter) |
| 75 | { |