1 // 2 // Copyright 2020 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // d3d_format: Describes a D3D9 format. Used by the D3D9 and GL back-ends. 7 8 #ifndef LIBANGLE_RENDERER_D3D_FORMAT_H_ 9 #define LIBANGLE_RENDERER_D3D_FORMAT_H_ 10 11 #include "libANGLE/renderer/Format.h" 12 13 namespace rx 14 { 15 namespace d3d9 16 { 17 struct D3DFormat 18 { 19 D3DFormat(); 20 D3DFormat(GLuint pixelBytes, 21 GLuint blockWidth, 22 GLuint blockHeight, 23 GLuint redBits, 24 GLuint greenBits, 25 GLuint blueBits, 26 GLuint alphaBits, 27 GLuint luminanceBits, 28 GLuint depthBits, 29 GLuint stencilBits, 30 angle::FormatID formatID); 31 infoD3DFormat32 const angle::Format &info() const { return angle::Format::Get(formatID); } 33 34 GLuint pixelBytes; 35 GLuint blockWidth; 36 GLuint blockHeight; 37 38 GLuint redBits; 39 GLuint greenBits; 40 GLuint blueBits; 41 GLuint alphaBits; 42 GLuint luminanceBits; 43 44 GLuint depthBits; 45 GLuint stencilBits; 46 47 angle::FormatID formatID; 48 }; 49 50 const D3DFormat &GetD3DFormatInfo(D3DFORMAT format); 51 52 } // namespace d3d9 53 } // namespace rx 54 55 #endif // LIBANGLE_RENDERER_D3D_FORMAT_H_ 56