xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/d3d_format.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 // We forcibly include the D3D9 header here because this file can be used from 3 different backends.
14 #include <d3d9.h>
15 
16 namespace rx
17 {
18 namespace d3d9
19 {
20 struct D3DFormat
21 {
22     D3DFormat();
23     D3DFormat(GLuint pixelBytes,
24               GLuint blockWidth,
25               GLuint blockHeight,
26               GLuint redBits,
27               GLuint greenBits,
28               GLuint blueBits,
29               GLuint alphaBits,
30               GLuint luminanceBits,
31               GLuint depthBits,
32               GLuint stencilBits,
33               angle::FormatID formatID);
34 
infoD3DFormat35     const angle::Format &info() const { return angle::Format::Get(formatID); }
36 
37     GLuint pixelBytes;
38     GLuint blockWidth;
39     GLuint blockHeight;
40 
41     GLuint redBits;
42     GLuint greenBits;
43     GLuint blueBits;
44     GLuint alphaBits;
45     GLuint luminanceBits;
46 
47     GLuint depthBits;
48     GLuint stencilBits;
49 
50     angle::FormatID formatID;
51 };
52 
53 const D3DFormat &GetD3DFormatInfo(D3DFORMAT format);
54 
55 }  // namespace d3d9
56 }  // namespace rx
57 
58 #endif  // LIBANGLE_RENDERER_D3D_FORMAT_H_
59