From 0a7aebadfbb3534284546aa3ca8612314c08f136 Mon Sep 17 00:00:00 2001 From: Miguel Costa Date: Tue, 26 Jun 2018 16:56:45 +0200 Subject: Update ANGLE to chromium/3280 Change-Id: I0802c0d7486f772d361f87a544d6c5af937f4ca1 Reviewed-by: Friedemann Kleint --- src/3rdparty/angle/src/libANGLE/renderer/Format.h | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/3rdparty/angle/src/libANGLE/renderer/Format.h (limited to 'src/3rdparty/angle/src/libANGLE/renderer/Format.h') diff --git a/src/3rdparty/angle/src/libANGLE/renderer/Format.h b/src/3rdparty/angle/src/libANGLE/renderer/Format.h new file mode 100644 index 0000000000..66bdace3e9 --- /dev/null +++ b/src/3rdparty/angle/src/libANGLE/renderer/Format.h @@ -0,0 +1,105 @@ +// +// 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. +// +// Format: +// A universal description of typed GPU storage. Across multiple +// renderer back-ends, there are common formats and some distinct +// permutations, this enum encapsulates them all. Formats apply to +// textures, but could also apply to any typed data. + +#ifndef LIBANGLE_RENDERER_FORMAT_H_ +#define LIBANGLE_RENDERER_FORMAT_H_ + +#include "libANGLE/renderer/renderer_utils.h" + +namespace angle +{ + +struct Format final : private angle::NonCopyable +{ + enum class ID; + + constexpr Format(ID id, + GLenum glFormat, + GLenum fboFormat, + rx::MipGenerationFunction mipGen, + const rx::FastCopyFunctionMap &fastCopyFunctions, + rx::ColorReadFunction colorRead, + rx::ColorWriteFunction colorWrite, + GLenum componentType, + GLuint redBits, + GLuint greenBits, + GLuint blueBits, + GLuint alphaBits, + GLuint depthBits, + GLuint stencilBits); + + static const Format &Get(ID id); + static ID InternalFormatToID(GLenum internalFormat); + + ID id; + + // The closest matching GL internal format for the storage this format uses. Note that this + // may be a different internal format than the one this ANGLE format is used for. + GLenum glInternalFormat; + + // The format we should report to the GL layer when querying implementation formats from a FBO. + // This might not be the same as the glInternalFormat, since some DXGI formats don't have + // matching GL format enums, like BGRA4, BGR5A1 and B5G6R6. + GLenum fboImplementationInternalFormat; + + rx::MipGenerationFunction mipGenerationFunction; + rx::ColorReadFunction colorReadFunction; + rx::ColorWriteFunction colorWriteFunction; + + // A map from a gl::FormatType to a fast pixel copy function for this format. + const rx::FastCopyFunctionMap &fastCopyFunctions; + + GLenum componentType; + + GLuint redBits; + GLuint greenBits; + GLuint blueBits; + GLuint alphaBits; + GLuint depthBits; + GLuint stencilBits; +}; + +constexpr Format::Format(ID id, + GLenum glFormat, + GLenum fboFormat, + rx::MipGenerationFunction mipGen, + const rx::FastCopyFunctionMap &fastCopyFunctions, + rx::ColorReadFunction colorRead, + rx::ColorWriteFunction colorWrite, + GLenum componentType, + GLuint redBits, + GLuint greenBits, + GLuint blueBits, + GLuint alphaBits, + GLuint depthBits, + GLuint stencilBits) + : id(id), + glInternalFormat(glFormat), + fboImplementationInternalFormat(fboFormat), + mipGenerationFunction(mipGen), + colorReadFunction(colorRead), + colorWriteFunction(colorWrite), + fastCopyFunctions(fastCopyFunctions), + componentType(componentType), + redBits(redBits), + greenBits(greenBits), + blueBits(blueBits), + alphaBits(alphaBits), + depthBits(depthBits), + stencilBits(stencilBits) +{ +} + +} // namespace angle + +#include "libANGLE/renderer/Format_ID_autogen.inl" + +#endif // LIBANGLE_RENDERER_FORMAT_H_ -- cgit v1.2.3