shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 1 | // |
Geoff Lang | cec3590 | 2014-04-16 10:52:36 -0400 | [diff] [blame] | 2 | // Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved. |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // formatutils11.h: Queries for GL image formats and their translations to D3D11 |
| 8 | // formats. |
| 9 | |
| 10 | #ifndef LIBGLESV2_RENDERER_FORMATUTILS11_H_ |
| 11 | #define LIBGLESV2_RENDERER_FORMATUTILS11_H_ |
| 12 | |
| 13 | #include "libGLESv2/formatutils.h" |
| 14 | |
Geoff Lang | 0b7eef7 | 2014-06-12 14:10:47 -0400 | [diff] [blame] | 15 | #include <map> |
| 16 | |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 17 | namespace rx |
| 18 | { |
| 19 | |
| 20 | namespace d3d11 |
| 21 | { |
| 22 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 23 | typedef std::map<std::pair<GLenum, GLenum>, ColorCopyFunction> FastCopyFunctionMap; |
Geoff Lang | 61e49a5 | 2013-05-29 10:22:58 -0400 | [diff] [blame] | 24 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 25 | struct DXGIFormat |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 26 | { |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 27 | DXGIFormat(); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 28 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 29 | GLuint pixelBytes; |
| 30 | GLuint blockWidth; |
| 31 | GLuint blockHeight; |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 32 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 33 | GLuint depthBits; |
| 34 | GLuint depthOffset; |
| 35 | GLuint stencilBits; |
| 36 | GLuint stencilOffset; |
Geoff Lang | 00f6bc3 | 2013-09-20 14:59:06 -0400 | [diff] [blame] | 37 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 38 | GLenum internalFormat; |
| 39 | GLenum componentType; |
Geoff Lang | 0c99b1b | 2013-09-30 15:07:43 -0400 | [diff] [blame] | 40 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 41 | MipGenerationFunction mipGenerationFunction; |
| 42 | ColorReadFunction colorReadFunction; |
Jamie Madill | 7ab02fa | 2014-02-04 16:04:08 -0500 | [diff] [blame] | 43 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 44 | FastCopyFunctionMap fastCopyFunctions; |
| 45 | ColorCopyFunction getFastCopyFunction(GLenum format, GLenum type) const; |
| 46 | }; |
| 47 | const DXGIFormat &GetDXGIFormatInfo(DXGI_FORMAT format); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 48 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 49 | struct TextureFormat |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 50 | { |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 51 | TextureFormat(); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 52 | |
Geoff Lang | 9aa00bb | 2014-07-07 12:33:25 -0400 | [diff] [blame] | 53 | DXGI_FORMAT texFormat; |
| 54 | DXGI_FORMAT srvFormat; |
| 55 | DXGI_FORMAT rtvFormat; |
| 56 | DXGI_FORMAT dsvFormat; |
| 57 | DXGI_FORMAT renderFormat; |
| 58 | |
| 59 | DXGI_FORMAT swizzleTexFormat; |
| 60 | DXGI_FORMAT swizzleSRVFormat; |
| 61 | DXGI_FORMAT swizzleRTVFormat; |
| 62 | |
| 63 | InitializeTextureDataFunction dataInitializerFunction; |
| 64 | |
| 65 | typedef std::map<GLenum, LoadImageFunction> LoadFunctionMap; |
| 66 | LoadFunctionMap loadFunctions; |
| 67 | }; |
| 68 | const TextureFormat &GetTextureFormatInfo(GLenum internalFormat); |
| 69 | |
| 70 | struct VertexFormat |
| 71 | { |
| 72 | VertexFormat(); |
| 73 | |
| 74 | VertexConversionType conversionType; |
| 75 | DXGI_FORMAT nativeFormat; |
| 76 | VertexCopyFunction copyFunction; |
| 77 | }; |
| 78 | const VertexFormat &GetVertexFormatInfo(const gl::VertexFormat &vertexFormat); |
shannonwoods@chromium.org | b8490f3 | 2013-05-30 00:08:00 +0000 | [diff] [blame] | 79 | |
| 80 | } |
| 81 | |
| 82 | } |
| 83 | |
| 84 | #endif // LIBGLESV2_RENDERER_FORMATUTILS11_H_ |