Commit 11505601 by Olli Etuaho

D3D11 Texture refactoring: Add ANGLEFormat enumeration to C++ code

Texture formats that are internal to ANGLE can now be uniquely identified using the ANGLEFormat enum. GetANGLEFormatInfo returns a structure with the DXGI texture formats associated with the ANGLE format. For starters, the ANGLEFormat enum is used when building texture info structures queried from GetTextureFormatInfo. BUG=angleproject:1244 TEST=angle_end2end_tests Change-Id: I58a2027a1d9b7a5621f943cc5ceeb88a858009e3 Reviewed-on: https://chromium-review.googlesource.com/328254Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 1fbc59fe
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "common/platform.h" #include "common/platform.h"
#include "libANGLE/renderer/d3d/formatutilsD3D.h" #include "libANGLE/renderer/d3d/formatutilsD3D.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h" #include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.h"
namespace rx namespace rx
{ {
...@@ -37,6 +38,10 @@ struct LoadImageFunctionInfo ...@@ -37,6 +38,10 @@ struct LoadImageFunctionInfo
struct DXGIFormatSet struct DXGIFormatSet
{ {
DXGIFormatSet(); DXGIFormatSet();
DXGIFormatSet(DXGI_FORMAT texFormat,
DXGI_FORMAT srvFormat,
DXGI_FORMAT rtvFormat,
DXGI_FORMAT dsvFormat);
DXGIFormatSet(const DXGIFormatSet &) = default; DXGIFormatSet(const DXGIFormatSet &) = default;
DXGIFormatSet &operator=(const DXGIFormatSet &) = default; DXGIFormatSet &operator=(const DXGIFormatSet &) = default;
...@@ -49,10 +54,7 @@ struct DXGIFormatSet ...@@ -49,10 +54,7 @@ struct DXGIFormatSet
struct TextureFormat : public angle::NonCopyable struct TextureFormat : public angle::NonCopyable
{ {
TextureFormat(GLenum internalFormat, TextureFormat(GLenum internalFormat,
DXGI_FORMAT texFormat, const DXGIFormatSet &formatSet,
DXGI_FORMAT srvFormat,
DXGI_FORMAT rtvFormat,
DXGI_FORMAT dsvFormat,
InitializeTextureDataFunction internalFormatInitializer); InitializeTextureDataFunction internalFormatInitializer);
DXGIFormatSet formatSet; DXGIFormatSet formatSet;
...@@ -64,6 +66,8 @@ struct TextureFormat : public angle::NonCopyable ...@@ -64,6 +66,8 @@ struct TextureFormat : public angle::NonCopyable
LoadFunctionMap loadFunctions; LoadFunctionMap loadFunctions;
}; };
const DXGIFormatSet &GetANGLEFormatSet(ANGLEFormat angleFormat);
const TextureFormat &GetTextureFormatInfo(GLenum internalformat, const TextureFormat &GetTextureFormatInfo(GLenum internalformat,
const Renderer11DeviceCaps &renderer11DeviceCaps); const Renderer11DeviceCaps &renderer11DeviceCaps);
......
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_texture_format_table.py using data from texture_format_data.json
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
namespace rx
{
namespace d3d11
{
enum ANGLEFormat
{
ANGLE_FORMAT_A8_UNORM,
ANGLE_FORMAT_B4G4R4A4_UNORM,
ANGLE_FORMAT_B5G5R5A1_UNORM,
ANGLE_FORMAT_B5G6R5_UNORM,
ANGLE_FORMAT_B8G8R8A8_UNORM,
ANGLE_FORMAT_BC1_UNORM,
ANGLE_FORMAT_BC2_UNORM,
ANGLE_FORMAT_BC3_UNORM,
ANGLE_FORMAT_D16_UNORM_FL10,
ANGLE_FORMAT_D16_UNORM_FL9_3,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL10,
ANGLE_FORMAT_D24_UNORM_S8_UINT_FL9_3,
ANGLE_FORMAT_D32_FLOAT,
ANGLE_FORMAT_D32_FLOAT_S8X24_UINT_FL10,
ANGLE_FORMAT_NONE,
ANGLE_FORMAT_R10G10B10A2_UINT,
ANGLE_FORMAT_R10G10B10A2_UNORM,
ANGLE_FORMAT_R11G11B10_FLOAT,
ANGLE_FORMAT_R16G16B16A16_FLOAT,
ANGLE_FORMAT_R16G16B16A16_SINT,
ANGLE_FORMAT_R16G16B16A16_UINT,
ANGLE_FORMAT_R16G16_FLOAT,
ANGLE_FORMAT_R16G16_SINT,
ANGLE_FORMAT_R16G16_UINT,
ANGLE_FORMAT_R16_FLOAT,
ANGLE_FORMAT_R16_SINT,
ANGLE_FORMAT_R16_UINT,
ANGLE_FORMAT_R32G32B32A32_FLOAT,
ANGLE_FORMAT_R32G32B32A32_SINT,
ANGLE_FORMAT_R32G32B32A32_UINT,
ANGLE_FORMAT_R32G32_FLOAT,
ANGLE_FORMAT_R32G32_SINT,
ANGLE_FORMAT_R32G32_UINT,
ANGLE_FORMAT_R32_FLOAT,
ANGLE_FORMAT_R32_SINT,
ANGLE_FORMAT_R32_UINT,
ANGLE_FORMAT_R8G8B8A8_SINT,
ANGLE_FORMAT_R8G8B8A8_SNORM,
ANGLE_FORMAT_R8G8B8A8_UINT,
ANGLE_FORMAT_R8G8B8A8_UNORM,
ANGLE_FORMAT_R8G8B8A8_UNORM_NONRENDERABLE,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB,
ANGLE_FORMAT_R8G8B8A8_UNORM_SRGB_NONRENDERABLE,
ANGLE_FORMAT_R8G8_SINT,
ANGLE_FORMAT_R8G8_SNORM,
ANGLE_FORMAT_R8G8_SNORM_NONRENDERABLE,
ANGLE_FORMAT_R8G8_UINT,
ANGLE_FORMAT_R8G8_UNORM,
ANGLE_FORMAT_R8G8_UNORM_NONRENDERABLE,
ANGLE_FORMAT_R8_SINT,
ANGLE_FORMAT_R8_SNORM,
ANGLE_FORMAT_R8_SNORM_NONRENDERABLE,
ANGLE_FORMAT_R8_UINT,
ANGLE_FORMAT_R8_UNORM,
ANGLE_FORMAT_R8_UNORM_NONRENDERABLE,
ANGLE_FORMAT_R9G9B9E5_SHAREDEXP,
ANGLE_FORMAT_X24_TYPELESS_G8_UINT
};
} // namespace d3d11
} // namespace rx
...@@ -387,6 +387,7 @@ ...@@ -387,6 +387,7 @@
'libANGLE/renderer/d3d/d3d11/Trim11.cpp', 'libANGLE/renderer/d3d/d3d11/Trim11.cpp',
'libANGLE/renderer/d3d/d3d11/Trim11.h', 'libANGLE/renderer/d3d/d3d11/Trim11.h',
'libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp', 'libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp',
'libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.h',
'libANGLE/renderer/d3d/d3d11/texture_format_table.h', 'libANGLE/renderer/d3d/d3d11/texture_format_table.h',
'libANGLE/renderer/d3d/d3d11/VertexArray11.h', 'libANGLE/renderer/d3d/d3d11/VertexArray11.h',
'libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp', 'libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment